From cd8dd7a86909c990fc334f1a87ffff4b20445504 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 28 Feb 2023 12:04:05 +0300 Subject: [PATCH 01/30] extending file protocol --- commonfile/fileproto/file.pb.go | 1424 +++++++++++++++++++++++- commonfile/fileproto/file_drpc.pb.go | 164 ++- commonfile/fileproto/protos/file.proto | 40 + 3 files changed, 1586 insertions(+), 42 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index f0b84530..b00856eb 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -602,6 +602,254 @@ func (m *BlocksBindResponse) XXX_DiscardUnknown() { var xxx_messageInfo_BlocksBindResponse proto.InternalMessageInfo +type FilesBindRequest struct { + FileCids [][]byte `protobuf:"bytes,1,rep,name=fileCids,proto3" json:"fileCids,omitempty"` +} + +func (m *FilesBindRequest) Reset() { *m = FilesBindRequest{} } +func (m *FilesBindRequest) String() string { return proto.CompactTextString(m) } +func (*FilesBindRequest) ProtoMessage() {} +func (*FilesBindRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{11} +} +func (m *FilesBindRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FilesBindRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FilesBindRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FilesBindRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilesBindRequest.Merge(m, src) +} +func (m *FilesBindRequest) XXX_Size() int { + return m.Size() +} +func (m *FilesBindRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FilesBindRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FilesBindRequest proto.InternalMessageInfo + +func (m *FilesBindRequest) GetFileCids() [][]byte { + if m != nil { + return m.FileCids + } + return nil +} + +type FilesBindResponse struct { +} + +func (m *FilesBindResponse) Reset() { *m = FilesBindResponse{} } +func (m *FilesBindResponse) String() string { return proto.CompactTextString(m) } +func (*FilesBindResponse) ProtoMessage() {} +func (*FilesBindResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{12} +} +func (m *FilesBindResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FilesBindResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FilesBindResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FilesBindResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilesBindResponse.Merge(m, src) +} +func (m *FilesBindResponse) XXX_Size() int { + return m.Size() +} +func (m *FilesBindResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FilesBindResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_FilesBindResponse proto.InternalMessageInfo + +type FilesDeleteRequest struct { + FileCids [][]byte `protobuf:"bytes,1,rep,name=fileCids,proto3" json:"fileCids,omitempty"` +} + +func (m *FilesDeleteRequest) Reset() { *m = FilesDeleteRequest{} } +func (m *FilesDeleteRequest) String() string { return proto.CompactTextString(m) } +func (*FilesDeleteRequest) ProtoMessage() {} +func (*FilesDeleteRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{13} +} +func (m *FilesDeleteRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FilesDeleteRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FilesDeleteRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FilesDeleteRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilesDeleteRequest.Merge(m, src) +} +func (m *FilesDeleteRequest) XXX_Size() int { + return m.Size() +} +func (m *FilesDeleteRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FilesDeleteRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FilesDeleteRequest proto.InternalMessageInfo + +func (m *FilesDeleteRequest) GetFileCids() [][]byte { + if m != nil { + return m.FileCids + } + return nil +} + +type FilesDeleteResponse struct { +} + +func (m *FilesDeleteResponse) Reset() { *m = FilesDeleteResponse{} } +func (m *FilesDeleteResponse) String() string { return proto.CompactTextString(m) } +func (*FilesDeleteResponse) ProtoMessage() {} +func (*FilesDeleteResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{14} +} +func (m *FilesDeleteResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FilesDeleteResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FilesDeleteResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FilesDeleteResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilesDeleteResponse.Merge(m, src) +} +func (m *FilesDeleteResponse) XXX_Size() int { + return m.Size() +} +func (m *FilesDeleteResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FilesDeleteResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_FilesDeleteResponse proto.InternalMessageInfo + +type FilesCheckRequest struct { + FileCids [][]byte `protobuf:"bytes,1,rep,name=fileCids,proto3" json:"fileCids,omitempty"` +} + +func (m *FilesCheckRequest) Reset() { *m = FilesCheckRequest{} } +func (m *FilesCheckRequest) String() string { return proto.CompactTextString(m) } +func (*FilesCheckRequest) ProtoMessage() {} +func (*FilesCheckRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{15} +} +func (m *FilesCheckRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FilesCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FilesCheckRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FilesCheckRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilesCheckRequest.Merge(m, src) +} +func (m *FilesCheckRequest) XXX_Size() int { + return m.Size() +} +func (m *FilesCheckRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FilesCheckRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_FilesCheckRequest proto.InternalMessageInfo + +func (m *FilesCheckRequest) GetFileCids() [][]byte { + if m != nil { + return m.FileCids + } + return nil +} + +type FilesCheckResponse struct { + BlocksAvailability []*BlockAvailability `protobuf:"bytes,1,rep,name=blocksAvailability,proto3" json:"blocksAvailability,omitempty"` +} + +func (m *FilesCheckResponse) Reset() { *m = FilesCheckResponse{} } +func (m *FilesCheckResponse) String() string { return proto.CompactTextString(m) } +func (*FilesCheckResponse) ProtoMessage() {} +func (*FilesCheckResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{16} +} +func (m *FilesCheckResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FilesCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FilesCheckResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FilesCheckResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilesCheckResponse.Merge(m, src) +} +func (m *FilesCheckResponse) XXX_Size() int { + return m.Size() +} +func (m *FilesCheckResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FilesCheckResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_FilesCheckResponse proto.InternalMessageInfo + +func (m *FilesCheckResponse) GetBlocksAvailability() []*BlockAvailability { + if m != nil { + return m.BlocksAvailability + } + return nil +} + type CheckRequest struct { } @@ -609,7 +857,7 @@ func (m *CheckRequest) Reset() { *m = CheckRequest{} } func (m *CheckRequest) String() string { return proto.CompactTextString(m) } func (*CheckRequest) ProtoMessage() {} func (*CheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{11} + return fileDescriptor_fd665a7e11c833d5, []int{17} } func (m *CheckRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -647,7 +895,7 @@ func (m *CheckResponse) Reset() { *m = CheckResponse{} } func (m *CheckResponse) String() string { return proto.CompactTextString(m) } func (*CheckResponse) ProtoMessage() {} func (*CheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{12} + return fileDescriptor_fd665a7e11c833d5, []int{18} } func (m *CheckResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -690,6 +938,110 @@ func (m *CheckResponse) GetAllowWrite() bool { return false } +type CheckUsageRequest struct { + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` +} + +func (m *CheckUsageRequest) Reset() { *m = CheckUsageRequest{} } +func (m *CheckUsageRequest) String() string { return proto.CompactTextString(m) } +func (*CheckUsageRequest) ProtoMessage() {} +func (*CheckUsageRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{19} +} +func (m *CheckUsageRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CheckUsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CheckUsageRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CheckUsageRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckUsageRequest.Merge(m, src) +} +func (m *CheckUsageRequest) XXX_Size() int { + return m.Size() +} +func (m *CheckUsageRequest) XXX_DiscardUnknown() { + xxx_messageInfo_CheckUsageRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_CheckUsageRequest proto.InternalMessageInfo + +func (m *CheckUsageRequest) GetSpaceId() string { + if m != nil { + return m.SpaceId + } + return "" +} + +type CheckUsageResponse struct { + LimitBytes uint64 `protobuf:"varint,1,opt,name=limitBytes,proto3" json:"limitBytes,omitempty"` + UsageBytes uint64 `protobuf:"varint,2,opt,name=usageBytes,proto3" json:"usageBytes,omitempty"` + UsageCids uint64 `protobuf:"varint,3,opt,name=usageCids,proto3" json:"usageCids,omitempty"` +} + +func (m *CheckUsageResponse) Reset() { *m = CheckUsageResponse{} } +func (m *CheckUsageResponse) String() string { return proto.CompactTextString(m) } +func (*CheckUsageResponse) ProtoMessage() {} +func (*CheckUsageResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{20} +} +func (m *CheckUsageResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *CheckUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_CheckUsageResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *CheckUsageResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_CheckUsageResponse.Merge(m, src) +} +func (m *CheckUsageResponse) XXX_Size() int { + return m.Size() +} +func (m *CheckUsageResponse) XXX_DiscardUnknown() { + xxx_messageInfo_CheckUsageResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_CheckUsageResponse proto.InternalMessageInfo + +func (m *CheckUsageResponse) GetLimitBytes() uint64 { + if m != nil { + return m.LimitBytes + } + return 0 +} + +func (m *CheckUsageResponse) GetUsageBytes() uint64 { + if m != nil { + return m.UsageBytes + } + return 0 +} + +func (m *CheckUsageResponse) GetUsageCids() uint64 { + if m != nil { + return m.UsageCids + } + return 0 +} + func init() { proto.RegisterEnum("filesync.ErrCodes", ErrCodes_name, ErrCodes_value) proto.RegisterEnum("filesync.AvailabilityStatus", AvailabilityStatus_name, AvailabilityStatus_value) @@ -704,8 +1056,16 @@ func init() { proto.RegisterType((*BlockAvailability)(nil), "filesync.BlockAvailability") proto.RegisterType((*BlocksBindRequest)(nil), "filesync.BlocksBindRequest") proto.RegisterType((*BlocksBindResponse)(nil), "filesync.BlocksBindResponse") + proto.RegisterType((*FilesBindRequest)(nil), "filesync.FilesBindRequest") + proto.RegisterType((*FilesBindResponse)(nil), "filesync.FilesBindResponse") + proto.RegisterType((*FilesDeleteRequest)(nil), "filesync.FilesDeleteRequest") + proto.RegisterType((*FilesDeleteResponse)(nil), "filesync.FilesDeleteResponse") + proto.RegisterType((*FilesCheckRequest)(nil), "filesync.FilesCheckRequest") + proto.RegisterType((*FilesCheckResponse)(nil), "filesync.FilesCheckResponse") proto.RegisterType((*CheckRequest)(nil), "filesync.CheckRequest") proto.RegisterType((*CheckResponse)(nil), "filesync.CheckResponse") + proto.RegisterType((*CheckUsageRequest)(nil), "filesync.CheckUsageRequest") + proto.RegisterType((*CheckUsageResponse)(nil), "filesync.CheckUsageResponse") } func init() { @@ -713,44 +1073,53 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 582 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xcf, 0x6e, 0xda, 0x4e, - 0x10, 0xc6, 0x21, 0x3f, 0x7e, 0x30, 0xfc, 0x89, 0x33, 0x41, 0x29, 0x75, 0xa8, 0x85, 0x7c, 0xa8, - 0x50, 0x0e, 0x44, 0xa2, 0x3d, 0xe4, 0x92, 0x03, 0xff, 0x12, 0xd1, 0xa8, 0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, 0xa1, 0xba, 0x4a, 0x22, 0xc9, 0xbb, 0x80, 0x91, 0xbf, 0x77, 0x43, 0xec, 0xdb, 0xed, - 0xb8, 0x47, 0xf1, 0x05, 0x25, 0x87, 0x94, 0xf1, 0x12, 0x70, 0x24, 0xdc, 0x9d, 0xef, 0x96, 0xeb, - 0x59, 0x23, 0xd7, 0x73, 0xf9, 0x43, 0x4d, 0x69, 0x64, 0x9b, 0xc5, 0xf6, 0x51, 0x2b, 0x6e, 0x60, - 0x4b, 0xa4, 0x26, 0x21, 0x66, 0x4a, 0x9a, 0xf1, 0x55, 0x2a, 0x93, 0x74, 0xa6, 0x34, 0xea, 0x2d, - 0xe4, 0x18, 0xb7, 0xf8, 0x94, 0x09, 0xa5, 0x2b, 0xed, 0xfa, 0xb2, 0x4e, 0x32, 0xf3, 0x5a, 0x60, - 0x4c, 0x89, 0x35, 0x3a, 0x92, 0x9c, 0x75, 0x5d, 0xdf, 0xd9, 0x4e, 0x83, 0x6a, 0xac, 0x63, 0x44, - 0x21, 0xd5, 0xad, 0x40, 0x29, 0xa9, 0xab, 0x71, 0x09, 0xe5, 0x55, 0x8d, 0x34, 0xc8, 0x4b, 0x56, - 0x26, 0x94, 0x29, 0x98, 0x8b, 0x33, 0xea, 0x00, 0x96, 0xe7, 0xd1, 0x1f, 0x9f, 0x03, 0x97, 0x13, - 0xf1, 0x9e, 0xbc, 0x99, 0xf0, 0x1c, 0x9f, 0x41, 0x7e, 0x10, 0x04, 0x3d, 0xea, 0x10, 0x86, 0x15, - 0x80, 0x4f, 0x3e, 0xb9, 0x9f, 0x10, 0x9b, 0x13, 0x47, 0xcd, 0xe0, 0x1e, 0x14, 0x7b, 0xc3, 0xfe, - 0x15, 0xe5, 0xe7, 0x74, 0xea, 0x3b, 0xaa, 0x82, 0x2a, 0x14, 0x07, 0x41, 0x40, 0x83, 0x0f, 0xe3, - 0x31, 0x23, 0x5c, 0x7d, 0x54, 0x8e, 0xbb, 0x80, 0x9b, 0x92, 0x60, 0x19, 0x0a, 0x57, 0x94, 0x0f, - 0xee, 0x5d, 0xc6, 0x99, 0x9a, 0x41, 0x80, 0x9c, 0xb4, 0x15, 0xdc, 0x87, 0x72, 0x64, 0x0f, 0xfd, - 0xeb, 0xf0, 0x8e, 0xea, 0x4e, 0xfb, 0x57, 0x16, 0x76, 0xcf, 0x5d, 0x8f, 0x60, 0x07, 0xf2, 0xf1, - 0x1a, 0xe1, 0xcb, 0xb5, 0xde, 0x2e, 0x37, 0x53, 0xd3, 0xd2, 0x42, 0x52, 0x8a, 0x3e, 0x14, 0x16, - 0xb3, 0x8f, 0xeb, 0xc0, 0xc4, 0x92, 0x69, 0x47, 0xa9, 0x31, 0xc9, 0xf2, 0x0e, 0x8a, 0x89, 0x59, - 0xc4, 0xfa, 0x1a, 0x76, 0x65, 0xcc, 0xb5, 0x57, 0xcf, 0x44, 0x25, 0xd7, 0x05, 0xc0, 0xb2, 0xa7, - 0xb8, 0x5e, 0x36, 0x39, 0x2c, 0x5a, 0x3d, 0x3d, 0x28, 0x89, 0xde, 0x43, 0x29, 0xb9, 0x7c, 0xb8, - 0x51, 0x77, 0x65, 0xb3, 0x35, 0xfd, 0xb9, 0xb0, 0xa4, 0x3b, 0x85, 0xff, 0xa2, 0xd7, 0x1d, 0x2e, - 0x81, 0x2b, 0xef, 0x7a, 0xb1, 0xe1, 0x8f, 0x32, 0xbb, 0xad, 0xc7, 0x99, 0xae, 0x3c, 0xcd, 0x74, - 0xe5, 0xcf, 0x4c, 0x57, 0x7e, 0xce, 0xf5, 0xcc, 0xd3, 0x5c, 0xcf, 0xfc, 0x9e, 0xeb, 0x99, 0x2f, - 0xd5, 0xb4, 0x3f, 0xde, 0x51, 0x4e, 0xfc, 0xbc, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xe8, - 0xf5, 0x9b, 0x97, 0x05, 0x00, 0x00, + // 734 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00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ockGetRequest) Marshal() (dAtA []byte, err error) { @@ -1129,6 +1498,185 @@ func (m *BlocksBindResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *FilesBindRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FilesBindRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FilesBindRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FileCids) > 0 { + for iNdEx := len(m.FileCids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.FileCids[iNdEx]) + copy(dAtA[i:], m.FileCids[iNdEx]) + i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FilesBindResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FilesBindResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FilesBindResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *FilesDeleteRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FilesDeleteRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FilesDeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FileCids) > 0 { + for iNdEx := len(m.FileCids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.FileCids[iNdEx]) + copy(dAtA[i:], m.FileCids[iNdEx]) + i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FilesDeleteResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FilesDeleteResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FilesDeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *FilesCheckRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FilesCheckRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FilesCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FileCids) > 0 { + for iNdEx := len(m.FileCids) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.FileCids[iNdEx]) + copy(dAtA[i:], m.FileCids[iNdEx]) + i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *FilesCheckResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FilesCheckResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FilesCheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BlocksAvailability) > 0 { + for iNdEx := len(m.BlocksAvailability) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BlocksAvailability[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintFile(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func (m *CheckRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1194,6 +1742,74 @@ func (m *CheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *CheckUsageRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CheckUsageRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckUsageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SpaceId) > 0 { + i -= len(m.SpaceId) + copy(dAtA[i:], m.SpaceId) + i = encodeVarintFile(dAtA, i, uint64(len(m.SpaceId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *CheckUsageResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *CheckUsageResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CheckUsageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UsageCids != 0 { + i = encodeVarintFile(dAtA, i, uint64(m.UsageCids)) + i-- + dAtA[i] = 0x18 + } + if m.UsageBytes != 0 { + i = encodeVarintFile(dAtA, i, uint64(m.UsageBytes)) + i-- + dAtA[i] = 0x10 + } + if m.LimitBytes != 0 { + i = encodeVarintFile(dAtA, i, uint64(m.LimitBytes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintFile(dAtA []byte, offset int, v uint64) int { offset -= sovFile(v) base := offset @@ -1375,6 +1991,84 @@ func (m *BlocksBindResponse) Size() (n int) { return n } +func (m *FilesBindRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FileCids) > 0 { + for _, b := range m.FileCids { + l = len(b) + n += 1 + l + sovFile(uint64(l)) + } + } + return n +} + +func (m *FilesBindResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *FilesDeleteRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FileCids) > 0 { + for _, b := range m.FileCids { + l = len(b) + n += 1 + l + sovFile(uint64(l)) + } + } + return n +} + +func (m *FilesDeleteResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *FilesCheckRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.FileCids) > 0 { + for _, b := range m.FileCids { + l = len(b) + n += 1 + l + sovFile(uint64(l)) + } + } + return n +} + +func (m *FilesCheckResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BlocksAvailability) > 0 { + for _, e := range m.BlocksAvailability { + l = e.Size() + n += 1 + l + sovFile(uint64(l)) + } + } + return n +} + func (m *CheckRequest) Size() (n int) { if m == nil { return 0 @@ -1402,6 +2096,37 @@ func (m *CheckResponse) Size() (n int) { return n } +func (m *CheckUsageRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SpaceId) + if l > 0 { + n += 1 + l + sovFile(uint64(l)) + } + return n +} + +func (m *CheckUsageResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.LimitBytes != 0 { + n += 1 + sovFile(uint64(m.LimitBytes)) + } + if m.UsageBytes != 0 { + n += 1 + sovFile(uint64(m.UsageBytes)) + } + if m.UsageCids != 0 { + n += 1 + sovFile(uint64(m.UsageCids)) + } + return n +} + func sovFile(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2471,6 +3196,436 @@ func (m *BlocksBindResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *FilesBindRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilesBindRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilesBindRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FileCids = append(m.FileCids, make([]byte, postIndex-iNdEx)) + copy(m.FileCids[len(m.FileCids)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FilesBindResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilesBindResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilesBindResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FilesDeleteRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilesDeleteRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilesDeleteRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FileCids = append(m.FileCids, make([]byte, postIndex-iNdEx)) + copy(m.FileCids[len(m.FileCids)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FilesDeleteResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilesDeleteResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilesDeleteResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilesCheckRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilesCheckRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FileCids = append(m.FileCids, make([]byte, postIndex-iNdEx)) + copy(m.FileCids[len(m.FileCids)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *FilesCheckResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FilesCheckResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FilesCheckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlocksAvailability", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlocksAvailability = append(m.BlocksAvailability, &BlockAvailability{}) + if err := m.BlocksAvailability[len(m.BlocksAvailability)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *CheckRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -2623,6 +3778,195 @@ func (m *CheckResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *CheckUsageRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CheckUsageRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckUsageRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpaceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: CheckUsageResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: CheckUsageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LimitBytes", wireType) + } + m.LimitBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LimitBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UsageBytes", wireType) + } + m.UsageBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UsageBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UsageCids", wireType) + } + m.UsageCids = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UsageCids |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipFile(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/commonfile/fileproto/file_drpc.pb.go b/commonfile/fileproto/file_drpc.pb.go index fcc7d66a..bd0f833d 100644 --- a/commonfile/fileproto/file_drpc.pb.go +++ b/commonfile/fileproto/file_drpc.pb.go @@ -44,8 +44,12 @@ type DRPCFileClient interface { BlockPush(ctx context.Context, in *BlockPushRequest) (*BlockPushResponse, error) BlocksCheck(ctx context.Context, in *BlocksCheckRequest) (*BlocksCheckResponse, error) BlocksBind(ctx context.Context, in *BlocksBindRequest) (*BlocksBindResponse, error) + FilesBind(ctx context.Context, in *FilesBindRequest) (*FilesBindResponse, error) + FilesDelete(ctx context.Context, in *FilesDeleteRequest) (*FilesDeleteResponse, error) + FilesCheck(ctx context.Context, in *FilesCheckRequest) (*FilesCheckResponse, error) BlocksDelete(ctx context.Context, in *BlocksDeleteRequest) (*BlocksDeleteResponse, error) Check(ctx context.Context, in *CheckRequest) (*CheckResponse, error) + CheckUsage(ctx context.Context, in *CheckUsageRequest) (*CheckUsageResponse, error) } type drpcFileClient struct { @@ -94,6 +98,33 @@ func (c *drpcFileClient) BlocksBind(ctx context.Context, in *BlocksBindRequest) return out, nil } +func (c *drpcFileClient) FilesBind(ctx context.Context, in *FilesBindRequest) (*FilesBindResponse, error) { + out := new(FilesBindResponse) + err := c.cc.Invoke(ctx, "/filesync.File/FilesBind", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcFileClient) FilesDelete(ctx context.Context, in *FilesDeleteRequest) (*FilesDeleteResponse, error) { + out := new(FilesDeleteResponse) + err := c.cc.Invoke(ctx, "/filesync.File/FilesDelete", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *drpcFileClient) FilesCheck(ctx context.Context, in *FilesCheckRequest) (*FilesCheckResponse, error) { + out := new(FilesCheckResponse) + err := c.cc.Invoke(ctx, "/filesync.File/FilesCheck", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) + if err != nil { + return nil, err + } + return out, nil +} + func (c *drpcFileClient) BlocksDelete(ctx context.Context, in *BlocksDeleteRequest) (*BlocksDeleteResponse, error) { out := new(BlocksDeleteResponse) err := c.cc.Invoke(ctx, "/filesync.File/BlocksDelete", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) @@ -112,13 +143,26 @@ func (c *drpcFileClient) Check(ctx context.Context, in *CheckRequest) (*CheckRes return out, nil } +func (c *drpcFileClient) CheckUsage(ctx context.Context, in *CheckUsageRequest) (*CheckUsageResponse, error) { + out := new(CheckUsageResponse) + err := c.cc.Invoke(ctx, "/filesync.File/CheckUsage", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) + if err != nil { + return nil, err + } + return out, nil +} + type DRPCFileServer interface { BlockGet(context.Context, *BlockGetRequest) (*BlockGetResponse, error) BlockPush(context.Context, *BlockPushRequest) (*BlockPushResponse, error) BlocksCheck(context.Context, *BlocksCheckRequest) (*BlocksCheckResponse, error) BlocksBind(context.Context, *BlocksBindRequest) (*BlocksBindResponse, error) + FilesBind(context.Context, *FilesBindRequest) (*FilesBindResponse, error) + FilesDelete(context.Context, *FilesDeleteRequest) (*FilesDeleteResponse, error) + FilesCheck(context.Context, *FilesCheckRequest) (*FilesCheckResponse, error) BlocksDelete(context.Context, *BlocksDeleteRequest) (*BlocksDeleteResponse, error) Check(context.Context, *CheckRequest) (*CheckResponse, error) + CheckUsage(context.Context, *CheckUsageRequest) (*CheckUsageResponse, error) } type DRPCFileUnimplementedServer struct{} @@ -139,6 +183,18 @@ func (s *DRPCFileUnimplementedServer) BlocksBind(context.Context, *BlocksBindReq return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } +func (s *DRPCFileUnimplementedServer) FilesBind(context.Context, *FilesBindRequest) (*FilesBindResponse, error) { + return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) +} + +func (s *DRPCFileUnimplementedServer) FilesDelete(context.Context, *FilesDeleteRequest) (*FilesDeleteResponse, error) { + return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) +} + +func (s *DRPCFileUnimplementedServer) FilesCheck(context.Context, *FilesCheckRequest) (*FilesCheckResponse, error) { + return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) +} + func (s *DRPCFileUnimplementedServer) BlocksDelete(context.Context, *BlocksDeleteRequest) (*BlocksDeleteResponse, error) { return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } @@ -147,9 +203,13 @@ func (s *DRPCFileUnimplementedServer) Check(context.Context, *CheckRequest) (*Ch return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } +func (s *DRPCFileUnimplementedServer) CheckUsage(context.Context, *CheckUsageRequest) (*CheckUsageResponse, error) { + return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) +} + type DRPCFileDescription struct{} -func (DRPCFileDescription) NumMethods() int { return 6 } +func (DRPCFileDescription) NumMethods() int { return 10 } func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) { switch n { @@ -190,6 +250,33 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, ) }, DRPCFileServer.BlocksBind, true case 4: + return "/filesync.File/FilesBind", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCFileServer). + FilesBind( + ctx, + in1.(*FilesBindRequest), + ) + }, DRPCFileServer.FilesBind, true + case 5: + return "/filesync.File/FilesDelete", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCFileServer). + FilesDelete( + ctx, + in1.(*FilesDeleteRequest), + ) + }, DRPCFileServer.FilesDelete, true + case 6: + return "/filesync.File/FilesCheck", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCFileServer). + FilesCheck( + ctx, + in1.(*FilesCheckRequest), + ) + }, DRPCFileServer.FilesCheck, true + case 7: return "/filesync.File/BlocksDelete", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCFileServer). @@ -198,7 +285,7 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, in1.(*BlocksDeleteRequest), ) }, DRPCFileServer.BlocksDelete, true - case 5: + case 8: return "/filesync.File/Check", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCFileServer). @@ -207,6 +294,15 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, in1.(*CheckRequest), ) }, DRPCFileServer.Check, true + case 9: + return "/filesync.File/CheckUsage", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, + func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { + return srv.(DRPCFileServer). + CheckUsage( + ctx, + in1.(*CheckUsageRequest), + ) + }, DRPCFileServer.CheckUsage, true default: return "", nil, nil, nil, false } @@ -280,6 +376,54 @@ func (x *drpcFile_BlocksBindStream) SendAndClose(m *BlocksBindResponse) error { return x.CloseSend() } +type DRPCFile_FilesBindStream interface { + drpc.Stream + SendAndClose(*FilesBindResponse) error +} + +type drpcFile_FilesBindStream struct { + drpc.Stream +} + +func (x *drpcFile_FilesBindStream) SendAndClose(m *FilesBindResponse) error { + if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCFile_FilesDeleteStream interface { + drpc.Stream + SendAndClose(*FilesDeleteResponse) error +} + +type drpcFile_FilesDeleteStream struct { + drpc.Stream +} + +func (x *drpcFile_FilesDeleteStream) SendAndClose(m *FilesDeleteResponse) error { + if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil { + return err + } + return x.CloseSend() +} + +type DRPCFile_FilesCheckStream interface { + drpc.Stream + SendAndClose(*FilesCheckResponse) error +} + +type drpcFile_FilesCheckStream struct { + drpc.Stream +} + +func (x *drpcFile_FilesCheckStream) SendAndClose(m *FilesCheckResponse) error { + if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil { + return err + } + return x.CloseSend() +} + type DRPCFile_BlocksDeleteStream interface { drpc.Stream SendAndClose(*BlocksDeleteResponse) error @@ -311,3 +455,19 @@ func (x *drpcFile_CheckStream) SendAndClose(m *CheckResponse) error { } return x.CloseSend() } + +type DRPCFile_CheckUsageStream interface { + drpc.Stream + SendAndClose(*CheckUsageResponse) error +} + +type drpcFile_CheckUsageStream struct { + drpc.Stream +} + +func (x *drpcFile_CheckUsageStream) SendAndClose(m *CheckUsageResponse) error { + if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil { + return err + } + return x.CloseSend() +} diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index e7610b83..a7c58b61 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -18,10 +18,18 @@ service File { rpc BlocksCheck(BlocksCheckRequest) returns (BlocksCheckResponse); // BlocksBind binds CIDs to space rpc BlocksBind(BlocksBindRequest) returns (BlocksBindResponse); + // FilesBind binds root file CIDs and their children to space + rpc FilesBind(FilesBindRequest) returns (FilesBindResponse); + // FilesDelete deletes file CIDs and their children from space + rpc FilesDelete(FilesDeleteRequest) returns (FilesDeleteResponse); + // FileCheck checks file CIDs and children for exists + rpc FilesCheck(FilesCheckRequest) returns (FilesCheckResponse); // BlocksDelete deletes block from space rpc BlocksDelete(BlocksDeleteRequest) returns (BlocksDeleteResponse); // Check checks the connection and credentials rpc Check(CheckRequest) returns (CheckResponse); + // CheckUsage checks current usage and limits for a space + rpc CheckUsage(CheckUsageRequest) returns (CheckUsageResponse); } message BlockGetRequest { @@ -77,9 +85,41 @@ message BlocksBindRequest { message BlocksBindResponse {} + +message FilesBindRequest { + repeated bytes fileCids = 1; +} + +message FilesBindResponse {} + +message FilesDeleteRequest { + repeated bytes fileCids = 1; +} + +message FilesDeleteResponse {} + +message FilesCheckRequest { + repeated bytes fileCids = 1; +} + +message FilesCheckResponse { + repeated BlockAvailability blocksAvailability = 1; +} + message CheckRequest {} message CheckResponse { repeated string spaceIds = 1; bool allowWrite = 2; } + +message CheckUsageRequest { + string spaceId = 1; +} + +message CheckUsageResponse { + uint64 limitBytes = 1; + uint64 usageBytes = 2; + uint64 usageCids = 3; +} + From c42c4415bf48cf7e0f1017b26466c57a9bb1229c Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 28 Feb 2023 12:26:19 +0300 Subject: [PATCH 02/30] fix fileproto --- commonfile/fileproto/file.pb.go | 259 ++++++++++++++++++++----- commonfile/fileproto/protos/file.proto | 9 +- 2 files changed, 212 insertions(+), 56 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index b00856eb..b4f3f839 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -603,7 +603,8 @@ func (m *BlocksBindResponse) XXX_DiscardUnknown() { var xxx_messageInfo_BlocksBindResponse proto.InternalMessageInfo type FilesBindRequest struct { - FileCids [][]byte `protobuf:"bytes,1,rep,name=fileCids,proto3" json:"fileCids,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + FileCids [][]byte `protobuf:"bytes,2,rep,name=fileCids,proto3" json:"fileCids,omitempty"` } func (m *FilesBindRequest) Reset() { *m = FilesBindRequest{} } @@ -639,6 +640,13 @@ func (m *FilesBindRequest) XXX_DiscardUnknown() { var xxx_messageInfo_FilesBindRequest proto.InternalMessageInfo +func (m *FilesBindRequest) GetSpaceId() string { + if m != nil { + return m.SpaceId + } + return "" +} + func (m *FilesBindRequest) GetFileCids() [][]byte { if m != nil { return m.FileCids @@ -683,7 +691,8 @@ func (m *FilesBindResponse) XXX_DiscardUnknown() { var xxx_messageInfo_FilesBindResponse proto.InternalMessageInfo type FilesDeleteRequest struct { - FileCids [][]byte `protobuf:"bytes,1,rep,name=fileCids,proto3" json:"fileCids,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + FileCids [][]byte `protobuf:"bytes,2,rep,name=fileCids,proto3" json:"fileCids,omitempty"` } func (m *FilesDeleteRequest) Reset() { *m = FilesDeleteRequest{} } @@ -719,6 +728,13 @@ func (m *FilesDeleteRequest) XXX_DiscardUnknown() { var xxx_messageInfo_FilesDeleteRequest proto.InternalMessageInfo +func (m *FilesDeleteRequest) GetSpaceId() string { + if m != nil { + return m.SpaceId + } + return "" +} + func (m *FilesDeleteRequest) GetFileCids() [][]byte { if m != nil { return m.FileCids @@ -763,7 +779,8 @@ func (m *FilesDeleteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_FilesDeleteResponse proto.InternalMessageInfo type FilesCheckRequest struct { - FileCids [][]byte `protobuf:"bytes,1,rep,name=fileCids,proto3" json:"fileCids,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + FileCids [][]byte `protobuf:"bytes,2,rep,name=fileCids,proto3" json:"fileCids,omitempty"` } func (m *FilesCheckRequest) Reset() { *m = FilesCheckRequest{} } @@ -799,6 +816,13 @@ func (m *FilesCheckRequest) XXX_DiscardUnknown() { var xxx_messageInfo_FilesCheckRequest proto.InternalMessageInfo +func (m *FilesCheckRequest) GetSpaceId() string { + if m != nil { + return m.SpaceId + } + return "" +} + func (m *FilesCheckRequest) GetFileCids() [][]byte { if m != nil { return m.FileCids @@ -1073,53 +1097,53 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 734 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x4e, 0xdb, 0x4c, - 0x14, 0x8e, 0x93, 0xc0, 0x9f, 0x9c, 0x70, 0x31, 0x07, 0x7e, 0x9a, 0x9a, 0xd4, 0x8a, 0xbc, 0xa8, - 0x10, 0x52, 0x43, 0x45, 0xbb, 0x60, 0xc3, 0x82, 0x84, 0x8b, 0x28, 0x2a, 0xad, 0x8c, 0x50, 0xa5, - 0x76, 0xe5, 0xd8, 0x43, 0xb1, 0x30, 0x76, 0xea, 0x99, 0xb4, 0xf0, 0x16, 0x7d, 0x2c, 0x96, 0x74, - 0xd7, 0x65, 0x05, 0x2f, 0x52, 0xcd, 0x78, 0x12, 0x8f, 0x63, 0x03, 0x12, 0x52, 0x37, 0xe6, 0xcc, - 0xb9, 0x7c, 0xe7, 0x36, 0xdf, 0x10, 0x78, 0xe9, 0x46, 0x17, 0x17, 0x51, 0x78, 0xea, 0x07, 0x64, - 0x9d, 0x7f, 0x06, 0x71, 0xc4, 0xa2, 0x75, 0xf1, 0xa5, 0x42, 0xd1, 0x11, 0x32, 0xd6, 0xb8, 0x4c, - 0xaf, 0x42, 0xd7, 0xda, 0x82, 0xf9, 0x6e, 0x10, 0xb9, 0xe7, 0xfb, 0x84, 0xd9, 0xe4, 0xdb, 0x90, - 0x50, 0x86, 0x4d, 0xf8, 0x8f, 0x0e, 0x1c, 0x97, 0x1c, 0x78, 0x4d, 0xad, 0xad, 0xad, 0xd6, 0xed, - 0xd1, 0x11, 0x75, 0xa8, 0xb8, 0xbe, 0xd7, 0x2c, 0xb7, 0xb5, 0xd5, 0x19, 0x9b, 0x8b, 0xd6, 0x26, - 0xe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f, 0xef, 0xcc, 0xd2, 0xe7, 0xa5, 0xa2, 0x5f, 0x18, 0xfd, 0x69, 0xf1, 0xe7, 0xcd, - 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x36, 0xfc, 0xdf, 0x80, 0x08, 0x00, 0x00, + // 736 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4b, 0x4f, 0xdb, 0x40, + 0x10, 0x8e, 0x93, 0x40, 0x93, 0x09, 0x0f, 0x33, 0x50, 0x9a, 0x9a, 0xd4, 0x8a, 0x7c, 0xa8, 0x10, + 0x52, 0x83, 0x44, 0x7b, 0xe0, 0xc2, 0x81, 0x84, 0x47, 0x03, 0x2a, 0xad, 0x8c, 0x50, 0xa5, 0xf6, + 0xe4, 0xd8, 0x4b, 0xb1, 0x30, 0x76, 0xea, 0xdd, 0xb4, 0xf0, 0x2f, 0xfa, 0xb3, 0x38, 0xd2, 0x5b, + 0x8f, 0x15, 0xfc, 0x91, 0xca, 0xeb, 0x4d, 0xbc, 0x8e, 0xcd, 0x43, 0x91, 0x7a, 0x31, 0xbb, 0xf3, + 0xf8, 0xbe, 0x99, 0xd9, 0x99, 0x21, 0xf0, 0xda, 0x0e, 0x2e, 0x2e, 0x02, 0xff, 0xd4, 0xf5, 0xc8, + 0x7a, 0xf4, 0xe9, 0x87, 0x01, 0x0b, 0xd6, 0xf9, 0x97, 0x72, 0x41, 0x8b, 0x9f, 0xb1, 0x12, 0x9d, + 0xe9, 0x95, 0x6f, 0x1b, 0x5b, 0x30, 0xdf, 0xf6, 0x02, 0xfb, 0x7c, 0x9f, 0x30, 0x93, 0x7c, 0x1f, + 0x10, 0xca, 0xb0, 0x0e, 0xcf, 0x68, 0xdf, 0xb2, 0x49, 0xd7, 0xa9, 0x2b, 0x4d, 0x65, 0xb5, 0x6a, + 0x0e, 0xaf, 0xa8, 0x42, 0xc9, 0x76,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xe0, 0x6d, 0xdd, 0x49, + 0xb0, 0x47, 0xf7, 0xa8, 0x33, 0x24, 0x24, 0x01, 0x7f, 0x00, 0xc8, 0x85, 0x4f, 0x6d, 0x8c, 0x87, + 0x08, 0x9e, 0xc3, 0x62, 0x0a, 0x4b, 0x50, 0x74, 0x05, 0xef, 0x13, 0xdb, 0xe3, 0x21, 0x06, 0x4b, + 0x44, 0xfb, 0x1f, 0xbb, 0x64, 0x0e, 0x66, 0xe4, 0x40, 0x8d, 0x43, 0x98, 0x4d, 0xb3, 0x69, 0x50, + 0x11, 0xa1, 0x52, 0xce, 0x51, 0x35, 0x47, 0x77, 0xd4, 0x01, 0x2c, 0xcf, 0x0b, 0x7e, 0x7e, 0x0e, + 0x5d, 0x46, 0x78, 0xff, 0x54, 0x4c, 0x49, 0x62, 0xbc, 0x81, 0x05, 0x0e, 0x76, 0x42, 0xad, 0x6f, + 0x8f, 0x17, 0xdb, 0x08, 0x01, 0x65, 0x73, 0x11, 0x80, 0x0e, 0xe0, 0xb9, 0x17, 0x2e, 0x6b, 0x5f, + 0x31, 0x42, 0xb9, 0x4b, 0xd9, 0x94, 0x24, 0x91, 0x7e, 0x10, 0x39, 0xc4, 0xfa, 0x62, 0xac, 0x4f, + 0x24, 0xd8, 0x80, 0x2a, 0xbf, 0xf1, 0x0a, 0x97, 0xb8, 0x3a, 0x11, 0xac, 0x6d, 0x41, 0x65, 0x37, + 0x0c, 0x3b, 0x81, 0x43, 0x28, 0xce, 0x01, 0x9c, 0xf8, 0xe4, 0xb2, 0x4f, 0x6c, 0x46, 0x1c, 0xb5, + 0x80, 0xf3, 0x50, 0xeb, 0x74, 0x77, 0x8e, 0x02, 0xb6, 0x17, 0x0c, 0x7c, 0x47, 0x55, 0x50, 0x85, + 0xda, 0x6e, 0x18, 0x06, 0xe1, 0xc7, 0xd3, 0x53, 0x4a, 0x98, 0x7a, 0xad, 0xac, 0xb5, 0x01, 0xb3, + 0x53, 0x82, 0xb3, 0x50, 0x3d, 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, 0xbd, 0xd5, 0x95, 0x5f, 0x77, 0x7a, + 0xe1, 0xe6, 0x4e, 0x2f, 0xfc, 0xb9, 0xd3, 0x0b, 0x5f, 0x96, 0xf2, 0x7e, 0xaf, 0xf4, 0xa6, 0xf9, + 0x9f, 0xb7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x1c, 0xe7, 0x92, 0xe6, 0xce, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { @@ -1524,9 +1548,16 @@ func (m *FilesBindRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.FileCids[iNdEx]) i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } } + if len(m.SpaceId) > 0 { + i -= len(m.SpaceId) + copy(dAtA[i:], m.SpaceId) + i = encodeVarintFile(dAtA, i, uint64(len(m.SpaceId))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1579,9 +1610,16 @@ func (m *FilesDeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.FileCids[iNdEx]) i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } } + if len(m.SpaceId) > 0 { + i -= len(m.SpaceId) + copy(dAtA[i:], m.SpaceId) + i = encodeVarintFile(dAtA, i, uint64(len(m.SpaceId))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1634,9 +1672,16 @@ func (m *FilesCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.FileCids[iNdEx]) i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 } } + if len(m.SpaceId) > 0 { + i -= len(m.SpaceId) + copy(dAtA[i:], m.SpaceId) + i = encodeVarintFile(dAtA, i, uint64(len(m.SpaceId))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1997,6 +2042,10 @@ func (m *FilesBindRequest) Size() (n int) { } var l int _ = l + l = len(m.SpaceId) + if l > 0 { + n += 1 + l + sovFile(uint64(l)) + } if len(m.FileCids) > 0 { for _, b := range m.FileCids { l = len(b) @@ -2021,6 +2070,10 @@ func (m *FilesDeleteRequest) Size() (n int) { } var l int _ = l + l = len(m.SpaceId) + if l > 0 { + n += 1 + l + sovFile(uint64(l)) + } if len(m.FileCids) > 0 { for _, b := range m.FileCids { l = len(b) @@ -2045,6 +2098,10 @@ func (m *FilesCheckRequest) Size() (n int) { } var l int _ = l + l = len(m.SpaceId) + if l > 0 { + n += 1 + l + sovFile(uint64(l)) + } if len(m.FileCids) > 0 { for _, b := range m.FileCids { l = len(b) @@ -3226,6 +3283,38 @@ func (m *FilesBindRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpaceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) } @@ -3358,6 +3447,38 @@ func (m *FilesDeleteRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpaceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) } @@ -3490,6 +3611,38 @@ func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SpaceId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) } diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index a7c58b61..394daf7e 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -87,19 +87,22 @@ message BlocksBindResponse {} message FilesBindRequest { - repeated bytes fileCids = 1; + string spaceId = 1; + repeated bytes fileCids = 2; } message FilesBindResponse {} message FilesDeleteRequest { - repeated bytes fileCids = 1; + string spaceId = 1; + repeated bytes fileCids = 2; } message FilesDeleteResponse {} message FilesCheckRequest { - repeated bytes fileCids = 1; + string spaceId = 1; + repeated bytes fileCids = 2; } message FilesCheckResponse { From e6352f74ad83d93b4b8f6ae80f2bd037814ded9d Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Wed, 1 Mar 2023 13:44:15 +0300 Subject: [PATCH 03/30] update fileproto --- commonfile/fileproto/file.pb.go | 623 ++++++++----------------- commonfile/fileproto/file_drpc.pb.go | 88 +--- commonfile/fileproto/protos/file.proto | 25 +- 3 files changed, 202 insertions(+), 534 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index b4f3f839..8967ddf1 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -184,8 +184,9 @@ func (m *BlockGetResponse) GetData() []byte { type BlockPushRequest struct { SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - Cid []byte `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + FileId string `protobuf:"bytes,2,opt,name=fileId,proto3" json:"fileId,omitempty"` + Cid []byte `protobuf:"bytes,3,opt,name=cid,proto3" json:"cid,omitempty"` + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` } func (m *BlockPushRequest) Reset() { *m = BlockPushRequest{} } @@ -228,6 +229,13 @@ func (m *BlockPushRequest) GetSpaceId() string { return "" } +func (m *BlockPushRequest) GetFileId() string { + if m != nil { + return m.FileId + } + return "" +} + func (m *BlockPushRequest) GetCid() []byte { if m != nil { return m.Cid @@ -516,7 +524,8 @@ func (m *BlockAvailability) GetStatus() AvailabilityStatus { type BlocksBindRequest struct { SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - Cids [][]byte `protobuf:"bytes,2,rep,name=cids,proto3" json:"cids,omitempty"` + FileId string `protobuf:"bytes,2,opt,name=fileId,proto3" json:"fileId,omitempty"` + Cids [][]byte `protobuf:"bytes,3,rep,name=cids,proto3" json:"cids,omitempty"` } func (m *BlocksBindRequest) Reset() { *m = BlocksBindRequest{} } @@ -559,6 +568,13 @@ func (m *BlocksBindRequest) GetSpaceId() string { return "" } +func (m *BlocksBindRequest) GetFileId() string { + if m != nil { + return m.FileId + } + return "" +} + func (m *BlocksBindRequest) GetCids() [][]byte { if m != nil { return m.Cids @@ -602,104 +618,16 @@ func (m *BlocksBindResponse) XXX_DiscardUnknown() { var xxx_messageInfo_BlocksBindResponse proto.InternalMessageInfo -type FilesBindRequest struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - FileCids [][]byte `protobuf:"bytes,2,rep,name=fileCids,proto3" json:"fileCids,omitempty"` -} - -func (m *FilesBindRequest) Reset() { *m = FilesBindRequest{} } -func (m *FilesBindRequest) String() string { return proto.CompactTextString(m) } -func (*FilesBindRequest) ProtoMessage() {} -func (*FilesBindRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{11} -} -func (m *FilesBindRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FilesBindRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FilesBindRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FilesBindRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilesBindRequest.Merge(m, src) -} -func (m *FilesBindRequest) XXX_Size() int { - return m.Size() -} -func (m *FilesBindRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FilesBindRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_FilesBindRequest proto.InternalMessageInfo - -func (m *FilesBindRequest) GetSpaceId() string { - if m != nil { - return m.SpaceId - } - return "" -} - -func (m *FilesBindRequest) GetFileCids() [][]byte { - if m != nil { - return m.FileCids - } - return nil -} - -type FilesBindResponse struct { -} - -func (m *FilesBindResponse) Reset() { *m = FilesBindResponse{} } -func (m *FilesBindResponse) String() string { return proto.CompactTextString(m) } -func (*FilesBindResponse) ProtoMessage() {} -func (*FilesBindResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{12} -} -func (m *FilesBindResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *FilesBindResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_FilesBindResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *FilesBindResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilesBindResponse.Merge(m, src) -} -func (m *FilesBindResponse) XXX_Size() int { - return m.Size() -} -func (m *FilesBindResponse) XXX_DiscardUnknown() { - xxx_messageInfo_FilesBindResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_FilesBindResponse proto.InternalMessageInfo - type FilesDeleteRequest struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - FileCids [][]byte `protobuf:"bytes,2,rep,name=fileCids,proto3" json:"fileCids,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + FileIds [][]byte `protobuf:"bytes,2,rep,name=fileIds,proto3" json:"fileIds,omitempty"` } func (m *FilesDeleteRequest) Reset() { *m = FilesDeleteRequest{} } func (m *FilesDeleteRequest) String() string { return proto.CompactTextString(m) } func (*FilesDeleteRequest) ProtoMessage() {} func (*FilesDeleteRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{13} + return fileDescriptor_fd665a7e11c833d5, []int{11} } func (m *FilesDeleteRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -735,9 +663,9 @@ func (m *FilesDeleteRequest) GetSpaceId() string { return "" } -func (m *FilesDeleteRequest) GetFileCids() [][]byte { +func (m *FilesDeleteRequest) GetFileIds() [][]byte { if m != nil { - return m.FileCids + return m.FileIds } return nil } @@ -749,7 +677,7 @@ func (m *FilesDeleteResponse) Reset() { *m = FilesDeleteResponse{} } func (m *FilesDeleteResponse) String() string { return proto.CompactTextString(m) } func (*FilesDeleteResponse) ProtoMessage() {} func (*FilesDeleteResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{14} + return fileDescriptor_fd665a7e11c833d5, []int{12} } func (m *FilesDeleteResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -779,15 +707,15 @@ func (m *FilesDeleteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_FilesDeleteResponse proto.InternalMessageInfo type FilesCheckRequest struct { - SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - FileCids [][]byte `protobuf:"bytes,2,rep,name=fileCids,proto3" json:"fileCids,omitempty"` + SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + FileIds [][]byte `protobuf:"bytes,2,rep,name=fileIds,proto3" json:"fileIds,omitempty"` } func (m *FilesCheckRequest) Reset() { *m = FilesCheckRequest{} } func (m *FilesCheckRequest) String() string { return proto.CompactTextString(m) } func (*FilesCheckRequest) ProtoMessage() {} func (*FilesCheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{15} + return fileDescriptor_fd665a7e11c833d5, []int{13} } func (m *FilesCheckRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -823,9 +751,9 @@ func (m *FilesCheckRequest) GetSpaceId() string { return "" } -func (m *FilesCheckRequest) GetFileCids() [][]byte { +func (m *FilesCheckRequest) GetFileIds() [][]byte { if m != nil { - return m.FileCids + return m.FileIds } return nil } @@ -838,7 +766,7 @@ func (m *FilesCheckResponse) Reset() { *m = FilesCheckResponse{} } func (m *FilesCheckResponse) String() string { return proto.CompactTextString(m) } func (*FilesCheckResponse) ProtoMessage() {} func (*FilesCheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{16} + return fileDescriptor_fd665a7e11c833d5, []int{14} } func (m *FilesCheckResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -881,7 +809,7 @@ func (m *CheckRequest) Reset() { *m = CheckRequest{} } func (m *CheckRequest) String() string { return proto.CompactTextString(m) } func (*CheckRequest) ProtoMessage() {} func (*CheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{17} + return fileDescriptor_fd665a7e11c833d5, []int{15} } func (m *CheckRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -919,7 +847,7 @@ func (m *CheckResponse) Reset() { *m = CheckResponse{} } func (m *CheckResponse) String() string { return proto.CompactTextString(m) } func (*CheckResponse) ProtoMessage() {} func (*CheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{18} + return fileDescriptor_fd665a7e11c833d5, []int{16} } func (m *CheckResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -970,7 +898,7 @@ func (m *CheckUsageRequest) Reset() { *m = CheckUsageRequest{} } func (m *CheckUsageRequest) String() string { return proto.CompactTextString(m) } func (*CheckUsageRequest) ProtoMessage() {} func (*CheckUsageRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{19} + return fileDescriptor_fd665a7e11c833d5, []int{17} } func (m *CheckUsageRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1016,7 +944,7 @@ func (m *CheckUsageResponse) Reset() { *m = CheckUsageResponse{} } func (m *CheckUsageResponse) String() string { return proto.CompactTextString(m) } func (*CheckUsageResponse) ProtoMessage() {} func (*CheckUsageResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{20} + return fileDescriptor_fd665a7e11c833d5, []int{18} } func (m *CheckUsageResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1080,8 +1008,6 @@ func init() { proto.RegisterType((*BlockAvailability)(nil), "filesync.BlockAvailability") proto.RegisterType((*BlocksBindRequest)(nil), "filesync.BlocksBindRequest") proto.RegisterType((*BlocksBindResponse)(nil), "filesync.BlocksBindResponse") - proto.RegisterType((*FilesBindRequest)(nil), "filesync.FilesBindRequest") - proto.RegisterType((*FilesBindResponse)(nil), "filesync.FilesBindResponse") proto.RegisterType((*FilesDeleteRequest)(nil), "filesync.FilesDeleteRequest") proto.RegisterType((*FilesDeleteResponse)(nil), "filesync.FilesDeleteResponse") proto.RegisterType((*FilesCheckRequest)(nil), "filesync.FilesCheckRequest") @@ -1097,53 +1023,52 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 736 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x4b, 0x4f, 0xdb, 0x40, - 0x10, 0x8e, 0x93, 0x40, 0x93, 0x09, 0x0f, 0x33, 0x50, 0x9a, 0x9a, 0xd4, 0x8a, 0x7c, 0xa8, 0x10, - 0x52, 0x83, 0x44, 0x7b, 0xe0, 0xc2, 0x81, 0x84, 0x47, 0x03, 0x2a, 0xad, 0x8c, 0x50, 0xa5, 0xf6, - 0xe4, 0xd8, 0x4b, 0xb1, 0x30, 0x76, 0xea, 0xdd, 0xb4, 0xf0, 0x2f, 0xfa, 0xb3, 0x38, 0xd2, 0x5b, - 0x8f, 0x15, 0xfc, 0x91, 0xca, 0xeb, 0x4d, 0xbc, 0x8e, 0xcd, 0x43, 0x91, 0x7a, 0x31, 0xbb, 0xf3, - 0xf8, 0xbe, 0x99, 0xd9, 0x99, 0x21, 0xf0, 0xda, 0x0e, 0x2e, 0x2e, 0x02, 0xff, 0xd4, 0xf5, 0xc8, - 0x7a, 0xf4, 0xe9, 0x87, 0x01, 0x0b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 0x16, 0xe6, 0x3c, 0xd4, 0x3b, - 0x98, 0xa6, 0xcc, 0x62, 0x03, 0xca, 0x2b, 0x3d, 0xb7, 0xd1, 0x48, 0x78, 0x64, 0xcf, 0x63, 0x6e, - 0x63, 0x0a, 0x5b, 0x63, 0x5b, 0x80, 0xd3, 0xb6, 0xeb, 0x3b, 0x93, 0xd5, 0x60, 0x69, 0x58, 0xc7, - 0x18, 0x42, 0x54, 0xf7, 0x3d, 0xa8, 0x7b, 0x11, 0xff, 0xd3, 0x70, 0x35, 0xe0, 0x6d, 0xdd, 0x49, - 0xb0, 0x47, 0xf7, 0xa8, 0x33, 0x24, 0x24, 0x01, 0x7f, 0x00, 0xc8, 0x85, 0x4f, 0x6d, 0x8c, 0x87, - 0x08, 0x9e, 0xc3, 0x62, 0x0a, 0x4b, 0x50, 0x74, 0x05, 0xef, 0x13, 0xdb, 0xe3, 0x21, 0x06, 0x4b, - 0x44, 0xfb, 0x1f, 0xbb, 0x64, 0x0e, 0x66, 0xe4, 0x40, 0x8d, 0x43, 0x98, 0x4d, 0xb3, 0x69, 0x50, - 0x11, 0xa1, 0x52, 0xce, 0x51, 0x35, 0x47, 0x77, 0xd4, 0x01, 0x2c, 0xcf, 0x0b, 0x7e, 0x7e, 0x0e, - 0x5d, 0x46, 0x78, 0xff, 0x54, 0x4c, 0x49, 0x62, 0xbc, 0x81, 0x05, 0x0e, 0x76, 0x42, 0xad, 0x6f, - 0x8f, 0x17, 0xdb, 0x08, 0x01, 0x65, 0x73, 0x11, 0x80, 0x0e, 0xe0, 0xb9, 0x17, 0x2e, 0x6b, 0x5f, - 0x31, 0x42, 0xb9, 0x4b, 0xd9, 0x94, 0x24, 0x91, 0x7e, 0x10, 0x39, 0xc4, 0xfa, 0x62, 0xac, 0x4f, - 0x24, 0xd8, 0x80, 0x2a, 0xbf, 0xf1, 0x0a, 0x97, 0xb8, 0x3a, 0x11, 0xac, 0x6d, 0x41, 0x65, 0x37, - 0x0c, 0x3b, 0x81, 0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 0x00, 0x33, 0xf2, 0xbf, 0x1a, 0xcc, 0x94, - 0x34, 0x1d, 0x96, 0x7e, 0x9f, 0x5a, 0xc0, 0x6d, 0xc2, 0x54, 0x1c, 0xd2, 0x72, 0x62, 0x98, 0x8a, - 0xe6, 0x45, 0x46, 0x9e, 0x64, 0x94, 0x4c, 0xa0, 0x9c, 0x51, 0x66, 0x8c, 0xe5, 0x8c, 0xb2, 0x43, - 0xdb, 0x6e, 0x5d, 0xdf, 0xea, 0xca, 0xcd, 0xad, 0xae, 0xfc, 0xbd, 0xd5, 0x95, 0x5f, 0x77, 0x7a, - 0xe1, 0xe6, 0x4e, 0x2f, 0xfc, 0xb9, 0xd3, 0x0b, 0x5f, 0x96, 0xf2, 0x7e, 0xaf, 0xf4, 0xa6, 0xf9, - 0x9f, 0xb7, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x1c, 0xe7, 0x92, 0xe6, 0xce, 0x08, 0x00, 0x00, + // 713 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x4e, 0xdb, 0x40, + 0x10, 0x8e, 0x93, 0x34, 0x24, 0x13, 0x7e, 0x9c, 0x85, 0xd2, 0xd4, 0xa4, 0x56, 0xe4, 0x43, 0x85, + 0x90, 0x1a, 0x24, 0xda, 0x03, 0x17, 0x0e, 0x24, 0xfc, 0x34, 0x45, 0xa2, 0x95, 0x11, 0xaa, 0xda, + 0x9e, 0x1c, 0x7b, 0x29, 0x2e, 0xc6, 0x9b, 0x7a, 0x37, 0x2d, 0xbc, 0x45, 0x1f, 0xa8, 0x0f, 0xc0, + 0x91, 0x63, 0x8f, 0x15, 0xbc, 0x48, 0xb5, 0xeb, 0x35, 0xde, 0xc4, 0x46, 0x41, 0x48, 0xbd, 0x98, + 0xd9, 0xf9, 0xf9, 0xbe, 0x8f, 0x99, 0x9d, 0x0d, 0xbc, 0x74, 0xc9, 0xf9, 0x39, 0x09, 0x4f, 0xfc, + 0x00, 0xaf, 0xf3, 0xcf, 0x30, 0x22, 0x8c, 0xac, 0x8b, 0x2f, 0x15, 0x8e, 0x8e, 0xb0, 0x51, 0x95, + 0xdb, 0xf4, 0x32, 0x74, 0xad, 0x2d, 0x58, 0xe8, 0x06, 0xc4, 0x3d, 0xdb, 0xc7, 0xcc, 0xc6, 0xdf, + 0x47, 0x98, 0x32, 0xd4, 0x84, 0x19, 0x3a, 0x74, 0x5c, 0xdc, 0xf7, 0x9a, 0x5a, 0x5b, 0x5b, 0xad, + 0xd9, 0xc9, 0x11, 0xe9, 0x50, 0x72, 0x7d, 0xaf, 0x59, 0x6c, 0x6b, 0xab, 0xb3, 0x36, 0x37, 0xad, + 0x4d, 0xd0, 0xd3, 0x72, 0x3a, 0x24, 0x21, 0xc5, 0x49, 0x96, 0x76, 0x97, 0x85, 0x10, 0x94, 0x3d, + 0x87, 0x39, 0xb2, 0x50, 0xd8, 0xd6, 0x37, 0x59, 0xf9, 0x61, 0x44, 0x4f, 0xa7, 0x33, 0x2f, 0x43, + 0x85, 0x4b, 0xee, 0xc7, 0xe4, 0x35, 0x5b, 0x9e, 0x12, 0xae, 0x52, 0x96, 0xab, 0xac, 0x70, 0x2d, + 0x42, 0x43, 0xe1, 0x8a, 0x65, 0x5a, 0x3d, 0x58, 0x14, 0x4e, 0xba, 0x83, 0x03, 0xcc, 0xf0, 0x74, + 0x0d, 0x08, 0xca, 0xae, 0xef, 0xd1, 0x66, 0xb1, 0x5d, 0xe2, 0xc8, 0xdc, 0xb6, 0x96, 0x61, 0x69, + 0x1c, 0x44, 0x82, 0x77, 0x01, 0xc5, 0xfe, 0xde, 0x29, 0x76, 0xcf, 0x1e, 0x87, 0x3d, 0x48, 0x04, + 0x4a, 0x0c, 0xd9, 0xde, 0x03, 0x40, 0x03, 0xe1, 0xde, 0xfe, 0xe1, 0xf8, 0x81, 0x33, 0xf0, 0x03, + 0x9f, 0x5d, 0x36, 0x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0xda, 0x84, 0x27, 0x31, 0xc6, 0x72, 0x9a, 0x36, 0x56, 0xfe, 0x2c, 0xe3, 0x4f, 0x25, 0xa4, + 0x97, 0x5d, 0x95, 0x90, 0xd9, 0x18, 0x55, 0x42, 0x76, 0x3f, 0xba, 0x9d, 0xab, 0x1b, 0x53, 0xbb, + 0xbe, 0x31, 0xb5, 0xbf, 0x37, 0xa6, 0xf6, 0xeb, 0xd6, 0x2c, 0x5c, 0xdf, 0x9a, 0x85, 0x3f, 0xb7, + 0x66, 0xe1, 0xf3, 0x52, 0xde, 0xef, 0xfc, 0xa0, 0x22, 0xfe, 0xbc, 0xfe, 0x17, 0x00, 0x00, 0xff, + 0xff, 0xd6, 0xbb, 0x4c, 0xbd, 0x06, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { @@ -1245,13 +1170,20 @@ func (m *BlockPushRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Data) i = encodeVarintFile(dAtA, i, uint64(len(m.Data))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x22 } if len(m.Cid) > 0 { i -= len(m.Cid) copy(dAtA[i:], m.Cid) i = encodeVarintFile(dAtA, i, uint64(len(m.Cid))) i-- + dAtA[i] = 0x1a + } + if len(m.FileId) > 0 { + i -= len(m.FileId) + copy(dAtA[i:], m.FileId) + i = encodeVarintFile(dAtA, i, uint64(len(m.FileId))) + i-- dAtA[i] = 0x12 } if len(m.SpaceId) > 0 { @@ -1486,9 +1418,16 @@ func (m *BlocksBindRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Cids[iNdEx]) i = encodeVarintFile(dAtA, i, uint64(len(m.Cids[iNdEx]))) i-- - dAtA[i] = 0x12 + dAtA[i] = 0x1a } } + if len(m.FileId) > 0 { + i -= len(m.FileId) + copy(dAtA[i:], m.FileId) + i = encodeVarintFile(dAtA, i, uint64(len(m.FileId))) + i-- + dAtA[i] = 0x12 + } if len(m.SpaceId) > 0 { i -= len(m.SpaceId) copy(dAtA[i:], m.SpaceId) @@ -1522,68 +1461,6 @@ func (m *BlocksBindResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *FilesBindRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FilesBindRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FilesBindRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.FileCids) > 0 { - for iNdEx := len(m.FileCids) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.FileCids[iNdEx]) - copy(dAtA[i:], m.FileCids[iNdEx]) - i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if len(m.SpaceId) > 0 { - i -= len(m.SpaceId) - copy(dAtA[i:], m.SpaceId) - i = encodeVarintFile(dAtA, i, uint64(len(m.SpaceId))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *FilesBindResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *FilesBindResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *FilesBindResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - func (m *FilesDeleteRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1604,11 +1481,11 @@ func (m *FilesDeleteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.FileCids) > 0 { - for iNdEx := len(m.FileCids) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.FileCids[iNdEx]) - copy(dAtA[i:], m.FileCids[iNdEx]) - i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) + if len(m.FileIds) > 0 { + for iNdEx := len(m.FileIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.FileIds[iNdEx]) + copy(dAtA[i:], m.FileIds[iNdEx]) + i = encodeVarintFile(dAtA, i, uint64(len(m.FileIds[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -1666,11 +1543,11 @@ func (m *FilesCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if len(m.FileCids) > 0 { - for iNdEx := len(m.FileCids) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.FileCids[iNdEx]) - copy(dAtA[i:], m.FileCids[iNdEx]) - i = encodeVarintFile(dAtA, i, uint64(len(m.FileCids[iNdEx]))) + if len(m.FileIds) > 0 { + for iNdEx := len(m.FileIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.FileIds[iNdEx]) + copy(dAtA[i:], m.FileIds[iNdEx]) + i = encodeVarintFile(dAtA, i, uint64(len(m.FileIds[iNdEx]))) i-- dAtA[i] = 0x12 } @@ -1910,6 +1787,10 @@ func (m *BlockPushRequest) Size() (n int) { if l > 0 { n += 1 + l + sovFile(uint64(l)) } + l = len(m.FileId) + if l > 0 { + n += 1 + l + sovFile(uint64(l)) + } l = len(m.Cid) if l > 0 { n += 1 + l + sovFile(uint64(l)) @@ -2018,6 +1899,10 @@ func (m *BlocksBindRequest) Size() (n int) { if l > 0 { n += 1 + l + sovFile(uint64(l)) } + l = len(m.FileId) + if l > 0 { + n += 1 + l + sovFile(uint64(l)) + } if len(m.Cids) > 0 { for _, b := range m.Cids { l = len(b) @@ -2036,34 +1921,6 @@ func (m *BlocksBindResponse) Size() (n int) { return n } -func (m *FilesBindRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.SpaceId) - if l > 0 { - n += 1 + l + sovFile(uint64(l)) - } - if len(m.FileCids) > 0 { - for _, b := range m.FileCids { - l = len(b) - n += 1 + l + sovFile(uint64(l)) - } - } - return n -} - -func (m *FilesBindResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - func (m *FilesDeleteRequest) Size() (n int) { if m == nil { return 0 @@ -2074,8 +1931,8 @@ func (m *FilesDeleteRequest) Size() (n int) { if l > 0 { n += 1 + l + sovFile(uint64(l)) } - if len(m.FileCids) > 0 { - for _, b := range m.FileCids { + if len(m.FileIds) > 0 { + for _, b := range m.FileIds { l = len(b) n += 1 + l + sovFile(uint64(l)) } @@ -2102,8 +1959,8 @@ func (m *FilesCheckRequest) Size() (n int) { if l > 0 { n += 1 + l + sovFile(uint64(l)) } - if len(m.FileCids) > 0 { - for _, b := range m.FileCids { + if len(m.FileIds) > 0 { + for _, b := range m.FileIds { l = len(b) n += 1 + l + sovFile(uint64(l)) } @@ -2486,6 +2343,38 @@ func (m *BlockPushRequest) Unmarshal(dAtA []byte) error { m.SpaceId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FileId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cid", wireType) } @@ -2519,7 +2408,7 @@ func (m *BlockPushRequest) Unmarshal(dAtA []byte) error { m.Cid = []byte{} } iNdEx = postIndex - case 3: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) } @@ -3151,6 +3040,38 @@ func (m *BlocksBindRequest) Unmarshal(dAtA []byte) error { m.SpaceId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FileId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Cids", wireType) } @@ -3253,170 +3174,6 @@ func (m *BlocksBindResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *FilesBindRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFile - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FilesBindRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FilesBindRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFile - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthFile - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthFile - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SpaceId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFile - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthFile - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthFile - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.FileCids = append(m.FileCids, make([]byte, postIndex-iNdEx)) - copy(m.FileCids[len(m.FileCids)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipFile(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFile - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *FilesBindResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowFile - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: FilesBindResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: FilesBindResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipFile(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthFile - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *FilesDeleteRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3480,7 +3237,7 @@ func (m *FilesDeleteRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FileIds", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3507,8 +3264,8 @@ func (m *FilesDeleteRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FileCids = append(m.FileCids, make([]byte, postIndex-iNdEx)) - copy(m.FileCids[len(m.FileCids)-1], dAtA[iNdEx:postIndex]) + m.FileIds = append(m.FileIds, make([]byte, postIndex-iNdEx)) + copy(m.FileIds[len(m.FileIds)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -3644,7 +3401,7 @@ func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FileCids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FileIds", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -3671,8 +3428,8 @@ func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FileCids = append(m.FileCids, make([]byte, postIndex-iNdEx)) - copy(m.FileCids[len(m.FileCids)-1], dAtA[iNdEx:postIndex]) + m.FileIds = append(m.FileIds, make([]byte, postIndex-iNdEx)) + copy(m.FileIds[len(m.FileIds)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex diff --git a/commonfile/fileproto/file_drpc.pb.go b/commonfile/fileproto/file_drpc.pb.go index bd0f833d..9c205299 100644 --- a/commonfile/fileproto/file_drpc.pb.go +++ b/commonfile/fileproto/file_drpc.pb.go @@ -44,10 +44,8 @@ type DRPCFileClient interface { BlockPush(ctx context.Context, in *BlockPushRequest) (*BlockPushResponse, error) BlocksCheck(ctx context.Context, in *BlocksCheckRequest) (*BlocksCheckResponse, error) BlocksBind(ctx context.Context, in *BlocksBindRequest) (*BlocksBindResponse, error) - FilesBind(ctx context.Context, in *FilesBindRequest) (*FilesBindResponse, error) FilesDelete(ctx context.Context, in *FilesDeleteRequest) (*FilesDeleteResponse, error) FilesCheck(ctx context.Context, in *FilesCheckRequest) (*FilesCheckResponse, error) - BlocksDelete(ctx context.Context, in *BlocksDeleteRequest) (*BlocksDeleteResponse, error) Check(ctx context.Context, in *CheckRequest) (*CheckResponse, error) CheckUsage(ctx context.Context, in *CheckUsageRequest) (*CheckUsageResponse, error) } @@ -98,15 +96,6 @@ func (c *drpcFileClient) BlocksBind(ctx context.Context, in *BlocksBindRequest) return out, nil } -func (c *drpcFileClient) FilesBind(ctx context.Context, in *FilesBindRequest) (*FilesBindResponse, error) { - out := new(FilesBindResponse) - err := c.cc.Invoke(ctx, "/filesync.File/FilesBind", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) - if err != nil { - return nil, err - } - return out, nil -} - func (c *drpcFileClient) FilesDelete(ctx context.Context, in *FilesDeleteRequest) (*FilesDeleteResponse, error) { out := new(FilesDeleteResponse) err := c.cc.Invoke(ctx, "/filesync.File/FilesDelete", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) @@ -125,15 +114,6 @@ func (c *drpcFileClient) FilesCheck(ctx context.Context, in *FilesCheckRequest) return out, nil } -func (c *drpcFileClient) BlocksDelete(ctx context.Context, in *BlocksDeleteRequest) (*BlocksDeleteResponse, error) { - out := new(BlocksDeleteResponse) - err := c.cc.Invoke(ctx, "/filesync.File/BlocksDelete", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) - if err != nil { - return nil, err - } - return out, nil -} - func (c *drpcFileClient) Check(ctx context.Context, in *CheckRequest) (*CheckResponse, error) { out := new(CheckResponse) err := c.cc.Invoke(ctx, "/filesync.File/Check", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) @@ -157,10 +137,8 @@ type DRPCFileServer interface { BlockPush(context.Context, *BlockPushRequest) (*BlockPushResponse, error) BlocksCheck(context.Context, *BlocksCheckRequest) (*BlocksCheckResponse, error) BlocksBind(context.Context, *BlocksBindRequest) (*BlocksBindResponse, error) - FilesBind(context.Context, *FilesBindRequest) (*FilesBindResponse, error) FilesDelete(context.Context, *FilesDeleteRequest) (*FilesDeleteResponse, error) FilesCheck(context.Context, *FilesCheckRequest) (*FilesCheckResponse, error) - BlocksDelete(context.Context, *BlocksDeleteRequest) (*BlocksDeleteResponse, error) Check(context.Context, *CheckRequest) (*CheckResponse, error) CheckUsage(context.Context, *CheckUsageRequest) (*CheckUsageResponse, error) } @@ -183,10 +161,6 @@ func (s *DRPCFileUnimplementedServer) BlocksBind(context.Context, *BlocksBindReq return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } -func (s *DRPCFileUnimplementedServer) FilesBind(context.Context, *FilesBindRequest) (*FilesBindResponse, error) { - return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) -} - func (s *DRPCFileUnimplementedServer) FilesDelete(context.Context, *FilesDeleteRequest) (*FilesDeleteResponse, error) { return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } @@ -195,10 +169,6 @@ func (s *DRPCFileUnimplementedServer) FilesCheck(context.Context, *FilesCheckReq return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } -func (s *DRPCFileUnimplementedServer) BlocksDelete(context.Context, *BlocksDeleteRequest) (*BlocksDeleteResponse, error) { - return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) -} - func (s *DRPCFileUnimplementedServer) Check(context.Context, *CheckRequest) (*CheckResponse, error) { return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } @@ -209,7 +179,7 @@ func (s *DRPCFileUnimplementedServer) CheckUsage(context.Context, *CheckUsageReq type DRPCFileDescription struct{} -func (DRPCFileDescription) NumMethods() int { return 10 } +func (DRPCFileDescription) NumMethods() int { return 8 } func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, interface{}, bool) { switch n { @@ -250,15 +220,6 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, ) }, DRPCFileServer.BlocksBind, true case 4: - return "/filesync.File/FilesBind", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, - func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { - return srv.(DRPCFileServer). - FilesBind( - ctx, - in1.(*FilesBindRequest), - ) - }, DRPCFileServer.FilesBind, true - case 5: return "/filesync.File/FilesDelete", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCFileServer). @@ -267,7 +228,7 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, in1.(*FilesDeleteRequest), ) }, DRPCFileServer.FilesDelete, true - case 6: + case 5: return "/filesync.File/FilesCheck", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCFileServer). @@ -276,16 +237,7 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, in1.(*FilesCheckRequest), ) }, DRPCFileServer.FilesCheck, true - case 7: - return "/filesync.File/BlocksDelete", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, - func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { - return srv.(DRPCFileServer). - BlocksDelete( - ctx, - in1.(*BlocksDeleteRequest), - ) - }, DRPCFileServer.BlocksDelete, true - case 8: + case 6: return "/filesync.File/Check", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCFileServer). @@ -294,7 +246,7 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, in1.(*CheckRequest), ) }, DRPCFileServer.Check, true - case 9: + case 7: return "/filesync.File/CheckUsage", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCFileServer). @@ -376,22 +328,6 @@ func (x *drpcFile_BlocksBindStream) SendAndClose(m *BlocksBindResponse) error { return x.CloseSend() } -type DRPCFile_FilesBindStream interface { - drpc.Stream - SendAndClose(*FilesBindResponse) error -} - -type drpcFile_FilesBindStream struct { - drpc.Stream -} - -func (x *drpcFile_FilesBindStream) SendAndClose(m *FilesBindResponse) error { - if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil { - return err - } - return x.CloseSend() -} - type DRPCFile_FilesDeleteStream interface { drpc.Stream SendAndClose(*FilesDeleteResponse) error @@ -424,22 +360,6 @@ func (x *drpcFile_FilesCheckStream) SendAndClose(m *FilesCheckResponse) error { return x.CloseSend() } -type DRPCFile_BlocksDeleteStream interface { - drpc.Stream - SendAndClose(*BlocksDeleteResponse) error -} - -type drpcFile_BlocksDeleteStream struct { - drpc.Stream -} - -func (x *drpcFile_BlocksDeleteStream) SendAndClose(m *BlocksDeleteResponse) error { - if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil { - return err - } - return x.CloseSend() -} - type DRPCFile_CheckStream interface { drpc.Stream SendAndClose(*CheckResponse) error diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index 394daf7e..63d1e265 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -18,14 +18,10 @@ service File { rpc BlocksCheck(BlocksCheckRequest) returns (BlocksCheckResponse); // BlocksBind binds CIDs to space rpc BlocksBind(BlocksBindRequest) returns (BlocksBindResponse); - // FilesBind binds root file CIDs and their children to space - rpc FilesBind(FilesBindRequest) returns (FilesBindResponse); - // FilesDelete deletes file CIDs and their children from space + // FilesDelete deletes files by id rpc FilesDelete(FilesDeleteRequest) returns (FilesDeleteResponse); // FileCheck checks file CIDs and children for exists rpc FilesCheck(FilesCheckRequest) returns (FilesCheckResponse); - // BlocksDelete deletes block from space - rpc BlocksDelete(BlocksDeleteRequest) returns (BlocksDeleteResponse); // Check checks the connection and credentials rpc Check(CheckRequest) returns (CheckResponse); // CheckUsage checks current usage and limits for a space @@ -44,8 +40,9 @@ message BlockGetResponse { message BlockPushRequest { string spaceId = 1; - bytes cid = 2; - bytes data = 3; + string fileId = 2; + bytes cid = 3; + bytes data = 4; } message BlockPushResponse {} @@ -80,29 +77,23 @@ enum AvailabilityStatus { message BlocksBindRequest { string spaceId = 1; - repeated bytes cids = 2; + string fileId = 2; + repeated bytes cids = 3; } message BlocksBindResponse {} -message FilesBindRequest { - string spaceId = 1; - repeated bytes fileCids = 2; -} - -message FilesBindResponse {} - message FilesDeleteRequest { string spaceId = 1; - repeated bytes fileCids = 2; + repeated bytes fileIds = 2; } message FilesDeleteResponse {} message FilesCheckRequest { string spaceId = 1; - repeated bytes fileCids = 2; + repeated bytes fileIds = 2; } message FilesCheckResponse { From 1837d89ef9a79f6ad1561edbcf095f0e161ca272 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Thu, 2 Mar 2023 19:11:55 +0300 Subject: [PATCH 04/30] fileproto: SpaceInfo method --- commonfile/fileproto/file.pb.go | 242 ++++++++++++++----------- commonfile/fileproto/file_drpc.pb.go | 28 +-- commonfile/fileproto/protos/file.proto | 11 +- 3 files changed, 159 insertions(+), 122 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index 8967ddf1..c9f1334e 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -890,22 +890,22 @@ func (m *CheckResponse) GetAllowWrite() bool { return false } -type CheckUsageRequest struct { +type SpaceInfoRequest struct { SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` } -func (m *CheckUsageRequest) Reset() { *m = CheckUsageRequest{} } -func (m *CheckUsageRequest) String() string { return proto.CompactTextString(m) } -func (*CheckUsageRequest) ProtoMessage() {} -func (*CheckUsageRequest) Descriptor() ([]byte, []int) { +func (m *SpaceInfoRequest) Reset() { *m = SpaceInfoRequest{} } +func (m *SpaceInfoRequest) String() string { return proto.CompactTextString(m) } +func (*SpaceInfoRequest) ProtoMessage() {} +func (*SpaceInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_fd665a7e11c833d5, []int{17} } -func (m *CheckUsageRequest) XXX_Unmarshal(b []byte) error { +func (m *SpaceInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CheckUsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SpaceInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CheckUsageRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_SpaceInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -915,43 +915,44 @@ func (m *CheckUsageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *CheckUsageRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckUsageRequest.Merge(m, src) +func (m *SpaceInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpaceInfoRequest.Merge(m, src) } -func (m *CheckUsageRequest) XXX_Size() int { +func (m *SpaceInfoRequest) XXX_Size() int { return m.Size() } -func (m *CheckUsageRequest) XXX_DiscardUnknown() { - xxx_messageInfo_CheckUsageRequest.DiscardUnknown(m) +func (m *SpaceInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_SpaceInfoRequest.DiscardUnknown(m) } -var xxx_messageInfo_CheckUsageRequest proto.InternalMessageInfo +var xxx_messageInfo_SpaceInfoRequest proto.InternalMessageInfo -func (m *CheckUsageRequest) GetSpaceId() string { +func (m *SpaceInfoRequest) GetSpaceId() string { if m != nil { return m.SpaceId } return "" } -type CheckUsageResponse struct { +type SpaceInfoResponse struct { LimitBytes uint64 `protobuf:"varint,1,opt,name=limitBytes,proto3" json:"limitBytes,omitempty"` UsageBytes uint64 `protobuf:"varint,2,opt,name=usageBytes,proto3" json:"usageBytes,omitempty"` - UsageCids uint64 `protobuf:"varint,3,opt,name=usageCids,proto3" json:"usageCids,omitempty"` + CidsCount uint64 `protobuf:"varint,3,opt,name=cidsCount,proto3" json:"cidsCount,omitempty"` + FilesCount uint64 `protobuf:"varint,4,opt,name=filesCount,proto3" json:"filesCount,omitempty"` } -func (m *CheckUsageResponse) Reset() { *m = CheckUsageResponse{} } -func (m *CheckUsageResponse) String() string { return proto.CompactTextString(m) } -func (*CheckUsageResponse) ProtoMessage() {} -func (*CheckUsageResponse) Descriptor() ([]byte, []int) { +func (m *SpaceInfoResponse) Reset() { *m = SpaceInfoResponse{} } +func (m *SpaceInfoResponse) String() string { return proto.CompactTextString(m) } +func (*SpaceInfoResponse) ProtoMessage() {} +func (*SpaceInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_fd665a7e11c833d5, []int{18} } -func (m *CheckUsageResponse) XXX_Unmarshal(b []byte) error { +func (m *SpaceInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *CheckUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *SpaceInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_CheckUsageResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_SpaceInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -961,35 +962,42 @@ func (m *CheckUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *CheckUsageResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_CheckUsageResponse.Merge(m, src) +func (m *SpaceInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_SpaceInfoResponse.Merge(m, src) } -func (m *CheckUsageResponse) XXX_Size() int { +func (m *SpaceInfoResponse) XXX_Size() int { return m.Size() } -func (m *CheckUsageResponse) XXX_DiscardUnknown() { - xxx_messageInfo_CheckUsageResponse.DiscardUnknown(m) +func (m *SpaceInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_SpaceInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_CheckUsageResponse proto.InternalMessageInfo +var xxx_messageInfo_SpaceInfoResponse proto.InternalMessageInfo -func (m *CheckUsageResponse) GetLimitBytes() uint64 { +func (m *SpaceInfoResponse) GetLimitBytes() uint64 { if m != nil { return m.LimitBytes } return 0 } -func (m *CheckUsageResponse) GetUsageBytes() uint64 { +func (m *SpaceInfoResponse) GetUsageBytes() uint64 { if m != nil { return m.UsageBytes } return 0 } -func (m *CheckUsageResponse) GetUsageCids() uint64 { +func (m *SpaceInfoResponse) GetCidsCount() uint64 { if m != nil { - return m.UsageCids + return m.CidsCount + } + return 0 +} + +func (m *SpaceInfoResponse) GetFilesCount() uint64 { + if m != nil { + return m.FilesCount } return 0 } @@ -1014,8 +1022,8 @@ func init() { proto.RegisterType((*FilesCheckResponse)(nil), "filesync.FilesCheckResponse") proto.RegisterType((*CheckRequest)(nil), "filesync.CheckRequest") proto.RegisterType((*CheckResponse)(nil), "filesync.CheckResponse") - proto.RegisterType((*CheckUsageRequest)(nil), "filesync.CheckUsageRequest") - proto.RegisterType((*CheckUsageResponse)(nil), "filesync.CheckUsageResponse") + proto.RegisterType((*SpaceInfoRequest)(nil), "filesync.SpaceInfoRequest") + proto.RegisterType((*SpaceInfoResponse)(nil), "filesync.SpaceInfoResponse") } func init() { @@ -1023,52 +1031,53 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 713 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x4e, 0xdb, 0x40, - 0x10, 0x8e, 0x93, 0x34, 0x24, 0x13, 0x7e, 0x9c, 0x85, 0xd2, 0xd4, 0xa4, 0x56, 0xe4, 0x43, 0x85, - 0x90, 0x1a, 0x24, 0xda, 0x03, 0x17, 0x0e, 0x24, 0xfc, 0x34, 0x45, 0xa2, 0x95, 0x11, 0xaa, 0xda, - 0x9e, 0x1c, 0x7b, 0x29, 0x2e, 0xc6, 0x9b, 0x7a, 0x37, 0x2d, 0xbc, 0x45, 0x1f, 0xa8, 0x0f, 0xc0, - 0x91, 0x63, 0x8f, 0x15, 0xbc, 0x48, 0xb5, 0xeb, 0x35, 0xde, 0xc4, 0x46, 0x41, 0x48, 0xbd, 0x98, - 0xd9, 0xf9, 0xf9, 0xbe, 0x8f, 0x99, 0x9d, 0x0d, 0xbc, 0x74, 0xc9, 0xf9, 0x39, 0x09, 0x4f, 0xfc, - 0x00, 0xaf, 0xf3, 0xcf, 0x30, 0x22, 0x8c, 0xac, 0x8b, 0x2f, 0x15, 0x8e, 0x8e, 0xb0, 0x51, 0x95, - 0xdb, 0xf4, 0x32, 0x74, 0xad, 0x2d, 0x58, 0xe8, 0x06, 0xc4, 0x3d, 0xdb, 0xc7, 0xcc, 0xc6, 0xdf, - 0x47, 0x98, 0x32, 0xd4, 0x84, 0x19, 0x3a, 0x74, 0x5c, 0xdc, 0xf7, 0x9a, 0x5a, 0x5b, 0x5b, 0xad, - 0xd9, 0xc9, 0x11, 0xe9, 0x50, 0x72, 0x7d, 0xaf, 0x59, 0x6c, 0x6b, 0xab, 0xb3, 0x36, 0x37, 0xad, - 0x4d, 0xd0, 0xd3, 0x72, 0x3a, 0x24, 0x21, 0xc5, 0x49, 0x96, 0x76, 0x97, 0x85, 0x10, 0x94, 0x3d, - 0x87, 0x39, 0xb2, 0x50, 0xd8, 0xd6, 0x37, 0x59, 0xf9, 0x61, 0x44, 0x4f, 0xa7, 0x33, 0x2f, 0x43, - 0x85, 0x4b, 0xee, 0xc7, 0xe4, 0x35, 0x5b, 0x9e, 0x12, 0xae, 0x52, 0x96, 0xab, 0xac, 0x70, 0x2d, - 0x42, 0x43, 0xe1, 0x8a, 0x65, 0x5a, 0x3d, 0x58, 0x14, 0x4e, 0xba, 0x83, 0x03, 0xcc, 0xf0, 0x74, - 0x0d, 0x08, 0xca, 0xae, 0xef, 0xd1, 0x66, 0xb1, 0x5d, 0xe2, 0xc8, 0xdc, 0xb6, 0x96, 0x61, 0x69, - 0x1c, 0x44, 0x82, 0x77, 0x01, 0xc5, 0xfe, 0xde, 0x29, 0x76, 0xcf, 0x1e, 0x87, 0x3d, 0x48, 0x04, - 0x4a, 0x0c, 0xd9, 0xde, 0x03, 0x40, 0x03, 0xe1, 0xde, 0xfe, 0xe1, 0xf8, 0x81, 0x33, 0xf0, 0x03, - 0x9f, 0x5d, 0x36, 0xb5, 0x76, 0x69, 0xb5, 0xbe, 0xb1, 0xd2, 0x49, 0x06, 0xdb, 0x11, 0xa5, 0x6a, - 0x8a, 0x9d, 0x53, 0x66, 0x7d, 0x91, 0x9d, 0x51, 0x9d, 0x39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0x76, 0x3f, 0xba, 0x9d, 0xab, 0x1b, 0x53, 0xbb, - 0xbe, 0x31, 0xb5, 0xbf, 0x37, 0xa6, 0xf6, 0xeb, 0xd6, 0x2c, 0x5c, 0xdf, 0x9a, 0x85, 0x3f, 0xb7, - 0x66, 0xe1, 0xf3, 0x52, 0xde, 0xef, 0xfc, 0xa0, 0x22, 0xfe, 0xbc, 0xfe, 0x17, 0x00, 0x00, 0xff, - 0xff, 0xd6, 0xbb, 0x4c, 0xbd, 0x06, 0x08, 0x00, 0x00, + // 730 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x13, 0x93, 0x26, 0x93, 0xfe, 0x38, 0xdb, 0x52, 0x82, 0x1b, 0xac, 0xc8, 0x07, 0x54, + 0x55, 0x28, 0x95, 0x0a, 0x87, 0x5e, 0x7a, 0x68, 0xd2, 0x1f, 0x42, 0xa5, 0x82, 0x5c, 0x21, 0x04, + 0x9c, 0x1c, 0x7b, 0x43, 0x4d, 0x5d, 0x6f, 0xf0, 0x6e, 0xa0, 0x7d, 0x0b, 0x78, 0x1c, 0xde, 0xa0, + 0xc7, 0x1e, 0x39, 0xa2, 0xf6, 0x45, 0x90, 0xd7, 0xeb, 0x78, 0x13, 0xbb, 0x4a, 0x55, 0x89, 0x8b, + 0xb3, 0x3b, 0x3f, 0xdf, 0xf7, 0x69, 0x66, 0x67, 0x14, 0x78, 0xee, 0x90, 0xf3, 0x73, 0x12, 0x0c, + 0x3c, 0x1f, 0x6f, 0x46, 0x9f, 0x61, 0x48, 0x18, 0xd9, 0xe4, 0x5f, 0xca, 0x0d, 0x6d, 0x7e, 0x46, + 0x95, 0xe8, 0x4c, 0x2f, 0x03, 0xc7, 0xdc, 0x81, 0xa5, 0x8e, 0x4f, 0x9c, 0xb3, 0x43, 0xcc, 0x2c, + 0xfc, 0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, 0xf4, 0x3c, 0xc9, 0x9d, 0xca, 0x0c, 0x4f, 0xa7, 0x7d, 0x75, 0x63, 0x28, + 0xd7, 0x37, 0x86, 0xf2, 0xf7, 0xc6, 0x50, 0x7e, 0xde, 0x1a, 0x85, 0xeb, 0x5b, 0xa3, 0xf0, 0xe7, + 0xd6, 0x28, 0x7c, 0x5a, 0xc9, 0xfb, 0x0f, 0xd0, 0x2f, 0xf3, 0x9f, 0x97, 0xff, 0x02, 0x00, 0x00, + 0xff, 0xff, 0xa2, 0x2c, 0x2b, 0x73, 0x22, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { @@ -1664,7 +1673,7 @@ func (m *CheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *CheckUsageRequest) Marshal() (dAtA []byte, err error) { +func (m *SpaceInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1674,12 +1683,12 @@ func (m *CheckUsageRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CheckUsageRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *SpaceInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CheckUsageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SpaceInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1694,7 +1703,7 @@ func (m *CheckUsageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *CheckUsageResponse) Marshal() (dAtA []byte, err error) { +func (m *SpaceInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1704,18 +1713,23 @@ func (m *CheckUsageResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *CheckUsageResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *SpaceInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *CheckUsageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *SpaceInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if m.UsageCids != 0 { - i = encodeVarintFile(dAtA, i, uint64(m.UsageCids)) + if m.FilesCount != 0 { + i = encodeVarintFile(dAtA, i, uint64(m.FilesCount)) + i-- + dAtA[i] = 0x20 + } + if m.CidsCount != 0 { + i = encodeVarintFile(dAtA, i, uint64(m.CidsCount)) i-- dAtA[i] = 0x18 } @@ -2010,7 +2024,7 @@ func (m *CheckResponse) Size() (n int) { return n } -func (m *CheckUsageRequest) Size() (n int) { +func (m *SpaceInfoRequest) Size() (n int) { if m == nil { return 0 } @@ -2023,7 +2037,7 @@ func (m *CheckUsageRequest) Size() (n int) { return n } -func (m *CheckUsageResponse) Size() (n int) { +func (m *SpaceInfoResponse) Size() (n int) { if m == nil { return 0 } @@ -2035,8 +2049,11 @@ func (m *CheckUsageResponse) Size() (n int) { if m.UsageBytes != 0 { n += 1 + sovFile(uint64(m.UsageBytes)) } - if m.UsageCids != 0 { - n += 1 + sovFile(uint64(m.UsageCids)) + if m.CidsCount != 0 { + n += 1 + sovFile(uint64(m.CidsCount)) + } + if m.FilesCount != 0 { + n += 1 + sovFile(uint64(m.FilesCount)) } return n } @@ -3688,7 +3705,7 @@ func (m *CheckResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *CheckUsageRequest) Unmarshal(dAtA []byte) error { +func (m *SpaceInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3711,10 +3728,10 @@ func (m *CheckUsageRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CheckUsageRequest: wiretype end group for non-group") + return fmt.Errorf("proto: SpaceInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CheckUsageRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SpaceInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3770,7 +3787,7 @@ func (m *CheckUsageRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error { +func (m *SpaceInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3793,10 +3810,10 @@ func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: CheckUsageResponse: wiretype end group for non-group") + return fmt.Errorf("proto: SpaceInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: CheckUsageResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: SpaceInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3839,9 +3856,9 @@ func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error { } case 3: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UsageCids", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field CidsCount", wireType) } - m.UsageCids = 0 + m.CidsCount = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowFile @@ -3851,7 +3868,26 @@ func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.UsageCids |= uint64(b&0x7F) << shift + m.CidsCount |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FilesCount", wireType) + } + m.FilesCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.FilesCount |= uint64(b&0x7F) << shift if b < 0x80 { break } diff --git a/commonfile/fileproto/file_drpc.pb.go b/commonfile/fileproto/file_drpc.pb.go index 9c205299..43d9124a 100644 --- a/commonfile/fileproto/file_drpc.pb.go +++ b/commonfile/fileproto/file_drpc.pb.go @@ -47,7 +47,7 @@ type DRPCFileClient interface { FilesDelete(ctx context.Context, in *FilesDeleteRequest) (*FilesDeleteResponse, error) FilesCheck(ctx context.Context, in *FilesCheckRequest) (*FilesCheckResponse, error) Check(ctx context.Context, in *CheckRequest) (*CheckResponse, error) - CheckUsage(ctx context.Context, in *CheckUsageRequest) (*CheckUsageResponse, error) + SpaceInfo(ctx context.Context, in *SpaceInfoRequest) (*SpaceInfoResponse, error) } type drpcFileClient struct { @@ -123,9 +123,9 @@ func (c *drpcFileClient) Check(ctx context.Context, in *CheckRequest) (*CheckRes return out, nil } -func (c *drpcFileClient) CheckUsage(ctx context.Context, in *CheckUsageRequest) (*CheckUsageResponse, error) { - out := new(CheckUsageResponse) - err := c.cc.Invoke(ctx, "/filesync.File/CheckUsage", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) +func (c *drpcFileClient) SpaceInfo(ctx context.Context, in *SpaceInfoRequest) (*SpaceInfoResponse, error) { + out := new(SpaceInfoResponse) + err := c.cc.Invoke(ctx, "/filesync.File/SpaceInfo", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) if err != nil { return nil, err } @@ -140,7 +140,7 @@ type DRPCFileServer interface { FilesDelete(context.Context, *FilesDeleteRequest) (*FilesDeleteResponse, error) FilesCheck(context.Context, *FilesCheckRequest) (*FilesCheckResponse, error) Check(context.Context, *CheckRequest) (*CheckResponse, error) - CheckUsage(context.Context, *CheckUsageRequest) (*CheckUsageResponse, error) + SpaceInfo(context.Context, *SpaceInfoRequest) (*SpaceInfoResponse, error) } type DRPCFileUnimplementedServer struct{} @@ -173,7 +173,7 @@ func (s *DRPCFileUnimplementedServer) Check(context.Context, *CheckRequest) (*Ch return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } -func (s *DRPCFileUnimplementedServer) CheckUsage(context.Context, *CheckUsageRequest) (*CheckUsageResponse, error) { +func (s *DRPCFileUnimplementedServer) SpaceInfo(context.Context, *SpaceInfoRequest) (*SpaceInfoResponse, error) { return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } @@ -247,14 +247,14 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, ) }, DRPCFileServer.Check, true case 7: - return "/filesync.File/CheckUsage", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, + return "/filesync.File/SpaceInfo", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCFileServer). - CheckUsage( + SpaceInfo( ctx, - in1.(*CheckUsageRequest), + in1.(*SpaceInfoRequest), ) - }, DRPCFileServer.CheckUsage, true + }, DRPCFileServer.SpaceInfo, true default: return "", nil, nil, nil, false } @@ -376,16 +376,16 @@ func (x *drpcFile_CheckStream) SendAndClose(m *CheckResponse) error { return x.CloseSend() } -type DRPCFile_CheckUsageStream interface { +type DRPCFile_SpaceInfoStream interface { drpc.Stream - SendAndClose(*CheckUsageResponse) error + SendAndClose(*SpaceInfoResponse) error } -type drpcFile_CheckUsageStream struct { +type drpcFile_SpaceInfoStream struct { drpc.Stream } -func (x *drpcFile_CheckUsageStream) SendAndClose(m *CheckUsageResponse) error { +func (x *drpcFile_SpaceInfoStream) SendAndClose(m *SpaceInfoResponse) error { if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil { return err } diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index 63d1e265..db30a1f1 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -24,8 +24,8 @@ service File { rpc FilesCheck(FilesCheckRequest) returns (FilesCheckResponse); // Check checks the connection and credentials rpc Check(CheckRequest) returns (CheckResponse); - // CheckUsage checks current usage and limits for a space - rpc CheckUsage(CheckUsageRequest) returns (CheckUsageResponse); + // SpaceInfo returns usage, limit, etc about space + rpc SpaceInfo(SpaceInfoRequest) returns (SpaceInfoResponse); } message BlockGetRequest { @@ -107,13 +107,14 @@ message CheckResponse { bool allowWrite = 2; } -message CheckUsageRequest { +message SpaceInfoRequest { string spaceId = 1; } -message CheckUsageResponse { +message SpaceInfoResponse { uint64 limitBytes = 1; uint64 usageBytes = 2; - uint64 usageCids = 3; + uint64 cidsCount = 3; + uint64 filesCount = 4; } From b37dec42a206a0d35ea62ae44b488e5d477b2e20 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Fri, 3 Mar 2023 13:08:38 +0300 Subject: [PATCH 05/30] fix fileproto --- commonfile/fileproto/file.pb.go | 114 ++++++++++++------------- commonfile/fileproto/protos/file.proto | 2 +- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index c9f1334e..52b1b6e0 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -708,7 +708,7 @@ var xxx_messageInfo_FilesDeleteResponse proto.InternalMessageInfo type FilesCheckRequest struct { SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - FileIds [][]byte `protobuf:"bytes,2,rep,name=fileIds,proto3" json:"fileIds,omitempty"` + FileIds []string `protobuf:"bytes,2,rep,name=fileIds,proto3" json:"fileIds,omitempty"` } func (m *FilesCheckRequest) Reset() { *m = FilesCheckRequest{} } @@ -751,7 +751,7 @@ func (m *FilesCheckRequest) GetSpaceId() string { return "" } -func (m *FilesCheckRequest) GetFileIds() [][]byte { +func (m *FilesCheckRequest) GetFileIds() []string { if m != nil { return m.FileIds } @@ -1031,53 +1031,53 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 730 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0x13, 0x93, 0x26, 0x93, 0xfe, 0x38, 0xdb, 0x52, 0x82, 0x1b, 0xac, 0xc8, 0x07, 0x54, - 0x55, 0x28, 0x95, 0x0a, 0x87, 0x5e, 0x7a, 0x68, 0xd2, 0x1f, 0x42, 0xa5, 0x82, 0x5c, 0x21, 0x04, - 0x9c, 0x1c, 0x7b, 0x43, 0x4d, 0x5d, 0x6f, 0xf0, 0x6e, 0xa0, 0x7d, 0x0b, 0x78, 0x1c, 0xde, 0xa0, - 0xc7, 0x1e, 0x39, 0xa2, 0xf6, 0x45, 0x90, 0xd7, 0xeb, 0x78, 0x13, 0xbb, 0x4a, 0x55, 0x89, 0x8b, - 0xb3, 0x3b, 0x3f, 0xdf, 0xf7, 0x69, 0x66, 0x67, 0x14, 0x78, 0xee, 0x90, 0xf3, 0x73, 0x12, 0x0c, - 0x3c, 0x1f, 0x6f, 0x46, 0x9f, 0x61, 0x48, 0x18, 0xd9, 0xe4, 0x5f, 0xca, 0x0d, 0x6d, 0x7e, 0x46, - 0x95, 0xe8, 0x4c, 0x2f, 0x03, 0xc7, 0xdc, 0x81, 0xa5, 0x8e, 0x4f, 0x9c, 0xb3, 0x43, 0xcc, 0x2c, - 0xfc, 0x6d, 0x84, 0x29, 0x43, 0x0d, 0x98, 0xa3, 0x43, 0xdb, 0xc1, 0x3d, 0xb7, 0xa1, 0xb4, 0x94, - 0xf5, 0xaa, 0x95, 0x5c, 0x91, 0x06, 0x25, 0xc7, 0x73, 0x1b, 0xc5, 0x96, 0xb2, 0x3e, 0x6f, 0x45, - 0x47, 0x73,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a, 0xc9, 0xfb, 0x0f, 0xd0, 0x2f, 0xf3, 0x9f, 0x97, 0xff, 0x02, 0x00, 0x00, - 0xff, 0xff, 0xa2, 0x2c, 0x2b, 0x73, 0x22, 0x08, 0x00, 0x00, + // 733 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x6e, 0xd3, 0x4c, + 0x14, 0x8e, 0x13, 0xff, 0x69, 0x7c, 0xd2, 0x8b, 0x33, 0xed, 0x5f, 0x82, 0x1b, 0xac, 0xc8, 0x0b, + 0x54, 0x55, 0x28, 0x95, 0x0a, 0x8b, 0x6e, 0xba, 0x68, 0xd2, 0x0b, 0xa1, 0x52, 0x41, 0xae, 0x10, + 0x02, 0x56, 0x8e, 0x3d, 0xa1, 0xa6, 0xae, 0x27, 0x78, 0x26, 0xd0, 0xbe, 0x05, 0x3c, 0x0e, 0x6f, + 0xd0, 0x65, 0x97, 0x2c, 0x51, 0xfb, 0x22, 0xc8, 0xe3, 0x71, 0x3c, 0x89, 0x8d, 0x5a, 0x55, 0x62, + 0xe3, 0xcc, 0x9c, 0xcb, 0xf7, 0x7d, 0x3a, 0x67, 0xce, 0x51, 0xe0, 0xa9, 0x4b, 0xce, 0xcf, 0x49, + 0x38, 0xf4, 0x03, 0xbc, 0x19, 0x7f, 0x46, 0x11, 0x61, 0x64, 0x93, 0x7f, 0x29, 0x37, 0x74, 0xf8, + 0x19, 0xd5, 0xe2, 0x33, 0xbd, 0x0c, 0x5d, 0x6b, 0x07, 0x96, 0xba, 0x01, 0x71, 0xcf, 0x0e, 0x31, + 0xb3, 0xf1, 0x97, 0x31, 0xa6, 0x0c, 0x35, 0x61, 0x8e, 0x8e, 0x1c, 0x17, 0xf7, 0xbd, 0xa6, 0xd2, + 0x56, 0xd6, 0x35, 0x3b, 0xbd, 0x22, 0x1d, 0x2a, 0xae, 0xef, 0x35, 0xcb, 0x6d, 0x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, 0x4b, 0xbf, 0x6e, 0xcd, 0xd2, 0x87, 0x95, 0xa2, 0xff, 0x00, 0x83, 0x2a, 0xff, 0x79, 0xfe, + 0x27, 0x00, 0x00, 0xff, 0xff, 0x80, 0x0a, 0x65, 0xcb, 0x22, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { @@ -1974,8 +1974,8 @@ func (m *FilesCheckRequest) Size() (n int) { n += 1 + l + sovFile(uint64(l)) } if len(m.FileIds) > 0 { - for _, b := range m.FileIds { - l = len(b) + for _, s := range m.FileIds { + l = len(s) n += 1 + l + sovFile(uint64(l)) } } @@ -3420,7 +3420,7 @@ func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FileIds", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowFile @@ -3430,23 +3430,23 @@ func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthFile } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthFile } if postIndex > l { return io.ErrUnexpectedEOF } - m.FileIds = append(m.FileIds, make([]byte, postIndex-iNdEx)) - copy(m.FileIds[len(m.FileIds)-1], dAtA[iNdEx:postIndex]) + m.FileIds = append(m.FileIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index db30a1f1..3bb7c05e 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -93,7 +93,7 @@ message FilesDeleteResponse {} message FilesCheckRequest { string spaceId = 1; - repeated bytes fileIds = 2; + repeated string fileIds = 2; } message FilesCheckResponse { From 70682ff397e6ea254e74822df2cc786ead3f82db Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Fri, 3 Mar 2023 13:09:55 +0300 Subject: [PATCH 06/30] fix fileproto --- commonfile/fileproto/file.pb.go | 114 ++++++++++++------------- commonfile/fileproto/protos/file.proto | 2 +- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index 52b1b6e0..9aa8aeeb 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -620,7 +620,7 @@ var xxx_messageInfo_BlocksBindResponse proto.InternalMessageInfo type FilesDeleteRequest struct { SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - FileIds [][]byte `protobuf:"bytes,2,rep,name=fileIds,proto3" json:"fileIds,omitempty"` + FileIds []string `protobuf:"bytes,2,rep,name=fileIds,proto3" json:"fileIds,omitempty"` } func (m *FilesDeleteRequest) Reset() { *m = FilesDeleteRequest{} } @@ -663,7 +663,7 @@ func (m *FilesDeleteRequest) GetSpaceId() string { return "" } -func (m *FilesDeleteRequest) GetFileIds() [][]byte { +func (m *FilesDeleteRequest) GetFileIds() []string { if m != nil { return m.FileIds } @@ -1031,53 +1031,53 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 733 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x6e, 0xd3, 0x4c, - 0x14, 0x8e, 0x13, 0xff, 0x69, 0x7c, 0xd2, 0x8b, 0x33, 0xed, 0x5f, 0x82, 0x1b, 0xac, 0xc8, 0x0b, - 0x54, 0x55, 0x28, 0x95, 0x0a, 0x8b, 0x6e, 0xba, 0x68, 0xd2, 0x0b, 0xa1, 0x52, 0x41, 0xae, 0x10, - 0x02, 0x56, 0x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, 0x1d, 0x6b, 0xac, 0x15, 0xfa, 0x04, 0xca, 0x2b, 0xa8, 0x4b, - 0x2b, 0x07, 0xb5, 0x66, 0x62, 0xa7, 0xde, 0xbd, 0xf1, 0xe4, 0x2f, 0x5e, 0x81, 0x75, 0x08, 0x90, - 0x8d, 0x28, 0x9a, 0xa5, 0x95, 0x77, 0x82, 0xd1, 0x2a, 0x76, 0x66, 0xa2, 0xa4, 0x59, 0x94, 0x45, - 0xe5, 0x87, 0x5d, 0x16, 0x55, 0x30, 0xc0, 0xb1, 0xa8, 0x6c, 0xee, 0x64, 0x51, 0xb9, 0xb1, 0x36, - 0x5a, 0xc5, 0x4e, 0x01, 0xb4, 0x0d, 0xff, 0x25, 0x18, 0xab, 0x59, 0xd8, 0x54, 0xfa, 0xa3, 0x9c, - 0x3d, 0xeb, 0xd4, 0x64, 0x16, 0xe4, 0x4e, 0xcd, 0xce, 0x93, 0xdc, 0xa9, 0xdc, 0xf0, 0x74, 0x3b, - 0x57, 0x37, 0xa6, 0x72, 0x7d, 0x63, 0x2a, 0xbf, 0x6f, 0x4c, 0xe5, 0xfb, 0xad, 0x59, 0xba, 0xbe, - 0x35, 0x4b, 0xbf, 0x6e, 0xcd, 0xd2, 0x87, 0x95, 0xa2, 0xff, 0x00, 0x83, 0x2a, 0xff, 0x79, 0xfe, - 0x27, 0x00, 0x00, 0xff, 0xff, 0x80, 0x0a, 0x65, 0xcb, 0x22, 0x08, 0x00, 0x00, + // 731 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0x8e, 0x13, 0x93, 0xc6, 0x93, 0xfe, 0x38, 0xdb, 0x52, 0x82, 0x1b, 0xac, 0xc8, 0x07, 0x54, + 0x55, 0x28, 0x95, 0x0a, 0x87, 0x5e, 0x7a, 0x68, 0xd2, 0x1f, 0x42, 0xa5, 0x82, 0x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40, 0x69, 0xc7, 0x1a, 0x6b, 0xb9, 0x3e, 0x81, 0xf2, 0x06, 0xaa, 0xd2, 0xca, 0x41, + 0x8d, 0x89, 0xd8, 0xb1, 0x77, 0x6f, 0x3c, 0xbb, 0xc3, 0x2b, 0xb0, 0x0e, 0x01, 0xb2, 0x11, 0x45, + 0x93, 0xb4, 0xf2, 0x4e, 0x30, 0x1a, 0xf9, 0xce, 0x4c, 0x94, 0x34, 0x8b, 0xb2, 0xa8, 0xe9, 0x61, + 0x97, 0x45, 0xe5, 0x0c, 0x70, 0x2c, 0x2a, 0x9b, 0x3b, 0x59, 0xd4, 0xd4, 0x58, 0x1b, 0x8d, 0x7c, + 0xa7, 0x00, 0xda, 0x86, 0x47, 0x09, 0xc6, 0x6a, 0x16, 0x36, 0x96, 0xfe, 0x64, 0xca, 0x9e, 0x75, + 0x6a, 0x34, 0x0b, 0x72, 0xa7, 0x26, 0xe7, 0x49, 0xee, 0xd4, 0xd4, 0xf0, 0xb4, 0x5b, 0x57, 0x37, + 0xa6, 0x72, 0x7d, 0x63, 0x2a, 0x7f, 0x6f, 0x4c, 0xe5, 0xe7, 0xad, 0x59, 0xb8, 0xbe, 0x35, 0x0b, + 0x7f, 0x6e, 0xcd, 0xc2, 0xa7, 0x95, 0xbc, 0xff, 0x00, 0xbd, 0x32, 0xff, 0x79, 0xf9, 0x2f, 0x00, + 0x00, 0xff, 0xff, 0x21, 0xe9, 0xf4, 0xee, 0x22, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { @@ -1946,8 +1946,8 @@ func (m *FilesDeleteRequest) Size() (n int) { n += 1 + l + sovFile(uint64(l)) } if len(m.FileIds) > 0 { - for _, b := range m.FileIds { - l = len(b) + for _, s := range m.FileIds { + l = len(s) n += 1 + l + sovFile(uint64(l)) } } @@ -3256,7 +3256,7 @@ func (m *FilesDeleteRequest) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field FileIds", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowFile @@ -3266,23 +3266,23 @@ func (m *FilesDeleteRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthFile } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthFile } if postIndex > l { return io.ErrUnexpectedEOF } - m.FileIds = append(m.FileIds, make([]byte, postIndex-iNdEx)) - copy(m.FileIds[len(m.FileIds)-1], dAtA[iNdEx:postIndex]) + m.FileIds = append(m.FileIds, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index 3bb7c05e..853cdd50 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -86,7 +86,7 @@ message BlocksBindResponse {} message FilesDeleteRequest { string spaceId = 1; - repeated bytes fileIds = 2; + repeated string fileIds = 2; } message FilesDeleteResponse {} From 6524762c095f2ca7f275bc7b674c56da231a05f9 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Fri, 3 Mar 2023 13:22:37 +0300 Subject: [PATCH 07/30] fileproto: FileInfo --- commonfile/fileproto/file.pb.go | 458 +++++++++++++++++++------ commonfile/fileproto/file_drpc.pb.go | 28 +- commonfile/fileproto/protos/file.proto | 16 +- 3 files changed, 375 insertions(+), 127 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index 9aa8aeeb..dc3e0a31 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -706,23 +706,23 @@ func (m *FilesDeleteResponse) XXX_DiscardUnknown() { var xxx_messageInfo_FilesDeleteResponse proto.InternalMessageInfo -type FilesCheckRequest struct { +type FilesInfoRequest struct { SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` FileIds []string `protobuf:"bytes,2,rep,name=fileIds,proto3" json:"fileIds,omitempty"` } -func (m *FilesCheckRequest) Reset() { *m = FilesCheckRequest{} } -func (m *FilesCheckRequest) String() string { return proto.CompactTextString(m) } -func (*FilesCheckRequest) ProtoMessage() {} -func (*FilesCheckRequest) Descriptor() ([]byte, []int) { +func (m *FilesInfoRequest) Reset() { *m = FilesInfoRequest{} } +func (m *FilesInfoRequest) String() string { return proto.CompactTextString(m) } +func (*FilesInfoRequest) ProtoMessage() {} +func (*FilesInfoRequest) Descriptor() ([]byte, []int) { return fileDescriptor_fd665a7e11c833d5, []int{13} } -func (m *FilesCheckRequest) XXX_Unmarshal(b []byte) error { +func (m *FilesInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *FilesCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *FilesInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_FilesCheckRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_FilesInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -732,48 +732,48 @@ func (m *FilesCheckRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *FilesCheckRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilesCheckRequest.Merge(m, src) +func (m *FilesInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilesInfoRequest.Merge(m, src) } -func (m *FilesCheckRequest) XXX_Size() int { +func (m *FilesInfoRequest) XXX_Size() int { return m.Size() } -func (m *FilesCheckRequest) XXX_DiscardUnknown() { - xxx_messageInfo_FilesCheckRequest.DiscardUnknown(m) +func (m *FilesInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_FilesInfoRequest.DiscardUnknown(m) } -var xxx_messageInfo_FilesCheckRequest proto.InternalMessageInfo +var xxx_messageInfo_FilesInfoRequest proto.InternalMessageInfo -func (m *FilesCheckRequest) GetSpaceId() string { +func (m *FilesInfoRequest) GetSpaceId() string { if m != nil { return m.SpaceId } return "" } -func (m *FilesCheckRequest) GetFileIds() []string { +func (m *FilesInfoRequest) GetFileIds() []string { if m != nil { return m.FileIds } return nil } -type FilesCheckResponse struct { - BlocksAvailability []*BlockAvailability `protobuf:"bytes,1,rep,name=blocksAvailability,proto3" json:"blocksAvailability,omitempty"` +type FilesInfoResponse struct { + FilesInfo []*FileInfo `protobuf:"bytes,1,rep,name=filesInfo,proto3" json:"filesInfo,omitempty"` } -func (m *FilesCheckResponse) Reset() { *m = FilesCheckResponse{} } -func (m *FilesCheckResponse) String() string { return proto.CompactTextString(m) } -func (*FilesCheckResponse) ProtoMessage() {} -func (*FilesCheckResponse) Descriptor() ([]byte, []int) { +func (m *FilesInfoResponse) Reset() { *m = FilesInfoResponse{} } +func (m *FilesInfoResponse) String() string { return proto.CompactTextString(m) } +func (*FilesInfoResponse) ProtoMessage() {} +func (*FilesInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_fd665a7e11c833d5, []int{14} } -func (m *FilesCheckResponse) XXX_Unmarshal(b []byte) error { +func (m *FilesInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *FilesCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *FilesInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_FilesCheckResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_FilesInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -783,25 +783,85 @@ func (m *FilesCheckResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *FilesCheckResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_FilesCheckResponse.Merge(m, src) +func (m *FilesInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_FilesInfoResponse.Merge(m, src) } -func (m *FilesCheckResponse) XXX_Size() int { +func (m *FilesInfoResponse) XXX_Size() int { return m.Size() } -func (m *FilesCheckResponse) XXX_DiscardUnknown() { - xxx_messageInfo_FilesCheckResponse.DiscardUnknown(m) +func (m *FilesInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_FilesInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_FilesCheckResponse proto.InternalMessageInfo +var xxx_messageInfo_FilesInfoResponse proto.InternalMessageInfo -func (m *FilesCheckResponse) GetBlocksAvailability() []*BlockAvailability { +func (m *FilesInfoResponse) GetFilesInfo() []*FileInfo { if m != nil { - return m.BlocksAvailability + return m.FilesInfo } return nil } +type FileInfo struct { + FileId string `protobuf:"bytes,1,opt,name=fileId,proto3" json:"fileId,omitempty"` + UsageBytes uint64 `protobuf:"varint,2,opt,name=usageBytes,proto3" json:"usageBytes,omitempty"` + CidsCount uint32 `protobuf:"varint,3,opt,name=cidsCount,proto3" json:"cidsCount,omitempty"` +} + +func (m *FileInfo) Reset() { *m = FileInfo{} } +func (m *FileInfo) String() string { return proto.CompactTextString(m) } +func (*FileInfo) ProtoMessage() {} +func (*FileInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_fd665a7e11c833d5, []int{15} +} +func (m *FileInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *FileInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_FileInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *FileInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_FileInfo.Merge(m, src) +} +func (m *FileInfo) XXX_Size() int { + return m.Size() +} +func (m *FileInfo) XXX_DiscardUnknown() { + xxx_messageInfo_FileInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_FileInfo proto.InternalMessageInfo + +func (m *FileInfo) GetFileId() string { + if m != nil { + return m.FileId + } + return "" +} + +func (m *FileInfo) GetUsageBytes() uint64 { + if m != nil { + return m.UsageBytes + } + return 0 +} + +func (m *FileInfo) GetCidsCount() uint32 { + if m != nil { + return m.CidsCount + } + return 0 +} + type CheckRequest struct { } @@ -809,7 +869,7 @@ func (m *CheckRequest) Reset() { *m = CheckRequest{} } func (m *CheckRequest) String() string { return proto.CompactTextString(m) } func (*CheckRequest) ProtoMessage() {} func (*CheckRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{15} + return fileDescriptor_fd665a7e11c833d5, []int{16} } func (m *CheckRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -847,7 +907,7 @@ func (m *CheckResponse) Reset() { *m = CheckResponse{} } func (m *CheckResponse) String() string { return proto.CompactTextString(m) } func (*CheckResponse) ProtoMessage() {} func (*CheckResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{16} + return fileDescriptor_fd665a7e11c833d5, []int{17} } func (m *CheckResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -898,7 +958,7 @@ func (m *SpaceInfoRequest) Reset() { *m = SpaceInfoRequest{} } func (m *SpaceInfoRequest) String() string { return proto.CompactTextString(m) } func (*SpaceInfoRequest) ProtoMessage() {} func (*SpaceInfoRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{17} + return fileDescriptor_fd665a7e11c833d5, []int{18} } func (m *SpaceInfoRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -945,7 +1005,7 @@ func (m *SpaceInfoResponse) Reset() { *m = SpaceInfoResponse{} } func (m *SpaceInfoResponse) String() string { return proto.CompactTextString(m) } func (*SpaceInfoResponse) ProtoMessage() {} func (*SpaceInfoResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_fd665a7e11c833d5, []int{18} + return fileDescriptor_fd665a7e11c833d5, []int{19} } func (m *SpaceInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1018,8 +1078,9 @@ func init() { proto.RegisterType((*BlocksBindResponse)(nil), "filesync.BlocksBindResponse") proto.RegisterType((*FilesDeleteRequest)(nil), "filesync.FilesDeleteRequest") proto.RegisterType((*FilesDeleteResponse)(nil), "filesync.FilesDeleteResponse") - proto.RegisterType((*FilesCheckRequest)(nil), "filesync.FilesCheckRequest") - proto.RegisterType((*FilesCheckResponse)(nil), "filesync.FilesCheckResponse") + proto.RegisterType((*FilesInfoRequest)(nil), "filesync.FilesInfoRequest") + proto.RegisterType((*FilesInfoResponse)(nil), "filesync.FilesInfoResponse") + proto.RegisterType((*FileInfo)(nil), "filesync.FileInfo") proto.RegisterType((*CheckRequest)(nil), "filesync.CheckRequest") proto.RegisterType((*CheckResponse)(nil), "filesync.CheckResponse") proto.RegisterType((*SpaceInfoRequest)(nil), "filesync.SpaceInfoRequest") @@ -1031,53 +1092,55 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 731 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0x8e, 0x13, 0x93, 0xc6, 0x93, 0xfe, 0x38, 0xdb, 0x52, 0x82, 0x1b, 0xac, 0xc8, 0x07, 0x54, - 0x55, 0x28, 0x95, 0x0a, 0x87, 0x5e, 0x7a, 0x68, 0xd2, 0x1f, 0x42, 0xa5, 0x82, 0x5c, 0x21, 0x04, - 0x9c, 0x1c, 0x7b, 0x43, 0x4d, 0x5d, 0x6f, 0xf0, 0x6e, 0xa0, 0x7d, 0x0b, 0x78, 0x1c, 0xde, 0xa0, - 0xc7, 0x1e, 0x39, 0xa2, 0xf6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xb0, 0x0e, 0x01, 0xb2, 0x11, 0x45, - 0x93, 0xb4, 0xf2, 0x4e, 0x30, 0x1a, 0xf9, 0xce, 0x4c, 0x94, 0x34, 0x8b, 0xb2, 0xa8, 0xe9, 0x61, - 0x97, 0x45, 0xe5, 0x0c, 0x70, 0x2c, 0x2a, 0x9b, 0x3b, 0x59, 0xd4, 0xd4, 0x58, 0x1b, 0x8d, 0x7c, - 0xa7, 0x00, 0xda, 0x86, 0x47, 0x09, 0xc6, 0x6a, 0x16, 0x36, 0x96, 0xfe, 0x64, 0xca, 0x9e, 0x75, - 0x6a, 0x34, 0x0b, 0x72, 0xa7, 0x26, 0xe7, 0x49, 0xee, 0xd4, 0xd4, 0xf0, 0xb4, 0x5b, 0x57, 0x37, - 0xa6, 0x72, 0x7d, 0x63, 0x2a, 0x7f, 0x6f, 0x4c, 0xe5, 0xe7, 0xad, 0x59, 0xb8, 0xbe, 0x35, 0x0b, - 0x7f, 0x6e, 0xcd, 0xc2, 0xa7, 0x95, 0xbc, 0xff, 0x00, 0xbd, 0x32, 0xff, 0x79, 0xf9, 0x2f, 0x00, - 0x00, 0xff, 0xff, 0x21, 0xe9, 0xf4, 0xee, 0x22, 0x08, 0x00, 0x00, + // 764 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xc1, 0x4e, 0xdb, 0x4c, + 0x10, 0xce, 0x12, 0xff, 0x21, 0x9e, 0x10, 0x70, 0x16, 0x7e, 0xfe, 0xfc, 0x21, 0xb5, 0x22, 0x1f, + 0x2a, 0x84, 0xaa, 0x50, 0xd1, 0x1e, 0xb8, 0x70, 0x20, 0x21, 0xd0, 0x14, 0x89, 0x56, 0x46, 0x55, + 0xd5, 0xf6, 0x52, 0xc7, 0xde, 0x14, 0x17, 0xe3, 0x4d, 0xb3, 0x9b, 0x16, 0xde, 0xa2, 0x7d, 0x99, + 0x3e, 0x03, 0x47, 0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 0xb5, 0xac, 0x2b, 0x29, 0xe6, 0x1e, 0xe8, 0xe3, 0x3d, 0x89, + 0xa7, 0x1d, 0x95, 0x45, 0x5d, 0x5b, 0xcb, 0xbc, 0x93, 0x59, 0x9e, 0x43, 0x49, 0xd9, 0x5b, 0xb8, + 0x3e, 0xe5, 0x3b, 0xb1, 0x12, 0x6b, 0x0f, 0x7e, 0x73, 0x2b, 0x73, 0x1d, 0x00, 0xa4, 0x73, 0x8e, + 0xa7, 0x69, 0xd5, 0xc5, 0x52, 0xab, 0x67, 0x5f, 0xa6, 0x45, 0x29, 0x03, 0xad, 0x16, 0x35, 0xbb, + 0x31, 0xd4, 0xa2, 0x32, 0xb6, 0x40, 0x24, 0xd3, 0x78, 0x7a, 0x55, 0x99, 0xa6, 0x57, 0x83, 0x2a, + 0xd3, 0xec, 0xb8, 0x6f, 0xc3, 0x3f, 0xb1, 0x40, 0xab, 0xa9, 0xd7, 0x84, 0x34, 0xff, 0xcd, 0xe0, + 0x29, 0xff, 0x78, 0x10, 0x54, 0xfe, 0xe9, 0x61, 0x52, 0xf9, 0x67, 0x26, 0xa7, 0xd5, 0xbc, 0xbc, + 0x36, 0xd1, 0xd5, 0xb5, 0x89, 0x7e, 0x5e, 0x9b, 0xe8, 0xeb, 0x8d, 0x99, 0xbb, 0xba, 0x31, 0x73, + 0x3f, 0x6e, 0xcc, 0xdc, 0xdb, 0x95, 0xac, 0xff, 0x22, 0x7a, 0x05, 0xf1, 0xe7, 0xc9, 0xaf, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xc8, 0x47, 0x3d, 0x0c, 0x64, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { @@ -1532,7 +1595,7 @@ func (m *FilesDeleteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *FilesCheckRequest) Marshal() (dAtA []byte, err error) { +func (m *FilesInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1542,12 +1605,12 @@ func (m *FilesCheckRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FilesCheckRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *FilesInfoRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *FilesCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *FilesInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1571,7 +1634,7 @@ func (m *FilesCheckRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *FilesCheckResponse) Marshal() (dAtA []byte, err error) { +func (m *FilesInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -1581,20 +1644,20 @@ func (m *FilesCheckResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *FilesCheckResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *FilesInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *FilesCheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *FilesInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.BlocksAvailability) > 0 { - for iNdEx := len(m.BlocksAvailability) - 1; iNdEx >= 0; iNdEx-- { + if len(m.FilesInfo) > 0 { + for iNdEx := len(m.FilesInfo) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.BlocksAvailability[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.FilesInfo[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1608,6 +1671,46 @@ func (m *FilesCheckResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *FileInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *FileInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *FileInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CidsCount != 0 { + i = encodeVarintFile(dAtA, i, uint64(m.CidsCount)) + i-- + dAtA[i] = 0x18 + } + if m.UsageBytes != 0 { + i = encodeVarintFile(dAtA, i, uint64(m.UsageBytes)) + i-- + dAtA[i] = 0x10 + } + if len(m.FileId) > 0 { + i -= len(m.FileId) + copy(dAtA[i:], m.FileId) + i = encodeVarintFile(dAtA, i, uint64(len(m.FileId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *CheckRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1963,7 +2066,7 @@ func (m *FilesDeleteResponse) Size() (n int) { return n } -func (m *FilesCheckRequest) Size() (n int) { +func (m *FilesInfoRequest) Size() (n int) { if m == nil { return 0 } @@ -1982,14 +2085,14 @@ func (m *FilesCheckRequest) Size() (n int) { return n } -func (m *FilesCheckResponse) Size() (n int) { +func (m *FilesInfoResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - if len(m.BlocksAvailability) > 0 { - for _, e := range m.BlocksAvailability { + if len(m.FilesInfo) > 0 { + for _, e := range m.FilesInfo { l = e.Size() n += 1 + l + sovFile(uint64(l)) } @@ -1997,6 +2100,25 @@ func (m *FilesCheckResponse) Size() (n int) { return n } +func (m *FileInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.FileId) + if l > 0 { + n += 1 + l + sovFile(uint64(l)) + } + if m.UsageBytes != 0 { + n += 1 + sovFile(uint64(m.UsageBytes)) + } + if m.CidsCount != 0 { + n += 1 + sovFile(uint64(m.CidsCount)) + } + return n +} + func (m *CheckRequest) Size() (n int) { if m == nil { return 0 @@ -3355,7 +3477,7 @@ func (m *FilesDeleteResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { +func (m *FilesInfoRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3378,10 +3500,10 @@ func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FilesCheckRequest: wiretype end group for non-group") + return fmt.Errorf("proto: FilesInfoRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FilesCheckRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FilesInfoRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3469,7 +3591,7 @@ func (m *FilesCheckRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *FilesCheckResponse) Unmarshal(dAtA []byte) error { +func (m *FilesInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -3492,15 +3614,15 @@ func (m *FilesCheckResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: FilesCheckResponse: wiretype end group for non-group") + return fmt.Errorf("proto: FilesInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: FilesCheckResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: FilesInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BlocksAvailability", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FilesInfo", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -3527,8 +3649,8 @@ func (m *FilesCheckResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BlocksAvailability = append(m.BlocksAvailability, &BlockAvailability{}) - if err := m.BlocksAvailability[len(m.BlocksAvailability)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.FilesInfo = append(m.FilesInfo, &FileInfo{}) + if err := m.FilesInfo[len(m.FilesInfo)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -3553,6 +3675,126 @@ func (m *FilesCheckResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *FileInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: FileInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: FileInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FileId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthFile + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthFile + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FileId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UsageBytes", wireType) + } + m.UsageBytes = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UsageBytes |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CidsCount", wireType) + } + m.CidsCount = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowFile + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CidsCount |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipFile(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthFile + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *CheckRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/commonfile/fileproto/file_drpc.pb.go b/commonfile/fileproto/file_drpc.pb.go index 43d9124a..2f9ee69d 100644 --- a/commonfile/fileproto/file_drpc.pb.go +++ b/commonfile/fileproto/file_drpc.pb.go @@ -45,7 +45,7 @@ type DRPCFileClient interface { BlocksCheck(ctx context.Context, in *BlocksCheckRequest) (*BlocksCheckResponse, error) BlocksBind(ctx context.Context, in *BlocksBindRequest) (*BlocksBindResponse, error) FilesDelete(ctx context.Context, in *FilesDeleteRequest) (*FilesDeleteResponse, error) - FilesCheck(ctx context.Context, in *FilesCheckRequest) (*FilesCheckResponse, error) + FilesInfo(ctx context.Context, in *FilesInfoRequest) (*FilesInfoResponse, error) Check(ctx context.Context, in *CheckRequest) (*CheckResponse, error) SpaceInfo(ctx context.Context, in *SpaceInfoRequest) (*SpaceInfoResponse, error) } @@ -105,9 +105,9 @@ func (c *drpcFileClient) FilesDelete(ctx context.Context, in *FilesDeleteRequest return out, nil } -func (c *drpcFileClient) FilesCheck(ctx context.Context, in *FilesCheckRequest) (*FilesCheckResponse, error) { - out := new(FilesCheckResponse) - err := c.cc.Invoke(ctx, "/filesync.File/FilesCheck", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) +func (c *drpcFileClient) FilesInfo(ctx context.Context, in *FilesInfoRequest) (*FilesInfoResponse, error) { + out := new(FilesInfoResponse) + err := c.cc.Invoke(ctx, "/filesync.File/FilesInfo", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) if err != nil { return nil, err } @@ -138,7 +138,7 @@ type DRPCFileServer interface { BlocksCheck(context.Context, *BlocksCheckRequest) (*BlocksCheckResponse, error) BlocksBind(context.Context, *BlocksBindRequest) (*BlocksBindResponse, error) FilesDelete(context.Context, *FilesDeleteRequest) (*FilesDeleteResponse, error) - FilesCheck(context.Context, *FilesCheckRequest) (*FilesCheckResponse, error) + FilesInfo(context.Context, *FilesInfoRequest) (*FilesInfoResponse, error) Check(context.Context, *CheckRequest) (*CheckResponse, error) SpaceInfo(context.Context, *SpaceInfoRequest) (*SpaceInfoResponse, error) } @@ -165,7 +165,7 @@ func (s *DRPCFileUnimplementedServer) FilesDelete(context.Context, *FilesDeleteR return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } -func (s *DRPCFileUnimplementedServer) FilesCheck(context.Context, *FilesCheckRequest) (*FilesCheckResponse, error) { +func (s *DRPCFileUnimplementedServer) FilesInfo(context.Context, *FilesInfoRequest) (*FilesInfoResponse, error) { return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) } @@ -229,14 +229,14 @@ func (DRPCFileDescription) Method(n int) (string, drpc.Encoding, drpc.Receiver, ) }, DRPCFileServer.FilesDelete, true case 5: - return "/filesync.File/FilesCheck", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, + return "/filesync.File/FilesInfo", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { return srv.(DRPCFileServer). - FilesCheck( + FilesInfo( ctx, - in1.(*FilesCheckRequest), + in1.(*FilesInfoRequest), ) - }, DRPCFileServer.FilesCheck, true + }, DRPCFileServer.FilesInfo, true case 6: return "/filesync.File/Check", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) { @@ -344,16 +344,16 @@ func (x *drpcFile_FilesDeleteStream) SendAndClose(m *FilesDeleteResponse) error return x.CloseSend() } -type DRPCFile_FilesCheckStream interface { +type DRPCFile_FilesInfoStream interface { drpc.Stream - SendAndClose(*FilesCheckResponse) error + SendAndClose(*FilesInfoResponse) error } -type drpcFile_FilesCheckStream struct { +type drpcFile_FilesInfoStream struct { drpc.Stream } -func (x *drpcFile_FilesCheckStream) SendAndClose(m *FilesCheckResponse) error { +func (x *drpcFile_FilesInfoStream) SendAndClose(m *FilesInfoResponse) error { if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil { return err } diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index 853cdd50..c7d78cb9 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -20,8 +20,8 @@ service File { rpc BlocksBind(BlocksBindRequest) returns (BlocksBindResponse); // FilesDelete deletes files by id rpc FilesDelete(FilesDeleteRequest) returns (FilesDeleteResponse); - // FileCheck checks file CIDs and children for exists - rpc FilesCheck(FilesCheckRequest) returns (FilesCheckResponse); + // FilesInfo return info by given files id + rpc FilesInfo(FilesInfoRequest) returns (FilesInfoResponse); // Check checks the connection and credentials rpc Check(CheckRequest) returns (CheckResponse); // SpaceInfo returns usage, limit, etc about space @@ -91,13 +91,19 @@ message FilesDeleteRequest { message FilesDeleteResponse {} -message FilesCheckRequest { +message FilesInfoRequest { string spaceId = 1; repeated string fileIds = 2; } -message FilesCheckResponse { - repeated BlockAvailability blocksAvailability = 1; +message FilesInfoResponse { + repeated FileInfo filesInfo = 1; +} + +message FileInfo { + string fileId = 1; + uint64 usageBytes = 2; + uint32 cidsCount = 3; } message CheckRequest {} From bee7146a6082db0fe703d1d3fc0f32ce628a94c2 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Mon, 6 Mar 2023 12:22:29 +0300 Subject: [PATCH 08/30] fileId ctx funcs --- commonfile/fileblockstore/fileblockstore.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/commonfile/fileblockstore/fileblockstore.go b/commonfile/fileblockstore/fileblockstore.go index 3f2e33af..99c89b20 100644 --- a/commonfile/fileblockstore/fileblockstore.go +++ b/commonfile/fileblockstore/fileblockstore.go @@ -21,6 +21,7 @@ type ctxKey uint const ( ctxKeySpaceId ctxKey = iota + ctxKeyFileId ) type BlockStore interface { @@ -48,3 +49,12 @@ func CtxGetSpaceId(ctx context.Context) (spaceId string) { spaceId, _ = ctx.Value(ctxKeySpaceId).(string) return } + +func CtxWithFileId(ctx context.Context, spaceId string) context.Context { + return context.WithValue(ctx, ctxKeyFileId, spaceId) +} + +func CtxGetFileId(ctx context.Context) (spaceId string) { + spaceId, _ = ctx.Value(ctxKeyFileId).(string) + return +} From ec0d8a0c0795cc8844082cf68e561c4d84b564af Mon Sep 17 00:00:00 2001 From: Roman Khafizianov Date: Fri, 10 Mar 2023 19:18:15 +0100 Subject: [PATCH 09/30] fix replacing existing logger --- app/logger/ctxfiled.go | 7 ++- app/logger/log.go | 48 ++++++++++++++----- commonspace/object/acl/list/aclstate.go | 7 +-- .../object/tree/objecttree/treebuilder.go | 5 +- 4 files changed, 48 insertions(+), 19 deletions(-) diff --git a/app/logger/ctxfiled.go b/app/logger/ctxfiled.go index 83d8bba4..5597ba54 100644 --- a/app/logger/ctxfiled.go +++ b/app/logger/ctxfiled.go @@ -32,6 +32,7 @@ func CtxGetFields(ctx context.Context) (fields []zap.Field) { type CtxLogger struct { *zap.Logger + name string } func (cl CtxLogger) DebugCtx(ctx context.Context, msg string, fields ...zap.Field) { @@ -51,5 +52,9 @@ func (cl CtxLogger) ErrorCtx(ctx context.Context, msg string, fields ...zap.Fiel } func (cl CtxLogger) With(fields ...zap.Field) CtxLogger { - return CtxLogger{cl.Logger.With(fields...)} + return CtxLogger{cl.Logger.With(fields...), cl.name} +} + +func (cl CtxLogger) Sugar() *zap.SugaredLogger { + return NewNamedSugared(cl.name) } diff --git a/app/logger/log.go b/app/logger/log.go index 264cdaf1..e41c20d1 100644 --- a/app/logger/log.go +++ b/app/logger/log.go @@ -8,12 +8,13 @@ import ( ) var ( - mu sync.Mutex - logger *zap.Logger - loggerConfig zap.Config - namedLevels = make(map[string]zap.AtomicLevel) - namedGlobs = make(map[string]glob.Glob) - namedLoggers = make(map[string]CtxLogger) + mu sync.Mutex + logger *zap.Logger + loggerConfig zap.Config + namedLevels = make(map[string]zap.AtomicLevel) + namedGlobs = make(map[string]glob.Glob) + namedLoggers = make(map[string]CtxLogger) + namedSugarLoggers = make(map[string]*zap.SugaredLogger) ) func init() { @@ -59,10 +60,18 @@ func SetNamedLevels(l map[string]zap.AtomicLevel) { for name, nl := range namedLoggers { level := getLevel(name) - // this can be racy, but - nl.Logger = zap.New(logger.Core()).WithOptions( + newCore := zap.New(logger.Core()).Named(name).WithOptions( zap.IncreaseLevel(level), - ).Named(name) + ) + *(nl.Logger) = *newCore + } + + for name, nl := range namedSugarLoggers { + level := getLevel(name) + newCore := zap.New(logger.Core()).Named(name).WithOptions( + zap.IncreaseLevel(level), + ).Sugar() + *(nl) = *newCore } } @@ -100,11 +109,24 @@ func NewNamed(name string, fields ...zap.Field) CtxLogger { } level := getLevel(name) - l := zap.New(logger.Core()).WithOptions( - zap.IncreaseLevel(level), - ).Named(name) + l := zap.New(logger.Core()).Named(name).WithOptions(zap.IncreaseLevel(level), + zap.Fields(fields...)) - ctxL := CtxLogger{l} + ctxL := CtxLogger{Logger: l, name: name} namedLoggers[name] = ctxL return ctxL } + +func NewNamedSugared(name string) *zap.SugaredLogger { + mu.Lock() + defer mu.Unlock() + + if l, nameExists := namedSugarLoggers[name]; nameExists { + return l + } + + level := getLevel(name) + l := zap.New(logger.Core()).Named(name).Sugar().WithOptions(zap.IncreaseLevel(level)) + namedSugarLoggers[name] = l + return l +} diff --git a/commonspace/object/acl/list/aclstate.go b/commonspace/object/acl/list/aclstate.go index 9808dddf..3acb0166 100644 --- a/commonspace/object/acl/list/aclstate.go +++ b/commonspace/object/acl/list/aclstate.go @@ -4,8 +4,10 @@ import ( "bytes" "errors" "fmt" + "hash/fnv" + "github.com/anytypeio/any-sync/app/logger" - aclrecordproto "github.com/anytypeio/any-sync/commonspace/object/acl/aclrecordproto" + "github.com/anytypeio/any-sync/commonspace/object/acl/aclrecordproto" "github.com/anytypeio/any-sync/commonspace/object/keychain" "github.com/anytypeio/any-sync/util/keys" "github.com/anytypeio/any-sync/util/keys/asymmetric/encryptionkey" @@ -13,10 +15,9 @@ import ( "github.com/anytypeio/any-sync/util/keys/symmetric" "github.com/gogo/protobuf/proto" "go.uber.org/zap" - "hash/fnv" ) -var log = logger.NewNamed("acllist").Sugar() +var log = logger.NewNamedSugared("acllist") var ( ErrNoSuchUser = errors.New("no such user") diff --git a/commonspace/object/tree/objecttree/treebuilder.go b/commonspace/object/tree/objecttree/treebuilder.go index 113b8381..78ccceea 100644 --- a/commonspace/object/tree/objecttree/treebuilder.go +++ b/commonspace/object/tree/objecttree/treebuilder.go @@ -4,15 +4,16 @@ import ( "context" "errors" "fmt" + "time" + "github.com/anytypeio/any-sync/app/logger" "github.com/anytypeio/any-sync/commonspace/object/tree/treestorage" "github.com/anytypeio/any-sync/util/slice" "go.uber.org/zap" - "time" ) var ( - log = logger.NewNamed("acltree").Sugar() + log = logger.NewNamedSugared("acltree") ErrEmpty = errors.New("logs empty") ) From df9a5f11ae590c5cc30fea15d4944e2fbc7c05bf Mon Sep 17 00:00:00 2001 From: Roman Khafizianov Date: Fri, 10 Mar 2023 19:32:20 +0100 Subject: [PATCH 10/30] cleanup logger names --- commonspace/object/acl/list/aclstate.go | 2 +- commonspace/object/tree/objecttree/treebuilder.go | 2 +- net/peer/peer.go | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/commonspace/object/acl/list/aclstate.go b/commonspace/object/acl/list/aclstate.go index 3acb0166..fb6d4b49 100644 --- a/commonspace/object/acl/list/aclstate.go +++ b/commonspace/object/acl/list/aclstate.go @@ -17,7 +17,7 @@ import ( "go.uber.org/zap" ) -var log = logger.NewNamedSugared("acllist") +var log = logger.NewNamedSugared("common.commonspace.acllist") var ( ErrNoSuchUser = errors.New("no such user") diff --git a/commonspace/object/tree/objecttree/treebuilder.go b/commonspace/object/tree/objecttree/treebuilder.go index 78ccceea..edaa3ede 100644 --- a/commonspace/object/tree/objecttree/treebuilder.go +++ b/commonspace/object/tree/objecttree/treebuilder.go @@ -13,7 +13,7 @@ import ( ) var ( - log = logger.NewNamedSugared("acltree") + log = logger.NewNamedSugared("common.commonspace.objecttree") ErrEmpty = errors.New("logs empty") ) diff --git a/net/peer/peer.go b/net/peer/peer.go index 9c9f547d..21fb85f8 100644 --- a/net/peer/peer.go +++ b/net/peer/peer.go @@ -2,15 +2,16 @@ package peer import ( "context" + "sync/atomic" + "time" + "github.com/anytypeio/any-sync/app/logger" "github.com/libp2p/go-libp2p/core/sec" "go.uber.org/zap" "storj.io/drpc" - "sync/atomic" - "time" ) -var log = logger.NewNamed("peer") +var log = logger.NewNamed("net.peer") func NewPeer(sc sec.SecureConn, conn drpc.Conn) Peer { return &peer{ From 6b2667d4dc01be09ab8b54db08ab7645efc50b60 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Mon, 13 Mar 2023 12:58:37 +0100 Subject: [PATCH 11/30] Add increment/decrement logs --- commonspace/space.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commonspace/space.go b/commonspace/space.go index ece7437d..69277c5a 100644 --- a/commonspace/space.go +++ b/commonspace/space.go @@ -330,7 +330,7 @@ func (s *space) BuildTree(ctx context.Context, id string, opts BuildTreeOpts) (t if t, err = synctree.BuildSyncTreeOrGetRemote(ctx, id, deps); err != nil { return nil, err } - log.Debug("incrementing counter", zap.String("id", id), zap.String("spaceId", s.id)) + log.Debug("incrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()+1), zap.String("spaceId", s.id)) s.treesUsed.Add(1) return } @@ -406,7 +406,7 @@ func (s *space) handleMessage(msg HandleMessage) { } func (s *space) onObjectClose(id string) { - log.Debug("decrementing counter", zap.String("id", id), zap.String("spaceId", s.id)) + log.Debug("decrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()+1), zap.String("spaceId", s.id)) s.treesUsed.Add(-1) _ = s.handleQueue.CloseThread(id) } From a2efcafb3e191c6b3430108f4fa9c1857340ec17 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Mon, 13 Mar 2023 13:04:23 +0100 Subject: [PATCH 12/30] Update counters --- commonspace/space.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commonspace/space.go b/commonspace/space.go index 69277c5a..172de668 100644 --- a/commonspace/space.go +++ b/commonspace/space.go @@ -330,8 +330,8 @@ func (s *space) BuildTree(ctx context.Context, id string, opts BuildTreeOpts) (t if t, err = synctree.BuildSyncTreeOrGetRemote(ctx, id, deps); err != nil { return nil, err } - log.Debug("incrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()+1), zap.String("spaceId", s.id)) s.treesUsed.Add(1) + log.Debug("incrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()), zap.String("spaceId", s.id)) return } @@ -406,8 +406,8 @@ func (s *space) handleMessage(msg HandleMessage) { } func (s *space) onObjectClose(id string) { - log.Debug("decrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()+1), zap.String("spaceId", s.id)) s.treesUsed.Add(-1) + log.Debug("decrementing counter", zap.String("id", id), zap.Int32("trees", s.treesUsed.Load()), zap.String("spaceId", s.id)) _ = s.handleQueue.CloseThread(id) } From 25b0695d3ee0278406378c67f31903e3ff3fe7bd Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Mon, 13 Mar 2023 13:46:36 +0100 Subject: [PATCH 13/30] Add counter for put sync tree --- commonspace/space.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commonspace/space.go b/commonspace/space.go index 172de668..f6de90ea 100644 --- a/commonspace/space.go +++ b/commonspace/space.go @@ -295,7 +295,13 @@ func (s *space) PutTree(ctx context.Context, payload treestorage.TreeStorageCrea SyncStatus: s.syncStatus, PeerGetter: s.peerManager, } - return synctree.PutSyncTree(ctx, payload, deps) + t, err = synctree.PutSyncTree(ctx, payload, deps) + if err != nil { + return + } + s.treesUsed.Add(1) + log.Debug("incrementing counter", zap.String("id", payload.RootRawChange.Id), zap.Int32("trees", s.treesUsed.Load()), zap.String("spaceId", s.id)) + return } type BuildTreeOpts struct { From 86dcc83461541e201a27d70541d2f6d3ef262cf2 Mon Sep 17 00:00:00 2001 From: Roman Khafizianov Date: Mon, 13 Mar 2023 14:14:55 +0100 Subject: [PATCH 14/30] change logger name --- net/peer/peer.go | 2 +- net/timeoutconn/conn.go | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/net/peer/peer.go b/net/peer/peer.go index 21fb85f8..21eee669 100644 --- a/net/peer/peer.go +++ b/net/peer/peer.go @@ -11,7 +11,7 @@ import ( "storj.io/drpc" ) -var log = logger.NewNamed("net.peer") +var log = logger.NewNamed("common.net.peer") func NewPeer(sc sec.SecureConn, conn drpc.Conn) Peer { return &peer{ diff --git a/net/timeoutconn/conn.go b/net/timeoutconn/conn.go index 0f5c5d30..62917dbc 100644 --- a/net/timeoutconn/conn.go +++ b/net/timeoutconn/conn.go @@ -2,14 +2,15 @@ package timeoutconn import ( "errors" - "github.com/anytypeio/any-sync/app/logger" - "go.uber.org/zap" "net" "os" "time" + + "github.com/anytypeio/any-sync/app/logger" + "go.uber.org/zap" ) -var log = logger.NewNamed("net.timeoutconn") +var log = logger.NewNamed("common.net.timeoutconn") type Conn struct { net.Conn From e568f899aab0e56b93621429b79f2711f83ad64e Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Mon, 13 Mar 2023 17:18:21 +0100 Subject: [PATCH 15/30] Remove old connection from pool on close (GetOneOf) --- net/pool/pool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/net/pool/pool.go b/net/pool/pool.go index 287ab512..b2e4ae22 100644 --- a/net/pool/pool.go +++ b/net/pool/pool.go @@ -67,6 +67,7 @@ func (p *pool) GetOneOf(ctx context.Context, peerIds []string) (peer.Peer, error default: return pr, nil } + _, _ = p.cache.Remove(ctx, peerId) } } // shuffle ids for better consistency From 06b6ca22c0b65881bc70b8a5b484b43f13bf2854 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 18:08:51 +0000 Subject: [PATCH 16/30] Bump github.com/ipfs/go-ipfs-blockstore from 1.2.0 to 1.3.0 Bumps [github.com/ipfs/go-ipfs-blockstore](https://github.com/ipfs/go-ipfs-blockstore) from 1.2.0 to 1.3.0. - [Release notes](https://github.com/ipfs/go-ipfs-blockstore/releases) - [Commits](https://github.com/ipfs/go-ipfs-blockstore/compare/v1.2.0...v1.3.0) --- updated-dependencies: - dependency-name: github.com/ipfs/go-ipfs-blockstore dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 1c763027..2f6402f1 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/ipfs/go-block-format v0.1.1 github.com/ipfs/go-blockservice v0.5.0 github.com/ipfs/go-cid v0.3.2 - github.com/ipfs/go-ipfs-blockstore v1.2.0 + github.com/ipfs/go-ipfs-blockstore v1.3.0 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-exchange-interface v0.2.0 github.com/ipfs/go-ipld-format v0.4.0 diff --git a/go.sum b/go.sum index 1cc3b14b..98e68d63 100644 --- a/go.sum +++ b/go.sum @@ -214,8 +214,8 @@ github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0M github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= -github.com/ipfs/go-ipfs-blockstore v1.2.0 h1:n3WTeJ4LdICWs/0VSfjHrlqpPpl6MZ+ySd3j8qz0ykw= -github.com/ipfs/go-ipfs-blockstore v1.2.0/go.mod h1:eh8eTFLiINYNSNawfZOC7HOxNTxpB1PFuA5E1m/7exE= +github.com/ipfs/go-ipfs-blockstore v1.3.0 h1:m2EXaWgwTzAfsmt5UdJ7Is6l4gJcaM/A12XwJyvYvMM= +github.com/ipfs/go-ipfs-blockstore v1.3.0/go.mod h1:KgtZyc9fq+P2xJUiCAzbRdhhqJHvsw8u2Dlqy2MyRTE= github.com/ipfs/go-ipfs-blocksutil v0.0.1 h1:Eh/H4pc1hsvhzsQoMEP3Bke/aW5P5rVM1IWFJMcGIPQ= github.com/ipfs/go-ipfs-chunker v0.0.5 h1:ojCf7HV/m+uS2vhUGWcogIIxiO5ubl5O57Q7NapWLY8= github.com/ipfs/go-ipfs-chunker v0.0.5/go.mod h1:jhgdF8vxRHycr00k13FM8Y0E+6BoalYeobXmUyTreP8= @@ -237,7 +237,6 @@ github.com/ipfs/go-ipld-cbor v0.0.6 h1:pYuWHyvSpIsOOLw4Jy7NbBkCyzLDcl64Bf/LZW7eB github.com/ipfs/go-ipld-cbor v0.0.6/go.mod h1:ssdxxaLJPXH7OjF5V4NSjBbcfh+evoR4ukuru0oPXMA= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/ipfs/go-ipld-format v0.2.0/go.mod h1:3l3C1uKoadTPbeNfrDi+xMInYKlx2Cvg1BuydPSdzQs= -github.com/ipfs/go-ipld-format v0.3.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= github.com/ipfs/go-ipld-format v0.4.0 h1:yqJSaJftjmjc9jEOFYlpkwOLVKv68OD27jFLlSghBlQ= github.com/ipfs/go-ipld-format v0.4.0/go.mod h1:co/SdBE8h99968X0hViiw1MNlh6fvxxnHpvVLnH7jSM= github.com/ipfs/go-ipld-legacy v0.1.1 h1:BvD8PEuqwBHLTKqlGFTHSwrwFOMkVESEvwIYwR2cdcc= From 417b203b0919fc8407722ae71bde93caf905161f Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Thu, 16 Mar 2023 17:57:10 +0100 Subject: [PATCH 17/30] Derive space id as a separate method --- commonspace/spaceservice.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/commonspace/spaceservice.go b/commonspace/spaceservice.go index 89e9283b..0fc01125 100644 --- a/commonspace/spaceservice.go +++ b/commonspace/spaceservice.go @@ -35,6 +35,7 @@ const AddSpaceCtxKey ctxKey = 0 type SpaceService interface { DeriveSpace(ctx context.Context, payload SpaceDerivePayload) (string, error) + DerivedId(ctx context.Context, payload SpaceDerivePayload) (string, error) CreateSpace(ctx context.Context, payload SpaceCreatePayload) (string, error) NewSpace(ctx context.Context, id string) (sp Space, err error) app.Component @@ -88,6 +89,15 @@ func (s *spaceService) CreateSpace(ctx context.Context, payload SpaceCreatePaylo return store.Id(), nil } +func (s *spaceService) DerivedId(ctx context.Context, payload SpaceDerivePayload) (id string, err error) { + storageCreate, err := storagePayloadForSpaceDerive(payload) + if err != nil { + return + } + id = storageCreate.SpaceHeaderWithId.Id + return +} + func (s *spaceService) DeriveSpace(ctx context.Context, payload SpaceDerivePayload) (id string, err error) { storageCreate, err := storagePayloadForSpaceDerive(payload) if err != nil { From 2691da66f7506149867728664647a31dc07e00f4 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Thu, 16 Mar 2023 18:27:19 +0100 Subject: [PATCH 18/30] Update rpc err in pull space --- commonspace/spaceservice.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commonspace/spaceservice.go b/commonspace/spaceservice.go index 0fc01125..47427831 100644 --- a/commonspace/spaceservice.go +++ b/commonspace/spaceservice.go @@ -17,6 +17,7 @@ import ( "github.com/anytypeio/any-sync/commonspace/syncstatus" "github.com/anytypeio/any-sync/net/peer" "github.com/anytypeio/any-sync/net/pool" + "github.com/anytypeio/any-sync/net/rpc/rpcerr" "github.com/anytypeio/any-sync/nodeconf" "sync/atomic" ) @@ -216,6 +217,7 @@ func (s *spaceService) getSpaceStorageFromRemote(ctx context.Context, id string) cl := spacesyncproto.NewDRPCSpaceSyncClient(p) res, err := cl.SpacePull(ctx, &spacesyncproto.SpacePullRequest{Id: id}) if err != nil { + err = rpcerr.Unwrap(err) return } From ed1b597fc5fb1af755e4b68cead44868dda72ecf Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Thu, 16 Mar 2023 18:46:48 +0100 Subject: [PATCH 19/30] Add error wrapping in app --- app/app.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index 85d67f61..3655724c 100644 --- a/app/app.go +++ b/app/app.go @@ -172,7 +172,7 @@ func (app *App) Start(ctx context.Context) (err error) { for i, s := range app.components { if err = s.Init(app); err != nil { closeServices(i) - return fmt.Errorf("can't init service '%s': %v", s.Name(), err) + return fmt.Errorf("can't init service '%s': %w", s.Name(), err) } } @@ -181,7 +181,7 @@ func (app *App) Start(ctx context.Context) (err error) { start := time.Now() if err = serviceRun.Run(ctx); err != nil { closeServices(i) - return fmt.Errorf("can't run service '%s': %v", serviceRun.Name(), err) + return fmt.Errorf("can't run service '%s': %w", serviceRun.Name(), err) } spent := time.Since(start).Milliseconds() app.startStat.SpentMsTotal += spent From 305c509fc6a1edce94fbc31e84fb6867631fa66b Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Thu, 16 Mar 2023 19:01:05 +0100 Subject: [PATCH 20/30] Update derive id method name --- commonspace/spaceservice.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commonspace/spaceservice.go b/commonspace/spaceservice.go index 47427831..cf4a2710 100644 --- a/commonspace/spaceservice.go +++ b/commonspace/spaceservice.go @@ -36,7 +36,7 @@ const AddSpaceCtxKey ctxKey = 0 type SpaceService interface { DeriveSpace(ctx context.Context, payload SpaceDerivePayload) (string, error) - DerivedId(ctx context.Context, payload SpaceDerivePayload) (string, error) + DeriveId(ctx context.Context, payload SpaceDerivePayload) (string, error) CreateSpace(ctx context.Context, payload SpaceCreatePayload) (string, error) NewSpace(ctx context.Context, id string) (sp Space, err error) app.Component @@ -90,7 +90,7 @@ func (s *spaceService) CreateSpace(ctx context.Context, payload SpaceCreatePaylo return store.Id(), nil } -func (s *spaceService) DerivedId(ctx context.Context, payload SpaceDerivePayload) (id string, err error) { +func (s *spaceService) DeriveId(ctx context.Context, payload SpaceDerivePayload) (id string, err error) { storageCreate, err := storagePayloadForSpaceDerive(payload) if err != nil { return From 49248b02b38bfd7f3005fb9bd8dd0ed26dfb7821 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Sun, 19 Mar 2023 18:40:28 +0300 Subject: [PATCH 21/30] fileproto forbidden error --- commonfile/fileproto/file.pb.go | 100 +++++++++--------- .../fileproto/fileprotoerr/fileprotoerr.go | 1 + commonfile/fileproto/protos/file.proto | 1 + 3 files changed, 54 insertions(+), 48 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index dc3e0a31..2f409c6b 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -27,18 +27,21 @@ type ErrCodes int32 const ( ErrCodes_Unexpected ErrCodes = 0 ErrCodes_CIDNotFound ErrCodes = 1 + ErrCodes_Forbidden ErrCodes = 2 ErrCodes_ErrorOffset ErrCodes = 200 ) var ErrCodes_name = map[int32]string{ 0: "Unexpected", 1: "CIDNotFound", + 2: "Forbidden", 200: "ErrorOffset", } var ErrCodes_value = map[string]int32{ "Unexpected": 0, "CIDNotFound": 1, + "Forbidden": 2, "ErrorOffset": 200, } @@ -1092,55 +1095,56 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 764 bytes of a gzipped FileDescriptorProto + // 774 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xc1, 0x4e, 0xdb, 0x4c, - 0x10, 0xce, 0x12, 0xff, 0x21, 0x9e, 0x10, 0x70, 0x16, 0x7e, 0xfe, 0xfc, 0x21, 0xb5, 0x22, 0x1f, - 0x2a, 0x84, 0xaa, 0x50, 0xd1, 0x1e, 0xb8, 0x70, 0x20, 0x21, 0xd0, 0x14, 0x89, 0x56, 0x46, 0x55, - 0xd5, 0xf6, 0x52, 0xc7, 0xde, 0x14, 0x17, 0xe3, 0x4d, 0xb3, 0x9b, 0x16, 0xde, 0xa2, 0x7d, 0x99, - 0x3e, 0x03, 0x47, 0x8e, 0x3d, 0x56, 0xf0, 0x22, 0x95, 0xd7, 0xeb, 0x78, 0x93, 0xb8, 0x82, 0xd2, - 0x4b, 0x98, 0xfd, 0x76, 0x66, 0xbe, 0xd9, 0x6f, 0x3c, 0x23, 0xe0, 0xa1, 0x4b, 0xcf, 0xce, 0x68, - 0xd8, 0xf7, 0x03, 0xb2,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, 0x67, 0x5d, 0x09, 0x6d, 0xf7, 0x40, 0x9b, 0xac, 0x4d, 0x34, 0xeb, 0x28, 0xed, 0xed, 0xfa, + 0x7a, 0xe6, 0x9d, 0xc8, 0xf2, 0x0c, 0xca, 0xd2, 0x1a, 0x43, 0x8d, 0x19, 0xdf, 0xa9, 0x0d, 0x59, + 0xbf, 0xf7, 0x9b, 0x5b, 0x91, 0x6b, 0x1f, 0x20, 0x1d, 0x7b, 0x34, 0x4b, 0x2b, 0xef, 0x99, 0x7a, + 0x23, 0xfb, 0x32, 0x2d, 0x4a, 0x9a, 0x6f, 0xb9, 0xa8, 0xf9, 0x05, 0x22, 0x17, 0x95, 0xb1, 0x14, + 0x22, 0x99, 0x26, 0xc3, 0x2c, 0xcb, 0x34, 0xbb, 0x29, 0x64, 0x99, 0xe6, 0xa7, 0x7f, 0x07, 0xfe, + 0x89, 0x05, 0x5a, 0x4b, 0xbd, 0xa6, 0xa4, 0xf9, 0x6f, 0x0e, 0x4f, 0xf9, 0x27, 0x73, 0x21, 0xf3, + 0xcf, 0xce, 0x96, 0xcc, 0x3f, 0x37, 0x48, 0xed, 0xd6, 0xc5, 0x95, 0xa1, 0x5c, 0x5e, 0x19, 0xca, + 0xcf, 0x2b, 0x43, 0xf9, 0x7a, 0x6d, 0xe4, 0x2e, 0xaf, 0x8d, 0xdc, 0x8f, 0x6b, 0x23, 0xf7, 0x76, + 0x35, 0xeb, 0x9f, 0x8a, 0x41, 0x91, 0xff, 0x79, 0xf4, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xac, 0xc4, + 0x07, 0x04, 0x73, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { diff --git a/commonfile/fileproto/fileprotoerr/fileprotoerr.go b/commonfile/fileproto/fileprotoerr/fileprotoerr.go index fc7dbb4e..81bdd34d 100644 --- a/commonfile/fileproto/fileprotoerr/fileprotoerr.go +++ b/commonfile/fileproto/fileprotoerr/fileprotoerr.go @@ -10,4 +10,5 @@ var ( errGroup = rpcerr.ErrGroup(fileproto.ErrCodes_ErrorOffset) ErrUnexpected = errGroup.Register(fmt.Errorf("unexpected fileproto error"), uint64(fileproto.ErrCodes_Unexpected)) ErrCIDNotFound = errGroup.Register(fmt.Errorf("CID not found"), uint64(fileproto.ErrCodes_CIDNotFound)) + ErrForbidden = errGroup.Register(fmt.Errorf("forbidden"), uint64(fileproto.ErrCodes_Forbidden)) ) diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index c7d78cb9..3118bb76 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -6,6 +6,7 @@ option go_package = "commonfile/fileproto"; enum ErrCodes { Unexpected = 0; CIDNotFound = 1; + Forbidden = 2; ErrorOffset = 200; } From b3b1afa307c257a3c9382ef89a38c0d1b2eb7c4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 18:03:47 +0000 Subject: [PATCH 22/30] Bump github.com/multiformats/go-multibase from 0.1.1 to 0.2.0 Bumps [github.com/multiformats/go-multibase](https://github.com/multiformats/go-multibase) from 0.1.1 to 0.2.0. - [Release notes](https://github.com/multiformats/go-multibase/releases) - [Commits](https://github.com/multiformats/go-multibase/compare/v0.1.1...v0.2.0) --- updated-dependencies: - dependency-name: github.com/multiformats/go-multibase dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2f6402f1..76c1d000 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/libp2p/go-libp2p v0.24.1 github.com/minio/sha256-simd v1.0.0 github.com/mr-tron/base58 v1.2.0 - github.com/multiformats/go-multibase v0.1.1 + github.com/multiformats/go-multibase v0.2.0 github.com/multiformats/go-multihash v0.2.1 github.com/prometheus/client_golang v1.14.0 github.com/stretchr/testify v1.8.2 diff --git a/go.sum b/go.sum index 98e68d63..cbfb67e4 100644 --- a/go.sum +++ b/go.sum @@ -354,8 +354,8 @@ github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2 github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multibase v0.0.3/go.mod h1:5+1R4eQrT3PkYZ24C3W2Ue2tPwIdYQD509ZjSb5y9Oc= -github.com/multiformats/go-multibase v0.1.1 h1:3ASCDsuLX8+j4kx58qnJ4YFq/JWTJpCyDW27ztsVTOI= -github.com/multiformats/go-multibase v0.1.1/go.mod h1:ZEjHE+IsUrgp5mhlEAYjMtZwK1k4haNkcaPg9aoe1a8= +github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= +github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.8.0 h1:evBmgkbSQux+Ds2IgfhkO38Dl2GDtRW8/Rp6YiSHX/Q= github.com/multiformats/go-multicodec v0.8.0/go.mod h1:GUC8upxSBE4oG+q3kWZRw/+6yC1BqO550bjhWsJbZlw= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= From a523641dff88ce1d4b2ed8ff0469500d2b028801 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 18:04:01 +0000 Subject: [PATCH 23/30] Bump github.com/ipfs/go-cid from 0.3.2 to 0.4.0 Bumps [github.com/ipfs/go-cid](https://github.com/ipfs/go-cid) from 0.3.2 to 0.4.0. - [Release notes](https://github.com/ipfs/go-cid/releases) - [Commits](https://github.com/ipfs/go-cid/compare/v0.3.2...v0.4.0) --- updated-dependencies: - dependency-name: github.com/ipfs/go-cid dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 2f6402f1..2a46a145 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/huandu/skiplist v1.2.0 github.com/ipfs/go-block-format v0.1.1 github.com/ipfs/go-blockservice v0.5.0 - github.com/ipfs/go-cid v0.3.2 + github.com/ipfs/go-cid v0.4.0 github.com/ipfs/go-ipfs-blockstore v1.3.0 github.com/ipfs/go-ipfs-chunker v0.0.5 github.com/ipfs/go-ipfs-exchange-interface v0.2.0 diff --git a/go.sum b/go.sum index 98e68d63..f6f98655 100644 --- a/go.sum +++ b/go.sum @@ -207,8 +207,8 @@ github.com/ipfs/go-cid v0.0.4/go.mod h1:4LLaPOQwmk5z9LBgQnpkivrx8BJjUyGwTXCd5Xfj github.com/ipfs/go-cid v0.0.5/go.mod h1:plgt+Y5MnOey4vO4UlUazGqdbEXuFYitED67FexhXog= github.com/ipfs/go-cid v0.0.6/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= github.com/ipfs/go-cid v0.0.7/go.mod h1:6Ux9z5e+HpkQdckYoX1PG/6xqKspzlEIR5SDmgqgC/I= -github.com/ipfs/go-cid v0.3.2 h1:OGgOd+JCFM+y1DjWPmVH+2/4POtpDzwcr7VgnB7mZXc= -github.com/ipfs/go-cid v0.3.2/go.mod h1:gQ8pKqT/sUxGY+tIwy1RPpAojYu7jAyCp5Tz1svoupw= +github.com/ipfs/go-cid v0.4.0 h1:a4pdZq0sx6ZSxbCizebnKiMCx/xI/aBBFlB73IgH4rA= +github.com/ipfs/go-cid v0.4.0/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk= github.com/ipfs/go-datastore v0.5.0/go.mod h1:9zhEApYMTl17C8YDp7JmU7sQZi2/wqiYh73hakZ90Bk= github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= From 2f2100645722e90e5da031db2ae134b5e898ecb1 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 21 Mar 2023 11:10:50 +0100 Subject: [PATCH 24/30] update fileproto --- commonfile/fileproto/file.pb.go | 123 +++++++++--------- .../fileproto/fileprotoerr/fileprotoerr.go | 10 +- commonfile/fileproto/protos/file.proto | 2 + 3 files changed, 73 insertions(+), 62 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index 2f409c6b..f7158260 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -25,24 +25,30 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ErrCodes int32 const ( - ErrCodes_Unexpected ErrCodes = 0 - ErrCodes_CIDNotFound ErrCodes = 1 - ErrCodes_Forbidden ErrCodes = 2 - ErrCodes_ErrorOffset ErrCodes = 200 + ErrCodes_Unexpected ErrCodes = 0 + ErrCodes_CIDNotFound ErrCodes = 1 + ErrCodes_Forbidden ErrCodes = 2 + ErrCodes_SpaceLimitExceed ErrCodes = 3 + ErrCodes_BlockSizeExceed ErrCodes = 4 + ErrCodes_ErrorOffset ErrCodes = 200 ) var ErrCodes_name = map[int32]string{ 0: "Unexpected", 1: "CIDNotFound", 2: "Forbidden", + 3: "SpaceLimitExceed", + 4: "BlockSizeExceed", 200: "ErrorOffset", } var ErrCodes_value = map[string]int32{ - "Unexpected": 0, - "CIDNotFound": 1, - "Forbidden": 2, - "ErrorOffset": 200, + "Unexpected": 0, + "CIDNotFound": 1, + "Forbidden": 2, + "SpaceLimitExceed": 3, + "BlockSizeExceed": 4, + "ErrorOffset": 200, } func (x ErrCodes) String() string { @@ -1095,56 +1101,57 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 774 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xc1, 0x4e, 0xdb, 0x4c, - 0x10, 0x8e, 0x13, 0xff, 0x21, 0x9e, 0x10, 0x70, 0x16, 0x7e, 0xfe, 0xfc, 0x21, 0xb5, 0x22, 0x1f, - 0x2a, 0x84, 0xaa, 0x50, 0xd1, 0x1e, 0xb8, 0xf4, 0x40, 0x42, 0x42, 0x53, 0x2a, 0x5a, 0x19, 0x55, - 0x55, 0xdb, 0x4b, 0x1d, 0x7b, 0x53, 0x5c, 0x8c, 0x37, 0xf5, 0x6e, 0x5a, 0x78, 0x8b, 0xf6, 0x65, - 0xfa, 0x0c, 0x1c, 0x39, 0xf6, 0x58, 0xc1, 0x8b, 0x54, 0x5e, 0xaf, 0xe3, 0x4d, 0xe2, 0x0a, 0x4a, - 0x2f, 0x61, 0xf6, 0xdb, 0x99, 0xf9, 0x66, 0xbf, 0xf1, 0x8c, 0x80, 0xfb, 0x0e, 0x39, 0x3d, 0x25, - 0xc1, 0xd0, 0xf3, 0xf1, 0x56, 0xf4, 0x33, 0x0a, 0x09, 0x23, 0x5b, 0xfc, 0x97, 0x72, 0xa0, 0xc5, - 0x6d, 0x54, 0x8a, 0x6c, 0x7a, 0x1e, 0x38, 0xe6, 0x13, 0x58, 0x6e, 0xfb, 0xc4, 0x39, 0xd9, 0xc7, - 0xcc, 0xc2, 0x9f, 0xc6, 0x98, 0x32, 0x54, 0x83, 0x05, 0x3a, 0xb2, 0x1d, 0xdc, 0x77, 0x6b, 0x4a, - 0x53, 0xd9, 0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, 0xc3, 0x2c, 0xcb, 0x34, 0xbb, 0x29, 0x64, 0x99, 0xe6, 0xa7, 0x7f, 0x07, 0xfe, - 0x89, 0x05, 0x5a, 0x4b, 0xbd, 0xa6, 0xa4, 0xf9, 0x6f, 0x0e, 0x4f, 0xf9, 0x27, 0x73, 0x21, 0xf3, - 0xcf, 0xce, 0x96, 0xcc, 0x3f, 0x37, 0x48, 0xed, 0xd6, 0xc5, 0x95, 0xa1, 0x5c, 0x5e, 0x19, 0xca, - 0xcf, 0x2b, 0x43, 0xf9, 0x7a, 0x6d, 0xe4, 0x2e, 0xaf, 0x8d, 0xdc, 0x8f, 0x6b, 0x23, 0xf7, 0x76, - 0x35, 0xeb, 0x9f, 0x8a, 0x41, 0x91, 0xff, 0x79, 0xf4, 0x2b, 0x00, 0x00, 0xff, 0xff, 0xac, 0xc4, - 0x07, 0x04, 0x73, 0x08, 0x00, 0x00, + // 800 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x4e, 0xdb, 0x4a, + 0x14, 0x8e, 0x13, 0xdf, 0x10, 0x9f, 0x10, 0x70, 0x26, 0xb9, 0xdc, 0xdc, 0x90, 0x6b, 0x45, 0x5e, + 0x5c, 0x21, 0x74, 0x15, 0xae, 0x68, 0x17, 0x6c, 0xba, 0x20, 0x21, 0xa1, 0x29, 0x15, 0xad, 0x8c, + 0xaa, 0xaa, 0xed, 0xa6, 0x8e, 0x3d, 0x29, 0x2e, 0xc6, 0x4e, 0x3d, 0x93, 0x02, 0x7d, 0x8a, 0xf6, + 0x65, 0xfa, 0x0c, 0x2c, 0x59, 0x76, 0x59, 0xc1, 0x8b, 0x54, 0x33, 0x1e, 0xc7, 0x93, 0x9f, 0x0a, + 0x4a, 0x37, 0x66, 0xfc, 0xcd, 0x39, 0xe7, 0x3b, 0xf3, 0x1d, 0xcf, 0x47, 0xe0, 0x5f, 0x27, 0x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x48, 0xfa, 0x7f, 0xa1, 0x5e, 0x5f, 0xb4, 0x25, 0xc6, 0xb0, 0x07, + 0xda, 0xc4, 0x61, 0xd1, 0x6c, 0xa0, 0x64, 0xf1, 0xf5, 0xf5, 0x85, 0x7b, 0xa2, 0xca, 0x13, 0x28, + 0x4a, 0x8e, 0x87, 0x1a, 0x33, 0xb1, 0x53, 0x66, 0x5a, 0xff, 0xe7, 0x27, 0xbb, 0xa2, 0xd6, 0x3e, + 0x40, 0xea, 0x10, 0x68, 0x96, 0x56, 0xb6, 0xa4, 0x7a, 0x63, 0xf1, 0x66, 0xda, 0x94, 0x64, 0x05, + 0x72, 0x53, 0xf3, 0x5e, 0x23, 0x37, 0xb5, 0xc0, 0x3f, 0x98, 0x4c, 0x93, 0x7b, 0x2f, 0xcb, 0x34, + 0x6b, 0x2a, 0xb2, 0x4c, 0xf3, 0x46, 0xb1, 0x03, 0x7f, 0xc4, 0x02, 0xad, 0xa5, 0x51, 0x53, 0xd2, + 0xfc, 0x35, 0x87, 0xa7, 0xfc, 0x93, 0x2b, 0x24, 0xf3, 0xcf, 0x5e, 0x43, 0x99, 0x7f, 0xee, 0xce, + 0xb5, 0x5b, 0x97, 0xd7, 0x86, 0x72, 0x75, 0x6d, 0x28, 0xdf, 0xaf, 0x0d, 0xe5, 0xf3, 0x8d, 0x91, + 0xb9, 0xba, 0x31, 0x32, 0xdf, 0x6e, 0x8c, 0xcc, 0xeb, 0xea, 0xa2, 0xdf, 0x1f, 0x83, 0x3c, 0xff, + 0xf3, 0xe0, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x52, 0x41, 0xa3, 0x9e, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { diff --git a/commonfile/fileproto/fileprotoerr/fileprotoerr.go b/commonfile/fileproto/fileprotoerr/fileprotoerr.go index 81bdd34d..1d9bf2d9 100644 --- a/commonfile/fileproto/fileprotoerr/fileprotoerr.go +++ b/commonfile/fileproto/fileprotoerr/fileprotoerr.go @@ -7,8 +7,10 @@ import ( ) var ( - errGroup = rpcerr.ErrGroup(fileproto.ErrCodes_ErrorOffset) - ErrUnexpected = errGroup.Register(fmt.Errorf("unexpected fileproto error"), uint64(fileproto.ErrCodes_Unexpected)) - ErrCIDNotFound = errGroup.Register(fmt.Errorf("CID not found"), uint64(fileproto.ErrCodes_CIDNotFound)) - ErrForbidden = errGroup.Register(fmt.Errorf("forbidden"), uint64(fileproto.ErrCodes_Forbidden)) + errGroup = rpcerr.ErrGroup(fileproto.ErrCodes_ErrorOffset) + ErrUnexpected = errGroup.Register(fmt.Errorf("unexpected fileproto error"), uint64(fileproto.ErrCodes_Unexpected)) + ErrCIDNotFound = errGroup.Register(fmt.Errorf("CID not found"), uint64(fileproto.ErrCodes_CIDNotFound)) + ErrForbidden = errGroup.Register(fmt.Errorf("forbidden"), uint64(fileproto.ErrCodes_Forbidden)) + ErrSpaceLimitExceed = errGroup.Register(fmt.Errorf("space limit exceed"), uint64(fileproto.ErrCodes_SpaceLimitExceed)) + ErrBlockSizeExceed = errGroup.Register(fmt.Errorf("block size exceed"), uint64(fileproto.ErrCodes_BlockSizeExceed)) ) diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index 3118bb76..2fe63109 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -7,6 +7,8 @@ enum ErrCodes { Unexpected = 0; CIDNotFound = 1; Forbidden = 2; + SpaceLimitExceed = 3; + BlockSizeExceed = 4; ErrorOffset = 200; } From af2026fac884939b5a1631a3674ec11b4a58b169 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 21 Mar 2023 11:20:16 +0100 Subject: [PATCH 25/30] update fileproto --- commonfile/fileproto/file.pb.go | 134 +++++++++--------- .../fileproto/fileprotoerr/fileprotoerr.go | 13 +- commonfile/fileproto/protos/file.proto | 5 +- 3 files changed, 79 insertions(+), 73 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index f7158260..dba3f120 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -25,30 +25,33 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ErrCodes int32 const ( - ErrCodes_Unexpected ErrCodes = 0 - ErrCodes_CIDNotFound ErrCodes = 1 - ErrCodes_Forbidden ErrCodes = 2 - ErrCodes_SpaceLimitExceed ErrCodes = 3 - ErrCodes_BlockSizeExceed ErrCodes = 4 - ErrCodes_ErrorOffset ErrCodes = 200 + ErrCodes_Unexpected ErrCodes = 0 + ErrCodes_CIDNotFound ErrCodes = 1 + ErrCodes_Forbidden ErrCodes = 2 + ErrCodes_SpaceLimitExceeded ErrCodes = 3 + ErrCodes_BlockSizeExceeded ErrCodes = 4 + ErrCodes_WrongHash ErrCodes = 5 + ErrCodes_ErrorOffset ErrCodes = 200 ) var ErrCodes_name = map[int32]string{ 0: "Unexpected", 1: "CIDNotFound", 2: "Forbidden", - 3: "SpaceLimitExceed", - 4: "BlockSizeExceed", + 3: "SpaceLimitExceeded", + 4: "BlockSizeExceeded", + 5: "WrongHash", 200: "ErrorOffset", } var ErrCodes_value = map[string]int32{ - "Unexpected": 0, - "CIDNotFound": 1, - "Forbidden": 2, - "SpaceLimitExceed": 3, - "BlockSizeExceed": 4, - "ErrorOffset": 200, + "Unexpected": 0, + "CIDNotFound": 1, + "Forbidden": 2, + "SpaceLimitExceeded": 3, + "BlockSizeExceeded": 4, + "WrongHash": 5, + "ErrorOffset": 200, } func (x ErrCodes) String() string { @@ -1101,57 +1104,58 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 800 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x4e, 0xdb, 0x4a, - 0x14, 0x8e, 0x13, 0xdf, 0x10, 0x9f, 0x10, 0x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b, 0xc2, 0x95, - 0x9b, 0xe7, 0x52, 0x25, 0xae, 0x0a, 0x94, 0x25, 0xae, 0xb8, 0x4d, 0xb3, 0x03, 0x15, 0x0e, 0x92, - 0x3d, 0xec, 0x63, 0x8a, 0x6f, 0xef, 0x01, 0x81, 0xea, 0x78, 0x2e, 0xa9, 0x65, 0x9b, 0x39, 0x56, - 0x99, 0xad, 0xcd, 0x35, 0xa8, 0x4e, 0x17, 0x11, 0xc5, 0xdb, 0x80, 0x62, 0xbc, 0x73, 0x8c, 0x9d, - 0x93, 0xfb, 0xd5, 0x1e, 0x24, 0x0d, 0x8a, 0x1a, 0x42, 0xde, 0x03, 0x40, 0x03, 0x0e, 0xef, 0x7e, - 0xb4, 0x3d, 0xdf, 0x1e, 0x78, 0xbe, 0x47, 0x2f, 0x6a, 0x4a, 0x33, 0xb7, 0x51, 0xdc, 0x5e, 0x6f, - 0x25, 0x83, 0x6d, 0xf1, 0x54, 0x39, 0xc4, 0x5a, 0x90, 0x66, 0xbe, 0x11, 0xca, 0xc8, 0xe0, 0x82, - 0x01, 0x3e, 0x84, 0x3c, 0xa1, 0x36, 0x1d, 0x13, 0x2e, 0xff, 0xca, 0x76, 0x23, 0xe5, 0x91, 0x33, - 0x8f, 0x78, 0x8c, 0x25, 0x62, 0xcd, 0x57, 0xa2, 0x38, 0x69, 0x7b, 0x81, 0x7b, 0xff, 0x19, 0x27, - 0xda, 0xe4, 0x24, 0x6d, 0xaa, 0x89, 0xbe, 0x71, 0x69, 0xa1, 0xfa, 0x63, 0x40, 0x3d, 0xd6, 0xd7, - 0x5d, 0x27, 0x5a, 0x83, 0xa5, 0x98, 0x23, 0x16, 0x5e, 0xb3, 0x92, 0x57, 0xf3, 0x4f, 0xa8, 0x4c, - 0x55, 0x12, 0x04, 0x3d, 0xd0, 0x39, 0xdc, 0x0f, 0x86, 0xe1, 0xef, 0x94, 0xef, 0x42, 0x59, 0xaa, - 0x23, 0x06, 0xfb, 0x3f, 0x68, 0xc3, 0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, 0x86, 0x72, 0x75, 0x6d, 0x28, 0xdf, 0xaf, 0x0d, 0xe5, 0xf3, 0x8d, 0x91, - 0xb9, 0xba, 0x31, 0x32, 0xdf, 0x6e, 0x8c, 0xcc, 0xeb, 0xea, 0xa2, 0xdf, 0x1f, 0x83, 0x3c, 0xff, - 0xf3, 0xe0, 0x47, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x52, 0x41, 0xa3, 0x9e, 0x08, 0x00, 0x00, + // 815 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x4e, 0xf3, 0x46, + 0x14, 0x8d, 0x13, 0x13, 0xe2, 0x1b, 0x02, 0xce, 0x00, 0x69, 0x1a, 0x52, 0x2b, 0xf2, 0xa2, 0x42, + 0xa8, 0x0a, 0x15, 0xed, 0x82, 0x4d, 0x17, 0x24, 0x24, 0x90, 0x52, 0xd1, 0xca, 0xa8, 0x42, 0x6d, + 0x37, 0x75, 0xec, 0x09, 0xb8, 0x18, 0x4f, 0xea, 0x99, 0xb4, 0xd0, 0x47, 0xe8, 0xaa, 0x7d, 0x99, + 0x3e, 0x03, 0x4b, 0x96, 0x5d, 0x56, 0xf0, 0x22, 0xd5, 0x8c, 0xc7, 0xf1, 0xe4, 0xe7, 0x13, 0x7c, + 0x7c, 0x1b, 0x33, 0x3e, 0x73, 0xef, 0x3d, 0x77, 0xce, 0xf5, 0x1c, 0x02, 0x9f, 0x7a, 0xe4, 0xf6, + 0x96, 0x44, 0xa3, 0x20, 0xc4, 0xfb, 0xfc, 0x31, 0x8e, 0x09, 0x23, 0xfb, 0xe2, 0x49, 0x05, 0xd0, + 0x16, 0x6b, 0x54, 0xe2, 0x6b, 0x7a, 0x1f, 0x79, 0xf6, 0x57, 0xb0, 0xd1, 0x09, 0x89, 0x77, 0x73, + 0x82, 0x99, 0x83, 0x7f, 0x9d, 0x60, 0xca, 0x50, 0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, 0x0d, 0x65, 0xc5, + 0x05, 0x51, 0x73, 0x2e, 0x76, 0xc6, 0x60, 0x1b, 0x9f, 0xbc, 0x63, 0x57, 0xd6, 0x3a, 0x01, 0xc8, + 0x5c, 0x03, 0xcd, 0xd3, 0xaa, 0x36, 0xd5, 0x68, 0x2e, 0xdf, 0xcc, 0x9a, 0x52, 0xec, 0x41, 0x6d, + 0x6a, 0xd1, 0x7f, 0xd4, 0xa6, 0x96, 0x78, 0x0a, 0x97, 0x69, 0xea, 0x05, 0xaa, 0x4c, 0xf3, 0x46, + 0xa3, 0xca, 0xb4, 0x68, 0x1e, 0x87, 0xb0, 0x92, 0x08, 0x54, 0xcb, 0xa2, 0x66, 0xa4, 0xf9, 0x68, + 0x01, 0xcf, 0xf8, 0xa7, 0xd7, 0x4a, 0xe5, 0x9f, 0xbf, 0x9a, 0x2a, 0xff, 0xc2, 0x3d, 0xec, 0xb4, + 0x1f, 0x9e, 0x2c, 0xed, 0xf1, 0xc9, 0xd2, 0xfe, 0x7b, 0xb2, 0xb4, 0xbf, 0x9e, 0xad, 0xdc, 0xe3, + 0xb3, 0x95, 0xfb, 0xf7, 0xd9, 0xca, 0xfd, 0xb8, 0xb5, 0xec, 0x37, 0xc9, 0xb0, 0x28, 0xfe, 0x7c, + 0xf1, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xa2, 0xa1, 0x6a, 0xb2, 0x08, 0x00, 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { diff --git a/commonfile/fileproto/fileprotoerr/fileprotoerr.go b/commonfile/fileproto/fileprotoerr/fileprotoerr.go index 1d9bf2d9..972af5e5 100644 --- a/commonfile/fileproto/fileprotoerr/fileprotoerr.go +++ b/commonfile/fileproto/fileprotoerr/fileprotoerr.go @@ -7,10 +7,11 @@ import ( ) var ( - errGroup = rpcerr.ErrGroup(fileproto.ErrCodes_ErrorOffset) - ErrUnexpected = errGroup.Register(fmt.Errorf("unexpected fileproto error"), uint64(fileproto.ErrCodes_Unexpected)) - ErrCIDNotFound = errGroup.Register(fmt.Errorf("CID not found"), uint64(fileproto.ErrCodes_CIDNotFound)) - ErrForbidden = errGroup.Register(fmt.Errorf("forbidden"), uint64(fileproto.ErrCodes_Forbidden)) - ErrSpaceLimitExceed = errGroup.Register(fmt.Errorf("space limit exceed"), uint64(fileproto.ErrCodes_SpaceLimitExceed)) - ErrBlockSizeExceed = errGroup.Register(fmt.Errorf("block size exceed"), uint64(fileproto.ErrCodes_BlockSizeExceed)) + errGroup = rpcerr.ErrGroup(fileproto.ErrCodes_ErrorOffset) + ErrUnexpected = errGroup.Register(fmt.Errorf("unexpected fileproto error"), uint64(fileproto.ErrCodes_Unexpected)) + ErrCIDNotFound = errGroup.Register(fmt.Errorf("CID not found"), uint64(fileproto.ErrCodes_CIDNotFound)) + ErrForbidden = errGroup.Register(fmt.Errorf("forbidden"), uint64(fileproto.ErrCodes_Forbidden)) + ErrSpaceLimitExceeded = errGroup.Register(fmt.Errorf("space limit exceeded"), uint64(fileproto.ErrCodes_SpaceLimitExceeded)) + ErrBlockSizeExceeded = errGroup.Register(fmt.Errorf("block size exceeded"), uint64(fileproto.ErrCodes_BlockSizeExceeded)) + ErrWrongHash = errGroup.Register(fmt.Errorf("wrong block hash"), uint64(fileproto.ErrCodes_WrongHash)) ) diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index 2fe63109..334bf4f6 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -7,8 +7,9 @@ enum ErrCodes { Unexpected = 0; CIDNotFound = 1; Forbidden = 2; - SpaceLimitExceed = 3; - BlockSizeExceed = 4; + SpaceLimitExceeded = 3; + BlockSizeExceeded = 4; + WrongHash = 5; ErrorOffset = 200; } From 207553f63849deace84ef7517b92deae58239f96 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 21 Mar 2023 11:23:52 +0100 Subject: [PATCH 26/30] update fileproto --- commonfile/fileproto/file.pb.go | 111 +++++++++--------- .../fileproto/fileprotoerr/fileprotoerr.go | 2 +- commonfile/fileproto/protos/file.proto | 2 +- 3 files changed, 58 insertions(+), 57 deletions(-) diff --git a/commonfile/fileproto/file.pb.go b/commonfile/fileproto/file.pb.go index dba3f120..a13658fc 100644 --- a/commonfile/fileproto/file.pb.go +++ b/commonfile/fileproto/file.pb.go @@ -29,7 +29,7 @@ const ( ErrCodes_CIDNotFound ErrCodes = 1 ErrCodes_Forbidden ErrCodes = 2 ErrCodes_SpaceLimitExceeded ErrCodes = 3 - ErrCodes_BlockSizeExceeded ErrCodes = 4 + ErrCodes_QuerySizeExceeded ErrCodes = 4 ErrCodes_WrongHash ErrCodes = 5 ErrCodes_ErrorOffset ErrCodes = 200 ) @@ -39,7 +39,7 @@ var ErrCodes_name = map[int32]string{ 1: "CIDNotFound", 2: "Forbidden", 3: "SpaceLimitExceeded", - 4: "BlockSizeExceeded", + 4: "QuerySizeExceeded", 5: "WrongHash", 200: "ErrorOffset", } @@ -49,7 +49,7 @@ var ErrCodes_value = map[string]int32{ "CIDNotFound": 1, "Forbidden": 2, "SpaceLimitExceeded": 3, - "BlockSizeExceeded": 4, + "QuerySizeExceeded": 4, "WrongHash": 5, "ErrorOffset": 200, } @@ -1104,58 +1104,59 @@ func init() { } var fileDescriptor_fd665a7e11c833d5 = []byte{ - // 815 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcd, 0x4e, 0xf3, 0x46, - 0x14, 0x8d, 0x13, 0x13, 0xe2, 0x1b, 0x02, 0xce, 0x00, 0x69, 0x1a, 0x52, 0x2b, 0xf2, 0xa2, 0x42, - 0xa8, 0x0a, 0x15, 0xed, 0x82, 0x4d, 0x17, 0x24, 0x24, 0x90, 0x52, 0xd1, 0xca, 0xa8, 0x42, 0x6d, - 0x37, 0x75, 0xec, 0x09, 0xb8, 0x18, 0x4f, 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xb3, 0x95, 0xfb, 0xf7, 0xd9, 0xca, 0xfd, 0xb8, 0xb5, 0xec, 0x37, 0xc9, 0xb0, 0x28, 0xfe, 0x7c, - 0xf1, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x9f, 0xa2, 0xa1, 0x6a, 0xb2, 0x08, 0x00, 0x00, + // 817 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0x4f, 0x53, 0xfb, 0x44, + 0x18, 0x6e, 0xda, 0xfc, 0x4a, 0xf3, 0x96, 0x42, 0xba, 0x40, 0xad, 0xa5, 0x66, 0x3a, 0x39, 0x38, + 0x0c, 0xe3, 0x14, 0x07, 0x3d, 0x70, 0xf1, 0x40, 0x4b, 0x0b, 0x15, 0x07, 0x35, 0x8c, 0xc3, 0xa8, + 0x17, 0xd3, 0x64, 0x0b, 0x91, 0x90, 0xad, 0xd9, 0xad, 0x52, 0x3f, 0x82, 0x27, 0xfd, 0x32, 0x7e, + 0x06, 0x8e, 0x1c, 0x3d, 0x3a, 0xf0, 0x45, 0x9c, 0xdd, 0x6c, 0x9a, 0xed, 0x1f, 0x07, 0xc4, 0x4b, + 0xd8, 0x3c, 0xfb, 0xbe, 0xef, 0xf3, 0xee, 0xf3, 0x66, 0x1f, 0x0a, 0x1f, 0x7a, 0xe4, 0xee, 0x8e, + 0x44, 0xa3, 0x20, 0xc4, 0x07, 0xfc, 0x31, 0x8e, 0x09, 0x23, 0x07, 0xe2, 0x49, 0x05, 0xd0, 0x16, + 0x6b, 0x54, 0xe2, 0x6b, 0x3a, 0x8d, 0x3c, 0xfb, 0x33, 0xd8, 0xec, 0x84, 0xc4, 0xbb, 0x3d, 0xc5, + 0xcc, 0xc1, 0x3f, 0x4d, 0x30, 0x65, 0xa8, 0x0e, 0x6b, 0x74, 0xec, 0x7a, 0x78, 0xe0, 0xd7, 0xb5, + 0x96, 0xb6, 0x67, 0x38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0x4e, 0x10, 0xf9, 0x6f, 0x9f, 0x71, 0xaa, 0x4d, + 0x41, 0xd1, 0x66, 0x3b, 0xd5, 0x37, 0x29, 0x2d, 0x55, 0x3f, 0x03, 0xd4, 0xe7, 0x7d, 0xbd, 0x76, + 0xa2, 0x75, 0x58, 0x4b, 0x38, 0x12, 0xe1, 0x0d, 0x27, 0x7d, 0xb5, 0x77, 0x60, 0x6b, 0xae, 0x92, + 0x24, 0xe8, 0x83, 0x29, 0xe0, 0x41, 0x34, 0x22, 0xff, 0xa7, 0x7c, 0x0f, 0xaa, 0x4a, 0x1d, 0x39, + 0xd8, 0x8f, 0xc1, 0x18, 0xa5, 0xa0, 0x9c, 0x27, 0xca, 0x74, 0xe6, 0xf1, 0x22, 0x3c, 0x0b, 0xb2, + 0x7f, 0x80, 0x52, 0x0a, 0x2b, 0xea, 0x69, 0x73, 0xea, 0x59, 0x00, 0x13, 0xea, 0x5e, 0xe3, 0xce, + 0x94, 0xe1, 0x64, 0x7c, 0xba, 0xa3, 0x20, 0xa8, 0x09, 0x06, 0x57, 0xb4, 0x4b, 0x26, 0x11, 0x13, + 0xf7, 0xa8, 0xe2, 0x64, 0x80, 0xbd, 0x01, 0xeb, 0xea, 0x17, 0x6c, 0x9f, 0x43, 0x65, 0xfe, 0x6b, + 0x6c, 0x40, 0x49, 0x1e, 0x97, 0x8a, 0x9e, 0x0d, 0x67, 0xf6, 0xce, 0xa9, 0xdd, 0x30, 0x24, 0xbf, + 0x5c, 0xc5, 0x01, 0xc3, 0x82, 0xba, 0xe4, 0x28, 0x88, 0xfd, 0x11, 0x98, 0x97, 0x22, 0xf6, 0x35, + 0x6a, 0xda, 0x7f, 0x68, 0x50, 0x55, 0xc2, 0x25, 0xbf, 0x05, 0x10, 0x06, 0x77, 0x01, 0x4b, 0x8e, + 0xa7, 0x25, 0xc7, 0xcb, 0x90, 0xff, 0x7e, 0x7c, 0x5d, 0x39, 0x3e, 0xcf, 0x16, 0x6a, 0x27, 0xdb, + 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, 0x0c, 0xb6, 0xf1, 0xc1, 0xbf, 0xec, 0xca, 0x5a, + 0xa7, 0x00, 0x99, 0x6b, 0xa0, 0x45, 0x5a, 0xd5, 0xa6, 0x1a, 0xcd, 0xd5, 0x9b, 0x59, 0x53, 0x8a, + 0x3d, 0xa8, 0x4d, 0x2d, 0xfb, 0x8f, 0xda, 0xd4, 0x0a, 0x4f, 0xe1, 0x32, 0xcd, 0xbc, 0x40, 0x95, + 0x69, 0xd1, 0x68, 0x54, 0x99, 0x96, 0xcd, 0xe3, 0x08, 0xde, 0x25, 0x02, 0xd5, 0xb2, 0xa8, 0x39, + 0x69, 0xde, 0x5b, 0xc2, 0x33, 0xfe, 0xd9, 0xb5, 0x52, 0xf9, 0x17, 0xaf, 0xa6, 0xca, 0xbf, 0x74, + 0x0f, 0x3b, 0xed, 0x87, 0x27, 0x4b, 0x7b, 0x7c, 0xb2, 0xb4, 0xbf, 0x9f, 0x2c, 0xed, 0xf7, 0x67, + 0x2b, 0xf7, 0xf8, 0x6c, 0xe5, 0xfe, 0x7a, 0xb6, 0x72, 0xdf, 0x6d, 0xaf, 0xfa, 0x4d, 0x32, 0x2c, + 0x8a, 0x3f, 0x9f, 0xfc, 0x13, 0x00, 0x00, 0xff, 0xff, 0x26, 0x23, 0x7f, 0x83, 0xb2, 0x08, 0x00, + 0x00, } func (m *BlockGetRequest) Marshal() (dAtA []byte, err error) { diff --git a/commonfile/fileproto/fileprotoerr/fileprotoerr.go b/commonfile/fileproto/fileprotoerr/fileprotoerr.go index 972af5e5..5e2bf605 100644 --- a/commonfile/fileproto/fileprotoerr/fileprotoerr.go +++ b/commonfile/fileproto/fileprotoerr/fileprotoerr.go @@ -12,6 +12,6 @@ var ( ErrCIDNotFound = errGroup.Register(fmt.Errorf("CID not found"), uint64(fileproto.ErrCodes_CIDNotFound)) ErrForbidden = errGroup.Register(fmt.Errorf("forbidden"), uint64(fileproto.ErrCodes_Forbidden)) ErrSpaceLimitExceeded = errGroup.Register(fmt.Errorf("space limit exceeded"), uint64(fileproto.ErrCodes_SpaceLimitExceeded)) - ErrBlockSizeExceeded = errGroup.Register(fmt.Errorf("block size exceeded"), uint64(fileproto.ErrCodes_BlockSizeExceeded)) + ErrQuerySizeExceeded = errGroup.Register(fmt.Errorf("query size exceeded"), uint64(fileproto.ErrCodes_QuerySizeExceeded)) ErrWrongHash = errGroup.Register(fmt.Errorf("wrong block hash"), uint64(fileproto.ErrCodes_WrongHash)) ) diff --git a/commonfile/fileproto/protos/file.proto b/commonfile/fileproto/protos/file.proto index 334bf4f6..5ebbb91f 100644 --- a/commonfile/fileproto/protos/file.proto +++ b/commonfile/fileproto/protos/file.proto @@ -8,7 +8,7 @@ enum ErrCodes { CIDNotFound = 1; Forbidden = 2; SpaceLimitExceeded = 3; - BlockSizeExceeded = 4; + QuerySizeExceeded = 4; WrongHash = 5; ErrorOffset = 200; } From 8f4a39ebe9d2fd6d86147da997b33c399dac1d7f Mon Sep 17 00:00:00 2001 From: Roman Khafizianov Date: Tue, 21 Mar 2023 15:27:15 +0100 Subject: [PATCH 27/30] app long start/stop logger --- app/app.go | 79 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 70 insertions(+), 9 deletions(-) diff --git a/app/app.go b/app/app.go index 3655724c..84682f2c 100644 --- a/app/app.go +++ b/app/app.go @@ -20,7 +20,10 @@ var ( ) var ( - log = logger.NewNamed("app") + log = logger.NewNamed("app") + StopDeadline = time.Minute + StopWarningAfter = time.Second * 10 + StartWarningAfter = time.Second * 10 ) // Component is a minimal interface for a common app.Component @@ -53,7 +56,8 @@ type ComponentStatable interface { type App struct { components []Component mu sync.RWMutex - startStat StartStat + startStat Stat + stopStat Stat deviceState int } @@ -67,18 +71,25 @@ func (app *App) Version() string { return GitSummary } -type StartStat struct { +type Stat struct { SpentMsPerComp map[string]int64 SpentMsTotal int64 } -// StartStat returns total time spent per comp -func (app *App) StartStat() StartStat { +// StartStat returns total time spent per comp for the last Start +func (app *App) StartStat() Stat { app.mu.Lock() defer app.mu.Unlock() return app.startStat } +// StopStat returns total time spent per comp for the last Close +func (app *App) StopStat() Stat { + app.mu.Lock() + defer app.mu.Unlock() + return app.stopStat +} + // VersionDescription return the full info about the build func (app *App) VersionDescription() string { return VersionDescription() @@ -158,7 +169,17 @@ func (app *App) Start(ctx context.Context) (err error) { app.mu.RLock() defer app.mu.RUnlock() app.startStat.SpentMsPerComp = make(map[string]int64) - + var currentComponentStarting string + done := make(chan struct{}) + go func() { + select { + case <-done: + return + case <-time.After(StartWarningAfter): + l := statLogger(app.stopStat, log).With(zap.String("in_progress", currentComponentStarting)) + l.Warn("components start in progress") + } + }() closeServices := func(idx int) { for i := idx; i >= 0; i-- { if serviceClose, ok := app.components[i].(ComponentRunnable); ok { @@ -188,7 +209,13 @@ func (app *App) Start(ctx context.Context) (err error) { app.startStat.SpentMsPerComp[s.Name()] = spent } } - log.Debug("all components started") + + close(done) + l := statLogger(app.stopStat, log) + if app.startStat.SpentMsTotal > StartWarningAfter.Milliseconds() { + l.Warn("all components started") + } + l.Debug("all components started") return } @@ -203,18 +230,41 @@ func stackAllGoroutines() []byte { } } +func statLogger(stat Stat, ctxLogger logger.CtxLogger) logger.CtxLogger { + l := ctxLogger + for k, v := range stat.SpentMsPerComp { + l = l.With(zap.Int64(k, v)) + } + l = l.With(zap.Int64("total", stat.SpentMsTotal)) + + return l +} + // Close stops the application // All components with ComponentRunnable implementation will be closed in the reversed order func (app *App) Close(ctx context.Context) error { log.Debug("close components...") app.mu.RLock() defer app.mu.RUnlock() + app.stopStat.SpentMsPerComp = make(map[string]int64) + var currentComponentStopping string done := make(chan struct{}) + go func() { select { case <-done: return - case <-time.After(time.Minute): + case <-time.After(StopWarningAfter): + statLogger(app.stopStat, log). + With(zap.String("in_progress", currentComponentStopping)). + Warn("components close in progress") + } + }() + go func() { + select { + case <-done: + return + case <-time.After(StopDeadline): _, _ = os.Stderr.Write([]byte("app.Close timeout\n")) _, _ = os.Stderr.Write(stackAllGoroutines()) panic("app.Close timeout") @@ -224,16 +274,27 @@ func (app *App) Close(ctx context.Context) error { var errs []string for i := len(app.components) - 1; i >= 0; i-- { if serviceClose, ok := app.components[i].(ComponentRunnable); ok { + start := time.Now() + currentComponentStopping = app.components[i].Name() if e := serviceClose.Close(ctx); e != nil { errs = append(errs, fmt.Sprintf("Component '%s' close error: %v", serviceClose.Name(), e)) } + spent := time.Since(start).Milliseconds() + app.stopStat.SpentMsTotal += spent + app.stopStat.SpentMsPerComp[app.components[i].Name()] = spent } } close(done) if len(errs) > 0 { return errors.New(strings.Join(errs, "\n")) } - log.Debug("all components have been closed") + + l := statLogger(app.stopStat, log) + if app.stopStat.SpentMsTotal > StopWarningAfter.Milliseconds() { + l.Warn("all components have been closed") + } + + l.Debug("all components have been closed") return nil } From f34bc4061bbae40c7ab87015e3bd5b63de973893 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 21 Mar 2023 18:24:29 +0100 Subject: [PATCH 28/30] increase ipfs chunk size --- commonfile/fileservice/fileservice.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commonfile/fileservice/fileservice.go b/commonfile/fileservice/fileservice.go index fabc70c3..5aa23094 100644 --- a/commonfile/fileservice/fileservice.go +++ b/commonfile/fileservice/fileservice.go @@ -22,6 +22,10 @@ const CName = "common.commonfile.fileservice" var log = logger.NewNamed(CName) +const ( + chunkSize = 1 << 20 +) + func New() FileService { return &fileService{} } @@ -74,7 +78,7 @@ func (fs *fileService) AddFile(ctx context.Context, r io.Reader) (ipld.Node, err Maxlinks: helpers.DefaultLinksPerBlock, CidBuilder: &fs.prefix, } - dbh, err := dbp.New(chunker.DefaultSplitter(r)) + dbh, err := dbp.New(chunker.NewSizeSplitter(r, chunkSize)) if err != nil { return nil, err } From fa24020ab12c505757cdbe28613f93da6d675793 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 21 Mar 2023 18:28:45 +0100 Subject: [PATCH 29/30] make chunk size public --- commonfile/fileservice/fileservice.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commonfile/fileservice/fileservice.go b/commonfile/fileservice/fileservice.go index 5aa23094..c938ac08 100644 --- a/commonfile/fileservice/fileservice.go +++ b/commonfile/fileservice/fileservice.go @@ -23,7 +23,7 @@ const CName = "common.commonfile.fileservice" var log = logger.NewNamed(CName) const ( - chunkSize = 1 << 20 + ChunkSize = 1 << 20 ) func New() FileService { @@ -78,7 +78,7 @@ func (fs *fileService) AddFile(ctx context.Context, r io.Reader) (ipld.Node, err Maxlinks: helpers.DefaultLinksPerBlock, CidBuilder: &fs.prefix, } - dbh, err := dbp.New(chunker.NewSizeSplitter(r, chunkSize)) + dbh, err := dbp.New(chunker.NewSizeSplitter(r, ChunkSize)) if err != nil { return nil, err } From 18240ea5ef88812dcf362366cacc9c3db7137a22 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Wed, 22 Mar 2023 18:51:01 +0100 Subject: [PATCH 30/30] Update aclrecordproto --- .../object/acl/aclrecordproto/aclrecord.pb.go | 617 +++++------------- .../acl/aclrecordproto/protos/aclrecord.proto | 33 +- .../treechangeproto/protos/treechange.proto | 4 +- .../tree/treechangeproto/treechange.pb.go | 133 ++-- 4 files changed, 255 insertions(+), 532 deletions(-) diff --git a/commonspace/object/acl/aclrecordproto/aclrecord.pb.go b/commonspace/object/acl/aclrecordproto/aclrecord.pb.go index 3a25533b..c77e7818 100644 --- a/commonspace/object/acl/aclrecordproto/aclrecord.pb.go +++ b/commonspace/object/acl/aclrecordproto/aclrecord.pb.go @@ -171,11 +171,11 @@ func (m *RawAclRecordWithId) GetId() string { } type AclRecord struct { - PrevId string `protobuf:"bytes,1,opt,name=prevId,proto3" json:"prevId,omitempty"` - Identity []byte `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` - CurrentReadKeyHash uint64 `protobuf:"varint,4,opt,name=currentReadKeyHash,proto3" json:"currentReadKeyHash,omitempty"` - Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + PrevId string `protobuf:"bytes,1,opt,name=prevId,proto3" json:"prevId,omitempty"` + Identity []byte `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` + ReadKeyId string `protobuf:"bytes,4,opt,name=readKeyId,proto3" json:"readKeyId,omitempty"` + Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } func (m *AclRecord) Reset() { *m = AclRecord{} } @@ -232,11 +232,11 @@ func (m *AclRecord) GetData() []byte { return nil } -func (m *AclRecord) GetCurrentReadKeyHash() uint64 { +func (m *AclRecord) GetReadKeyId() string { if m != nil { - return m.CurrentReadKeyHash + return m.ReadKeyId } - return 0 + return "" } func (m *AclRecord) GetTimestamp() int64 { @@ -248,12 +248,11 @@ func (m *AclRecord) GetTimestamp() int64 { type AclRoot struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` - SpaceId string `protobuf:"bytes,3,opt,name=spaceId,proto3" json:"spaceId,omitempty"` - EncryptedReadKey []byte `protobuf:"bytes,4,opt,name=encryptedReadKey,proto3" json:"encryptedReadKey,omitempty"` - DerivationScheme string `protobuf:"bytes,5,opt,name=derivationScheme,proto3" json:"derivationScheme,omitempty"` - CurrentReadKeyHash uint64 `protobuf:"varint,6,opt,name=currentReadKeyHash,proto3" json:"currentReadKeyHash,omitempty"` - Timestamp int64 `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` + SpaceId string `protobuf:"bytes,2,opt,name=spaceId,proto3" json:"spaceId,omitempty"` + EncryptedReadKey []byte `protobuf:"bytes,3,opt,name=encryptedReadKey,proto3" json:"encryptedReadKey,omitempty"` + DerivationScheme string `protobuf:"bytes,4,opt,name=derivationScheme,proto3" json:"derivationScheme,omitempty"` + CurrentReadKeyHash uint64 `protobuf:"varint,5,opt,name=currentReadKeyHash,proto3" json:"currentReadKeyHash,omitempty"` + Timestamp int64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` } func (m *AclRoot) Reset() { *m = AclRoot{} } @@ -296,13 +295,6 @@ func (m *AclRoot) GetIdentity() []byte { return nil } -func (m *AclRoot) GetEncryptionKey() []byte { - if m != nil { - return m.EncryptionKey - } - return nil -} - func (m *AclRoot) GetSpaceId() string { if m != nil { return m.SpaceId @@ -508,9 +500,9 @@ func (m *AclData) GetAclContent() []*AclContentValue { } type AclState struct { - ReadKeyHashes []uint64 `protobuf:"varint,1,rep,packed,name=readKeyHashes,proto3" json:"readKeyHashes,omitempty"` - UserStates []*AclUserState `protobuf:"bytes,2,rep,name=userStates,proto3" json:"userStates,omitempty"` - Invites map[string]*AclUserInvite `protobuf:"bytes,3,rep,name=invites,proto3" json:"invites,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + ReadKeyIds []string `protobuf:"bytes,1,rep,name=readKeyIds,proto3" json:"readKeyIds,omitempty"` + UserStates []*AclUserState `protobuf:"bytes,2,rep,name=userStates,proto3" json:"userStates,omitempty"` + Invites map[string]*AclUserInvite `protobuf:"bytes,3,rep,name=invites,proto3" json:"invites,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` } func (m *AclState) Reset() { *m = AclState{} } @@ -546,9 +538,9 @@ func (m *AclState) XXX_DiscardUnknown() { var xxx_messageInfo_AclState proto.InternalMessageInfo -func (m *AclState) GetReadKeyHashes() []uint64 { +func (m *AclState) GetReadKeyIds() []string { if m != nil { - return m.ReadKeyHashes + return m.ReadKeyIds } return nil } @@ -568,9 +560,8 @@ func (m *AclState) GetInvites() map[string]*AclUserInvite { } type AclUserState struct { - Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` - Permissions AclUserPermissions `protobuf:"varint,3,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` + Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` + Permissions AclUserPermissions `protobuf:"varint,2,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` } func (m *AclUserState) Reset() { *m = AclUserState{} } @@ -613,13 +604,6 @@ func (m *AclUserState) GetIdentity() []byte { return nil } -func (m *AclUserState) GetEncryptionKey() []byte { - if m != nil { - return m.EncryptionKey - } - return nil -} - func (m *AclUserState) GetPermissions() AclUserPermissions { if m != nil { return m.Permissions @@ -629,9 +613,8 @@ func (m *AclUserState) GetPermissions() AclUserPermissions { type AclUserAdd struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` - EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` - Permissions AclUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` + EncryptedReadKeys [][]byte `protobuf:"bytes,2,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` + Permissions AclUserPermissions `protobuf:"varint,3,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` } func (m *AclUserAdd) Reset() { *m = AclUserAdd{} } @@ -674,13 +657,6 @@ func (m *AclUserAdd) GetIdentity() []byte { return nil } -func (m *AclUserAdd) GetEncryptionKey() []byte { - if m != nil { - return m.EncryptionKey - } - return nil -} - func (m *AclUserAdd) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys @@ -697,9 +673,8 @@ func (m *AclUserAdd) GetPermissions() AclUserPermissions { type AclUserInvite struct { AcceptPublicKey []byte `protobuf:"bytes,1,opt,name=acceptPublicKey,proto3" json:"acceptPublicKey,omitempty"` - EncryptSymKeyHash uint64 `protobuf:"varint,2,opt,name=encryptSymKeyHash,proto3" json:"encryptSymKeyHash,omitempty"` - EncryptedReadKeys [][]byte `protobuf:"bytes,3,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` - Permissions AclUserPermissions `protobuf:"varint,4,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` + EncryptedReadKeys [][]byte `protobuf:"bytes,2,rep,name=encryptedReadKeys,proto3" json:"encryptedReadKeys,omitempty"` + Permissions AclUserPermissions `protobuf:"varint,3,opt,name=permissions,proto3,enum=aclrecord.AclUserPermissions" json:"permissions,omitempty"` } func (m *AclUserInvite) Reset() { *m = AclUserInvite{} } @@ -742,13 +717,6 @@ func (m *AclUserInvite) GetAcceptPublicKey() []byte { return nil } -func (m *AclUserInvite) GetEncryptSymKeyHash() uint64 { - if m != nil { - return m.EncryptSymKeyHash - } - return 0 -} - func (m *AclUserInvite) GetEncryptedReadKeys() [][]byte { if m != nil { return m.EncryptedReadKeys @@ -893,8 +861,7 @@ func (m *AclUserRemove) GetReadKeyReplaces() []*AclReadKeyReplace { type AclReadKeyReplace struct { Identity []byte `protobuf:"bytes,1,opt,name=identity,proto3" json:"identity,omitempty"` - EncryptionKey []byte `protobuf:"bytes,2,opt,name=encryptionKey,proto3" json:"encryptionKey,omitempty"` - EncryptedReadKey []byte `protobuf:"bytes,3,opt,name=encryptedReadKey,proto3" json:"encryptedReadKey,omitempty"` + EncryptedReadKey []byte `protobuf:"bytes,2,opt,name=encryptedReadKey,proto3" json:"encryptedReadKey,omitempty"` } func (m *AclReadKeyReplace) Reset() { *m = AclReadKeyReplace{} } @@ -937,13 +904,6 @@ func (m *AclReadKeyReplace) GetIdentity() []byte { return nil } -func (m *AclReadKeyReplace) GetEncryptionKey() []byte { - if m != nil { - return m.EncryptionKey - } - return nil -} - func (m *AclReadKeyReplace) GetEncryptedReadKey() []byte { if m != nil { return m.EncryptedReadKey @@ -1004,7 +964,7 @@ func (m *AclUserPermissionChange) GetPermissions() AclUserPermissions { } type AclSyncMessage struct { - Content *AclSyncContentValue `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"` + Content *AclSyncContentValue `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"` } func (m *AclSyncMessage) Reset() { *m = AclSyncMessage{} } @@ -1192,68 +1152,66 @@ func init() { } var fileDescriptor_c8e9f754f34e929b = []byte{ - // 962 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcf, 0x6f, 0x1b, 0xc5, - 0x17, 0xf7, 0xac, 0x9d, 0x38, 0x7e, 0x76, 0x13, 0x67, 0xbe, 0x5f, 0x5a, 0x2b, 0x2a, 0x56, 0xb4, - 0x02, 0x29, 0xaa, 0x2a, 0x47, 0x18, 0xa4, 0x54, 0x11, 0xa2, 0x72, 0x4b, 0x91, 0xdd, 0x08, 0xa9, - 0x9a, 0x00, 0x45, 0xbd, 0x4d, 0x66, 0x47, 0xc9, 0xc2, 0xfe, 0xd2, 0xcc, 0xd8, 0x68, 0x8f, 0x9c, - 0xb9, 0xc0, 0x7f, 0x00, 0x7f, 0x08, 0x77, 0x24, 0x2e, 0xbd, 0x80, 0x38, 0xa2, 0xe4, 0xcf, 0xe0, - 0x82, 0x66, 0xf6, 0xf7, 0xae, 0x13, 0xb5, 0x52, 0xc4, 0x21, 0xc9, 0xcc, 0x7b, 0x9f, 0x37, 0xf9, - 0xbc, 0xcf, 0x7b, 0xf3, 0x66, 0xe1, 0x63, 0x16, 0xfa, 0x7e, 0x18, 0xc8, 0x88, 0x32, 0x7e, 0x18, - 0x9e, 0x7d, 0xc3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xc0, 0x71, 0x92, 0x8f, - 0x23, 0x99, 0x3e, 0xad, 0xb5, 0x39, 0x38, 0xcb, 0xfd, 0xfa, 0x39, 0x2a, 0xd0, 0xc5, 0xc3, 0x32, - 0x37, 0x8d, 0x51, 0xe0, 0xf0, 0x11, 0x74, 0x45, 0x7e, 0xa4, 0x2e, 0x7a, 0x39, 0xeb, 0xe6, 0xd7, - 0x1c, 0xc9, 0xd0, 0x0f, 0x8e, 0x00, 0x37, 0x45, 0xc1, 0x3d, 0xd8, 0x98, 0x39, 0xbe, 0x1b, 0x0c, - 0x5b, 0x18, 0x60, 0xf3, 0xa5, 0x70, 0x15, 0x17, 0x43, 0xa4, 0xd7, 0xba, 0x42, 0x5c, 0x0c, 0xad, - 0x27, 0x8f, 0x7f, 0xbb, 0x1c, 0xa3, 0xd7, 0x97, 0x63, 0xf4, 0xf7, 0xe5, 0x18, 0xfd, 0x78, 0x35, - 0x6e, 0xbd, 0xbe, 0x1a, 0xb7, 0xfe, 0xba, 0x1a, 0xb7, 0x5e, 0xbd, 0xff, 0x46, 0xdf, 0xca, 0x67, - 0x9b, 0xe6, 0xcf, 0x87, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x3e, 0xd9, 0x79, 0xd5, 0x5b, 0x0b, - 0x00, 0x00, + // 943 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xf7, 0xda, 0x49, 0x1c, 0x3f, 0xbb, 0x89, 0x33, 0x40, 0xbb, 0x8a, 0x8a, 0x15, 0xad, 0x40, + 0x8a, 0xaa, 0xca, 0x11, 0x06, 0x29, 0x55, 0x84, 0xa8, 0xdc, 0x52, 0x64, 0xb7, 0x42, 0xaa, 0x26, + 0x40, 0x51, 0x39, 0x4d, 0x66, 0x47, 0xf1, 0xd0, 0xf5, 0xee, 0x6a, 0x66, 0x6c, 0x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d3, 0x13, 0x64, 0x15, 0xd2, 0xcf, 0x99, 0x94, 0xe4, 0x92, + 0xa1, 0x47, 0xd0, 0xa6, 0xd9, 0x30, 0xd4, 0x13, 0x61, 0x50, 0x99, 0x36, 0xab, 0x90, 0x96, 0x06, + 0x62, 0x0a, 0xf7, 0x5e, 0xc3, 0x5b, 0x6b, 0xfc, 0x66, 0xc0, 0xfa, 0xbe, 0xfd, 0x78, 0x90, 0x49, + 0xce, 0xca, 0x94, 0x19, 0x67, 0x7e, 0x3d, 0xe6, 0x73, 0x74, 0x3e, 0xb0, 0x27, 0xe6, 0xc4, 0x73, + 0x1c, 0x3a, 0x85, 0xb6, 0xc8, 0x52, 0xea, 0xd3, 0x2c, 0x56, 0x5d, 0xff, 0xda, 0xc1, 0x29, 0xfa, + 0xc1, 0x29, 0xa0, 0xba, 0x28, 0xa8, 0x03, 0xdb, 0x63, 0x7f, 0xce, 0xc3, 0x7e, 0x03, 0x01, 0xec, + 0xbc, 0x12, 0x5c, 0x31, 0xd1, 0x77, 0xf4, 0xb3, 0x3e, 0x21, 0x26, 0xfa, 0xcd, 0x27, 0x8f, 0x7f, + 0xb9, 0x1e, 0x38, 0x57, 0xd7, 0x03, 0xe7, 0x8f, 0xeb, 0x81, 0xf3, 0xc3, 0xcd, 0xa0, 0x71, 0x75, + 0x33, 0x68, 0xfc, 0x7e, 0x33, 0x68, 0xbc, 0x7e, 0xff, 0x1f, 0x7d, 0x4b, 0x5e, 0xec, 0x98, 0x9f, + 0x0f, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xca, 0x88, 0xea, 0x1c, 0x7b, 0x0a, 0x00, 0x00, } func (m *RawAclRecord) Marshal() (dAtA []byte, err error) { @@ -1369,10 +1327,12 @@ func (m *AclRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x28 } - if m.CurrentReadKeyHash != 0 { - i = encodeVarintAclrecord(dAtA, i, uint64(m.CurrentReadKeyHash)) + if len(m.ReadKeyId) > 0 { + i -= len(m.ReadKeyId) + copy(dAtA[i:], m.ReadKeyId) + i = encodeVarintAclrecord(dAtA, i, uint64(len(m.ReadKeyId))) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x22 } if len(m.Data) > 0 { i -= len(m.Data) @@ -1421,39 +1381,32 @@ func (m *AclRoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.Timestamp != 0 { i = encodeVarintAclrecord(dAtA, i, uint64(m.Timestamp)) i-- - dAtA[i] = 0x38 + dAtA[i] = 0x30 } if m.CurrentReadKeyHash != 0 { i = encodeVarintAclrecord(dAtA, i, uint64(m.CurrentReadKeyHash)) i-- - dAtA[i] = 0x30 + dAtA[i] = 0x28 } if len(m.DerivationScheme) > 0 { i -= len(m.DerivationScheme) copy(dAtA[i:], m.DerivationScheme) i = encodeVarintAclrecord(dAtA, i, uint64(len(m.DerivationScheme))) i-- - dAtA[i] = 0x2a + dAtA[i] = 0x22 } if len(m.EncryptedReadKey) > 0 { i -= len(m.EncryptedReadKey) copy(dAtA[i:], m.EncryptedReadKey) i = encodeVarintAclrecord(dAtA, i, uint64(len(m.EncryptedReadKey))) i-- - dAtA[i] = 0x22 + dAtA[i] = 0x1a } if len(m.SpaceId) > 0 { i -= len(m.SpaceId) copy(dAtA[i:], m.SpaceId) i = encodeVarintAclrecord(dAtA, i, uint64(len(m.SpaceId))) i-- - dAtA[i] = 0x1a - } - if len(m.EncryptionKey) > 0 { - i -= len(m.EncryptionKey) - copy(dAtA[i:], m.EncryptionKey) - i = encodeVarintAclrecord(dAtA, i, uint64(len(m.EncryptionKey))) - i-- dAtA[i] = 0x12 } if len(m.Identity) > 0 { @@ -1700,23 +1653,14 @@ func (m *AclState) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x12 } } - if len(m.ReadKeyHashes) > 0 { - dAtA8 := make([]byte, len(m.ReadKeyHashes)*10) - var j7 int - for _, num := range m.ReadKeyHashes { - for num >= 1<<7 { - dAtA8[j7] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j7++ - } - dAtA8[j7] = uint8(num) - j7++ + if len(m.ReadKeyIds) > 0 { + for iNdEx := len(m.ReadKeyIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ReadKeyIds[iNdEx]) + copy(dAtA[i:], m.ReadKeyIds[iNdEx]) + i = encodeVarintAclrecord(dAtA, i, uint64(len(m.ReadKeyIds[iNdEx]))) + i-- + dAtA[i] = 0xa } - i -= j7 - copy(dAtA[i:], dAtA8[:j7]) - i = encodeVarintAclrecord(dAtA, i, uint64(j7)) - i-- - dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -1744,14 +1688,7 @@ func (m *AclUserState) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.Permissions != 0 { i = encodeVarintAclrecord(dAtA, i, uint64(m.Permissions)) i-- - dAtA[i] = 0x18 - } - if len(m.EncryptionKey) > 0 { - i -= len(m.EncryptionKey) - copy(dAtA[i:], m.EncryptionKey) - i = encodeVarintAclrecord(dAtA, i, uint64(len(m.EncryptionKey))) - i-- - dAtA[i] = 0x12 + dAtA[i] = 0x10 } if len(m.Identity) > 0 { i -= len(m.Identity) @@ -1786,7 +1723,7 @@ func (m *AclUserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.Permissions != 0 { i = encodeVarintAclrecord(dAtA, i, uint64(m.Permissions)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 } if len(m.EncryptedReadKeys) > 0 { for iNdEx := len(m.EncryptedReadKeys) - 1; iNdEx >= 0; iNdEx-- { @@ -1794,16 +1731,9 @@ func (m *AclUserAdd) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.EncryptedReadKeys[iNdEx]) i = encodeVarintAclrecord(dAtA, i, uint64(len(m.EncryptedReadKeys[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } } - if len(m.EncryptionKey) > 0 { - i -= len(m.EncryptionKey) - copy(dAtA[i:], m.EncryptionKey) - i = encodeVarintAclrecord(dAtA, i, uint64(len(m.EncryptionKey))) - i-- - dAtA[i] = 0x12 - } if len(m.Identity) > 0 { i -= len(m.Identity) copy(dAtA[i:], m.Identity) @@ -1837,7 +1767,7 @@ func (m *AclUserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.Permissions != 0 { i = encodeVarintAclrecord(dAtA, i, uint64(m.Permissions)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x18 } if len(m.EncryptedReadKeys) > 0 { for iNdEx := len(m.EncryptedReadKeys) - 1; iNdEx >= 0; iNdEx-- { @@ -1845,14 +1775,9 @@ func (m *AclUserInvite) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.EncryptedReadKeys[iNdEx]) i = encodeVarintAclrecord(dAtA, i, uint64(len(m.EncryptedReadKeys[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0x12 } } - if m.EncryptSymKeyHash != 0 { - i = encodeVarintAclrecord(dAtA, i, uint64(m.EncryptSymKeyHash)) - i-- - dAtA[i] = 0x10 - } if len(m.AcceptPublicKey) > 0 { i -= len(m.AcceptPublicKey) copy(dAtA[i:], m.AcceptPublicKey) @@ -1992,13 +1917,6 @@ func (m *AclReadKeyReplace) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.EncryptedReadKey) i = encodeVarintAclrecord(dAtA, i, uint64(len(m.EncryptedReadKey))) i-- - dAtA[i] = 0x1a - } - if len(m.EncryptionKey) > 0 { - i -= len(m.EncryptionKey) - copy(dAtA[i:], m.EncryptionKey) - i = encodeVarintAclrecord(dAtA, i, uint64(len(m.EncryptionKey))) - i-- dAtA[i] = 0x12 } if len(m.Identity) > 0 { @@ -2076,7 +1994,7 @@ func (m *AclSyncMessage) MarshalToSizedBuffer(dAtA []byte) (int, error) { i = encodeVarintAclrecord(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x12 + dAtA[i] = 0xa } return len(dAtA) - i, nil } @@ -2242,8 +2160,9 @@ func (m *AclRecord) Size() (n int) { if l > 0 { n += 1 + l + sovAclrecord(uint64(l)) } - if m.CurrentReadKeyHash != 0 { - n += 1 + sovAclrecord(uint64(m.CurrentReadKeyHash)) + l = len(m.ReadKeyId) + if l > 0 { + n += 1 + l + sovAclrecord(uint64(l)) } if m.Timestamp != 0 { n += 1 + sovAclrecord(uint64(m.Timestamp)) @@ -2261,10 +2180,6 @@ func (m *AclRoot) Size() (n int) { if l > 0 { n += 1 + l + sovAclrecord(uint64(l)) } - l = len(m.EncryptionKey) - if l > 0 { - n += 1 + l + sovAclrecord(uint64(l)) - } l = len(m.SpaceId) if l > 0 { n += 1 + l + sovAclrecord(uint64(l)) @@ -2379,12 +2294,11 @@ func (m *AclState) Size() (n int) { } var l int _ = l - if len(m.ReadKeyHashes) > 0 { - l = 0 - for _, e := range m.ReadKeyHashes { - l += sovAclrecord(uint64(e)) + if len(m.ReadKeyIds) > 0 { + for _, s := range m.ReadKeyIds { + l = len(s) + n += 1 + l + sovAclrecord(uint64(l)) } - n += 1 + sovAclrecord(uint64(l)) + l } if len(m.UserStates) > 0 { for _, e := range m.UserStates { @@ -2418,10 +2332,6 @@ func (m *AclUserState) Size() (n int) { if l > 0 { n += 1 + l + sovAclrecord(uint64(l)) } - l = len(m.EncryptionKey) - if l > 0 { - n += 1 + l + sovAclrecord(uint64(l)) - } if m.Permissions != 0 { n += 1 + sovAclrecord(uint64(m.Permissions)) } @@ -2438,10 +2348,6 @@ func (m *AclUserAdd) Size() (n int) { if l > 0 { n += 1 + l + sovAclrecord(uint64(l)) } - l = len(m.EncryptionKey) - if l > 0 { - n += 1 + l + sovAclrecord(uint64(l)) - } if len(m.EncryptedReadKeys) > 0 { for _, b := range m.EncryptedReadKeys { l = len(b) @@ -2464,9 +2370,6 @@ func (m *AclUserInvite) Size() (n int) { if l > 0 { n += 1 + l + sovAclrecord(uint64(l)) } - if m.EncryptSymKeyHash != 0 { - n += 1 + sovAclrecord(uint64(m.EncryptSymKeyHash)) - } if len(m.EncryptedReadKeys) > 0 { for _, b := range m.EncryptedReadKeys { l = len(b) @@ -2539,10 +2442,6 @@ func (m *AclReadKeyReplace) Size() (n int) { if l > 0 { n += 1 + l + sovAclrecord(uint64(l)) } - l = len(m.EncryptionKey) - if l > 0 { - n += 1 + l + sovAclrecord(uint64(l)) - } l = len(m.EncryptedReadKey) if l > 0 { n += 1 + l + sovAclrecord(uint64(l)) @@ -3056,10 +2955,10 @@ func (m *AclRecord) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentReadKeyHash", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadKeyId", wireType) } - m.CurrentReadKeyHash = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAclrecord @@ -3069,11 +2968,24 @@ func (m *AclRecord) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CurrentReadKeyHash |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAclrecord + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAclrecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReadKeyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) @@ -3178,40 +3090,6 @@ func (m *AclRoot) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclrecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAclrecord - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAclrecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EncryptionKey = append(m.EncryptionKey[:0], dAtA[iNdEx:postIndex]...) - if m.EncryptionKey == nil { - m.EncryptionKey = []byte{} - } - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field SpaceId", wireType) } @@ -3243,7 +3121,7 @@ func (m *AclRoot) Unmarshal(dAtA []byte) error { } m.SpaceId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EncryptedReadKey", wireType) } @@ -3277,7 +3155,7 @@ func (m *AclRoot) Unmarshal(dAtA []byte) error { m.EncryptedReadKey = []byte{} } iNdEx = postIndex - case 5: + case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field DerivationScheme", wireType) } @@ -3309,7 +3187,7 @@ func (m *AclRoot) Unmarshal(dAtA []byte) error { } m.DerivationScheme = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 6: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field CurrentReadKeyHash", wireType) } @@ -3328,7 +3206,7 @@ func (m *AclRoot) Unmarshal(dAtA []byte) error { break } } - case 7: + case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) } @@ -3707,81 +3585,37 @@ func (m *AclState) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: - if wireType == 0 { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclrecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadKeyIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAclrecord } - m.ReadKeyHashes = append(m.ReadKeyHashes, v) - } else if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclrecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthAclrecord - } - postIndex := iNdEx + packedLen - if postIndex < 0 { - return ErrInvalidLengthAclrecord - } - if postIndex > l { + if iNdEx >= l { return io.ErrUnexpectedEOF } - var elementCount int - var count int - for _, integer := range dAtA[iNdEx:postIndex] { - if integer < 128 { - count++ - } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break } - elementCount = count - if elementCount != 0 && len(m.ReadKeyHashes) == 0 { - m.ReadKeyHashes = make([]uint64, 0, elementCount) - } - for iNdEx < postIndex { - var v uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclrecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ReadKeyHashes = append(m.ReadKeyHashes, v) - } - } else { - return fmt.Errorf("proto: wrong wireType = %d for field ReadKeyHashes", wireType) } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAclrecord + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAclrecord + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReadKeyIds = append(m.ReadKeyIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field UserStates", wireType) @@ -4030,40 +3864,6 @@ func (m *AclUserState) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclrecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAclrecord - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAclrecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EncryptionKey = append(m.EncryptionKey[:0], dAtA[iNdEx:postIndex]...) - if m.EncryptionKey == nil { - m.EncryptionKey = []byte{} - } - iNdEx = postIndex - case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } @@ -4167,40 +3967,6 @@ func (m *AclUserAdd) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclrecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAclrecord - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAclrecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EncryptionKey = append(m.EncryptionKey[:0], dAtA[iNdEx:postIndex]...) - if m.EncryptionKey == nil { - m.EncryptionKey = []byte{} - } - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EncryptedReadKeys", wireType) } @@ -4232,7 +3998,7 @@ func (m *AclUserAdd) Unmarshal(dAtA []byte) error { m.EncryptedReadKeys = append(m.EncryptedReadKeys, make([]byte, postIndex-iNdEx)) copy(m.EncryptedReadKeys[len(m.EncryptedReadKeys)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } @@ -4336,25 +4102,6 @@ func (m *AclUserInvite) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptSymKeyHash", wireType) - } - m.EncryptSymKeyHash = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclrecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.EncryptSymKeyHash |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EncryptedReadKeys", wireType) } @@ -4386,7 +4133,7 @@ func (m *AclUserInvite) Unmarshal(dAtA []byte) error { m.EncryptedReadKeys = append(m.EncryptedReadKeys, make([]byte, postIndex-iNdEx)) copy(m.EncryptedReadKeys[len(m.EncryptedReadKeys)-1], dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 4: + case 3: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Permissions", wireType) } @@ -4826,40 +4573,6 @@ func (m *AclReadKeyReplace) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field EncryptionKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowAclrecord - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthAclrecord - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthAclrecord - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.EncryptionKey = append(m.EncryptionKey[:0], dAtA[iNdEx:postIndex]...) - if m.EncryptionKey == nil { - m.EncryptionKey = []byte{} - } - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field EncryptedReadKey", wireType) } @@ -5046,7 +4759,7 @@ func (m *AclSyncMessage) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: AclSyncMessage: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { - case 2: + case 1: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Content", wireType) } diff --git a/commonspace/object/acl/aclrecordproto/protos/aclrecord.proto b/commonspace/object/acl/aclrecordproto/protos/aclrecord.proto index 56cc2c28..f13ea819 100644 --- a/commonspace/object/acl/aclrecordproto/protos/aclrecord.proto +++ b/commonspace/object/acl/aclrecordproto/protos/aclrecord.proto @@ -18,18 +18,17 @@ message AclRecord { string prevId = 1; bytes identity = 2; bytes data = 3; - uint64 currentReadKeyHash = 4; + string readKeyId = 4; int64 timestamp = 5; } message AclRoot { bytes identity = 1; - bytes encryptionKey = 2; - string spaceId = 3; - bytes encryptedReadKey = 4; - string derivationScheme = 5; - uint64 currentReadKeyHash = 6; - int64 timestamp = 7; + string spaceId = 2; + bytes encryptedReadKey = 3; + string derivationScheme = 4; + uint64 currentReadKeyHash = 5; + int64 timestamp = 6; } message AclContentValue { @@ -47,29 +46,26 @@ message AclData { } message AclState { - repeated uint64 readKeyHashes = 1; + repeated string readKeyIds = 1; repeated AclUserState userStates = 2; map invites = 3; } message AclUserState { bytes identity = 1; - bytes encryptionKey = 2; - AclUserPermissions permissions = 3; + AclUserPermissions permissions = 2; } message AclUserAdd { bytes identity = 1; - bytes encryptionKey = 2; - repeated bytes encryptedReadKeys = 3; - AclUserPermissions permissions = 4; + repeated bytes encryptedReadKeys = 2; + AclUserPermissions permissions = 3; } message AclUserInvite { bytes acceptPublicKey = 1; - uint64 encryptSymKeyHash = 2; - repeated bytes encryptedReadKeys = 3; - AclUserPermissions permissions = 4; + repeated bytes encryptedReadKeys = 2; + AclUserPermissions permissions = 3; } message AclUserJoin { @@ -87,8 +83,7 @@ message AclUserRemove { message AclReadKeyReplace { bytes identity = 1; - bytes encryptionKey = 2; - bytes encryptedReadKey = 3; + bytes encryptedReadKey = 2; } message AclUserPermissionChange { @@ -103,7 +98,7 @@ enum AclUserPermissions { } message AclSyncMessage { - AclSyncContentValue content = 2; + AclSyncContentValue content = 1; } // AclSyncContentValue provides different types for acl sync diff --git a/commonspace/object/tree/treechangeproto/protos/treechange.proto b/commonspace/object/tree/treechangeproto/protos/treechange.proto index 2211f58f..dfc74a42 100644 --- a/commonspace/object/tree/treechangeproto/protos/treechange.proto +++ b/commonspace/object/tree/treechangeproto/protos/treechange.proto @@ -30,8 +30,8 @@ message TreeChange { string snapshotBaseId = 3; // ChangesData is an arbitrary payload to be read by the client bytes changesData = 4; - // CurrentReadKeyHash is the hash of the read key which is used to encrypt this change - uint64 currentReadKeyHash = 5; + // ReadKeyId is the id of the read key + string readKeyId = 5; // Timestamp is this change creation timestamp int64 timestamp = 6; // Identity is a public key with which the raw payload of this change is signed diff --git a/commonspace/object/tree/treechangeproto/treechange.pb.go b/commonspace/object/tree/treechangeproto/treechange.pb.go index da70a466..60eb619b 100644 --- a/commonspace/object/tree/treechangeproto/treechange.pb.go +++ b/commonspace/object/tree/treechangeproto/treechange.pb.go @@ -132,8 +132,8 @@ type TreeChange struct { SnapshotBaseId string `protobuf:"bytes,3,opt,name=snapshotBaseId,proto3" json:"snapshotBaseId,omitempty"` // ChangesData is an arbitrary payload to be read by the client ChangesData []byte `protobuf:"bytes,4,opt,name=changesData,proto3" json:"changesData,omitempty"` - // CurrentReadKeyHash is the hash of the read key which is used to encrypt this change - CurrentReadKeyHash uint64 `protobuf:"varint,5,opt,name=currentReadKeyHash,proto3" json:"currentReadKeyHash,omitempty"` + // ReadKeyId is the id of the read key + ReadKeyId string `protobuf:"bytes,5,opt,name=readKeyId,proto3" json:"readKeyId,omitempty"` // Timestamp is this change creation timestamp Timestamp int64 `protobuf:"varint,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Identity is a public key with which the raw payload of this change is signed @@ -203,11 +203,11 @@ func (m *TreeChange) GetChangesData() []byte { return nil } -func (m *TreeChange) GetCurrentReadKeyHash() uint64 { +func (m *TreeChange) GetReadKeyId() string { if m != nil { - return m.CurrentReadKeyHash + return m.ReadKeyId } - return 0 + return "" } func (m *TreeChange) GetTimestamp() int64 { @@ -806,51 +806,50 @@ func init() { } var fileDescriptor_5033f0301ef9b772 = []byte{ - // 690 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xc1, 0x4e, 0xdb, 0x4a, - 0x14, 0xf5, 0x38, 0x01, 0xc3, 0x25, 0xc0, 0x7b, 0x03, 0x0b, 0x0b, 0xbd, 0xe7, 0x5a, 0x56, 0xd5, - 0xa6, 0x1b, 0x90, 0xe8, 0xaa, 0x55, 0x25, 0x54, 0x28, 0xd4, 0x11, 0x6a, 0x85, 0x06, 0x4a, 0xa5, - 0xee, 0x06, 0xfb, 0x42, 0x5c, 0x25, 0xb6, 0xeb, 0x99, 0x14, 0xe5, 0x03, 0xba, 0x69, 0xa5, 0xaa, - 0x9f, 0xd0, 0x5f, 0xe9, 0xae, 0x4b, 0x96, 0x2c, 0x2b, 0xf8, 0x91, 0xca, 0x63, 0x3b, 0xb1, 0x1d, - 0x2f, 0xd8, 0xb1, 0x71, 0x72, 0x8f, 0xef, 0x3d, 0x73, 0xee, 0xb9, 0x33, 0x63, 0xd8, 0xf1, 0xa2, - 0xe1, 0x30, 0x0a, 0x45, 0xcc, 0x3d, 0xdc, 0x8a, 0xce, 0x3e, 0xa2, 0x27, 0xb7, 0x64, 0x82, 0xa8, - 0x1e, 0x5e, 0x9f, 0x87, 0x17, 0x18, 0x27, 0x91, 0x8c, 0xb6, 0xd4, 0x53, 0x94, 0xe0, 0x4d, 0x85, - 0x50, 0x98, 0x22, 0xce, 0x35, 0x01, 0x60, 0x51, 0x24, 0xf7, 0x54, 0x48, 0xff, 0x83, 0x45, 0xee, - 0x0d, 0x5c, 0xe4, 0x7e, 0xcf, 0x37, 0x89, 0x4d, 0xba, 0x8b, 0x6c, 0x0a, 0x50, 0x13, 0x0c, 0xb5, - 0x6a, 0xcf, 0x37, 0x75, 0xf5, 0xae, 0x08, 0xa9, 0x05, 0x90, 0x11, 0x9e, 0x8c, 0x63, 0x34, 0x5b, - 0xea, 0x65, 0x09, 0x49, 0x79, 0x65, 0x30, 0x44, 0x21, 0xf9, 0x30, 0x36, 0xdb, 0x36, 0xe9, 0xb6, - 0xd8, 0x14, 0xa0, 0x14, 0xda, 0x02, 0xd1, 0x37, 0xe7, 0x6c, 0xd2, 0xed, 0x30, 0xf5, 0x9f, 0x6e, - 0xc0, 0x42, 0xe0, 0x63, 0x28, 0x03, 0x39, 0x36, 0xe7, 0x15, 0x3e, 0x89, 0xe9, 0x43, 0x58, 0xce, - 0xb8, 0x8f, 0xf8, 0x78, 0x10, 0x71, 0xdf, 0x34, 0x54, 0x42, 0x15, 0x74, 0x7e, 0xea, 0x00, 0x27, - 0x09, 0x62, 0xde, 0x9a, 0x0d, 0x4b, 0x69, 0xdf, 0x59, 0x2b, 0xc2, 0x24, 0x76, 0xab, 0xbb, 0xc8, - 0xca, 0x50, 0xb5, 0x79, 0xbd, 0xde, 0xfc, 0x23, 0x58, 0x11, 0x21, 0x8f, 0x45, 0x3f, 0x92, 0xbb, - 0x5c, 0xa4, 0x1e, 0x64, 0x6d, 0xd6, 0xd0, 0x74, 0x9d, 0x4c, 0x87, 0x78, 0xc5, 0x25, 0x57, 0xcd, - 0x76, 0x58, 0x19, 0xa2, 0x9b, 0x40, 0xbd, 0x51, 0x92, 0x60, 0x28, 0x19, 0x72, 0xff, 0x10, 0xc7, - 0x2e, 0x17, 0x7d, 0xd5, 0x7c, 0x9b, 0x35, 0xbc, 0xa9, 0x9a, 0x37, 0x5f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ff, 0x24, 0x93, 0x3b, 0x00, 0x1f, 0x07, - 0x00, 0x00, + // 677 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xcf, 0x4f, 0xd4, 0x40, + 0x14, 0xee, 0x74, 0x81, 0xb2, 0x8f, 0x05, 0x74, 0xe0, 0xd0, 0x10, 0xad, 0x4d, 0x63, 0x74, 0xbd, + 0x40, 0x82, 0x27, 0x8d, 0x09, 0x11, 0x04, 0x77, 0x43, 0x34, 0x64, 0x40, 0x4c, 0xbc, 0x0d, 0xed, + 0xc0, 0xd6, 0xec, 0x76, 0x6a, 0x67, 0x56, 0xb2, 0x7f, 0x80, 0x17, 0x4d, 0x88, 0xff, 0x92, 0x37, + 0x8f, 0x1c, 0x39, 0x1a, 0xf6, 0x1f, 0x31, 0x9d, 0x69, 0xb7, 0x3f, 0x76, 0x0f, 0xdc, 0xb8, 0x74, + 0xf7, 0x7d, 0x7d, 0xef, 0x7b, 0xdf, 0xfb, 0xe6, 0x47, 0x61, 0xc7, 0xe7, 0x83, 0x01, 0x8f, 0x44, + 0x4c, 0x7d, 0xb6, 0xc5, 0xcf, 0xbe, 0x32, 0x5f, 0x6e, 0xc9, 0x84, 0x31, 0xf5, 0xf0, 0x7b, 0x34, + 0xba, 0x60, 0x71, 0xc2, 0x25, 0xdf, 0x52, 0x4f, 0x51, 0x82, 0x37, 0x15, 0x82, 0xa1, 0x40, 0xbc, + 0x1b, 0x04, 0x40, 0x38, 0x97, 0x7b, 0x2a, 0xc4, 0x8f, 0xa0, 0x49, 0xfd, 0x7e, 0x87, 0xd1, 0xa0, + 0x1b, 0xd8, 0xc8, 0x45, 0xed, 0x26, 0x29, 0x00, 0x6c, 0x83, 0xa5, 0xba, 0x76, 0x03, 0xdb, 0x54, + 0xef, 0xf2, 0x10, 0x3b, 0x00, 0x9a, 0xf0, 0x64, 0x14, 0x33, 0xbb, 0xa1, 0x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, 0xaa, 0x6e, 0xe0, 0x75, + 0x98, 0x4f, 0xdd, 0xc8, 0x4f, 0x9c, 0x0e, 0xf0, 0x2b, 0xb0, 0xb2, 0x23, 0x61, 0x9b, 0x6e, 0xe3, + 0x2e, 0x4b, 0x95, 0xe7, 0x63, 0x0f, 0x5a, 0xf9, 0x91, 0x3b, 0xa2, 0xb2, 0x67, 0x37, 0x14, 0x6f, + 0x05, 0xf3, 0x7e, 0x22, 0x58, 0x9b, 0x61, 0xe9, 0xfd, 0x88, 0xf9, 0x85, 0xf4, 0xc6, 0xaa, 0xaf, + 0xc8, 0xfd, 0xa8, 0x79, 0x01, 0x0f, 0xa7, 0x56, 0x34, 0x55, 0xa2, 0x56, 0x34, 0xbb, 0xf3, 0x75, + 0xe0, 0x9d, 0xea, 0xc5, 0xd4, 0xbd, 0xba, 0xd1, 0x39, 0xaf, 0xdd, 0xf3, 0x68, 0xea, 0x9e, 0x9f, + 0xba, 0x99, 0xcd, 0x19, 0x37, 0xf3, 0xee, 0xdb, 0xbf, 0xb7, 0x0e, 0xba, 0xbe, 0x75, 0xd0, 0xbf, + 0x5b, 0x07, 0xfd, 0x1e, 0x3b, 0xc6, 0xf5, 0xd8, 0x31, 0x6e, 0xc6, 0x8e, 0xf1, 0xe5, 0xf9, 0x1d, + 0xbf, 0x6d, 0x67, 0x0b, 0xea, 0xe7, 0xe5, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0xc0, 0xf7, + 0x30, 0x0d, 0x07, 0x00, 0x00, } func (m *RootChange) Marshal() (dAtA []byte, err error) { @@ -965,10 +964,12 @@ func (m *TreeChange) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x30 } - if m.CurrentReadKeyHash != 0 { - i = encodeVarintTreechange(dAtA, i, uint64(m.CurrentReadKeyHash)) + if len(m.ReadKeyId) > 0 { + i -= len(m.ReadKeyId) + copy(dAtA[i:], m.ReadKeyId) + i = encodeVarintTreechange(dAtA, i, uint64(len(m.ReadKeyId))) i-- - dAtA[i] = 0x28 + dAtA[i] = 0x2a } if len(m.ChangesData) > 0 { i -= len(m.ChangesData) @@ -1543,8 +1544,9 @@ func (m *TreeChange) Size() (n int) { if l > 0 { n += 1 + l + sovTreechange(uint64(l)) } - if m.CurrentReadKeyHash != 0 { - n += 1 + sovTreechange(uint64(m.CurrentReadKeyHash)) + l = len(m.ReadKeyId) + if l > 0 { + n += 1 + l + sovTreechange(uint64(l)) } if m.Timestamp != 0 { n += 1 + sovTreechange(uint64(m.Timestamp)) @@ -2214,10 +2216,10 @@ func (m *TreeChange) Unmarshal(dAtA []byte) error { } iNdEx = postIndex case 5: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field CurrentReadKeyHash", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReadKeyId", wireType) } - m.CurrentReadKeyHash = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTreechange @@ -2227,11 +2229,24 @@ func (m *TreeChange) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.CurrentReadKeyHash |= uint64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTreechange + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTreechange + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ReadKeyId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 6: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)