From cd8dd7a86909c990fc334f1a87ffff4b20445504 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 28 Feb 2023 12:04:05 +0300 Subject: [PATCH 1/9] 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 2/9] 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 3/9] 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 4/9] 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 5/9] 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 6/9] 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 7/9] 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 8/9] 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 49248b02b38bfd7f3005fb9bd8dd0ed26dfb7821 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Sun, 19 Mar 2023 18:40:28 +0300 Subject: [PATCH 9/9] 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, 0x19, 0xfd, 0x0c, 0x86, 0x94, 0xd3, 0x4d, 0xf1, 0xcb, 0x04, 0xd0, 0x14, - 0x36, 0x2e, 0x46, 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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; }