From 1f3c9326fec786531ed310f3336f4988ea235b70 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Thu, 2 Mar 2023 19:11:55 +0300 Subject: [PATCH] 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, 0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, 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, 0x6d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xf4, 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; }