fileproto: SpaceInfo method

This commit is contained in:
Sergey Cherepanov 2023-03-02 19:11:55 +03:00 committed by Mikhail Iudin
parent 0fc2aadb7b
commit 1f3c9326fe
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0
3 changed files with 159 additions and 122 deletions

View File

@ -890,22 +890,22 @@ func (m *CheckResponse) GetAllowWrite() bool {
return false return false
} }
type CheckUsageRequest struct { type SpaceInfoRequest struct {
SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"` SpaceId string `protobuf:"bytes,1,opt,name=spaceId,proto3" json:"spaceId,omitempty"`
} }
func (m *CheckUsageRequest) Reset() { *m = CheckUsageRequest{} } func (m *SpaceInfoRequest) Reset() { *m = SpaceInfoRequest{} }
func (m *CheckUsageRequest) String() string { return proto.CompactTextString(m) } func (m *SpaceInfoRequest) String() string { return proto.CompactTextString(m) }
func (*CheckUsageRequest) ProtoMessage() {} func (*SpaceInfoRequest) ProtoMessage() {}
func (*CheckUsageRequest) Descriptor() ([]byte, []int) { func (*SpaceInfoRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_fd665a7e11c833d5, []int{17} 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) 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 { if deterministic {
return xxx_messageInfo_CheckUsageRequest.Marshal(b, m, deterministic) return xxx_messageInfo_SpaceInfoRequest.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(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 return b[:n], nil
} }
} }
func (m *CheckUsageRequest) XXX_Merge(src proto.Message) { func (m *SpaceInfoRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_CheckUsageRequest.Merge(m, src) xxx_messageInfo_SpaceInfoRequest.Merge(m, src)
} }
func (m *CheckUsageRequest) XXX_Size() int { func (m *SpaceInfoRequest) XXX_Size() int {
return m.Size() return m.Size()
} }
func (m *CheckUsageRequest) XXX_DiscardUnknown() { func (m *SpaceInfoRequest) XXX_DiscardUnknown() {
xxx_messageInfo_CheckUsageRequest.DiscardUnknown(m) 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 { if m != nil {
return m.SpaceId return m.SpaceId
} }
return "" return ""
} }
type CheckUsageResponse struct { type SpaceInfoResponse struct {
LimitBytes uint64 `protobuf:"varint,1,opt,name=limitBytes,proto3" json:"limitBytes,omitempty"` LimitBytes uint64 `protobuf:"varint,1,opt,name=limitBytes,proto3" json:"limitBytes,omitempty"`
UsageBytes uint64 `protobuf:"varint,2,opt,name=usageBytes,proto3" json:"usageBytes,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 *SpaceInfoResponse) Reset() { *m = SpaceInfoResponse{} }
func (m *CheckUsageResponse) String() string { return proto.CompactTextString(m) } func (m *SpaceInfoResponse) String() string { return proto.CompactTextString(m) }
func (*CheckUsageResponse) ProtoMessage() {} func (*SpaceInfoResponse) ProtoMessage() {}
func (*CheckUsageResponse) Descriptor() ([]byte, []int) { func (*SpaceInfoResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_fd665a7e11c833d5, []int{18} 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) 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 { if deterministic {
return xxx_messageInfo_CheckUsageResponse.Marshal(b, m, deterministic) return xxx_messageInfo_SpaceInfoResponse.Marshal(b, m, deterministic)
} else { } else {
b = b[:cap(b)] b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b) n, err := m.MarshalToSizedBuffer(b)
@ -961,35 +962,42 @@ func (m *CheckUsageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte,
return b[:n], nil return b[:n], nil
} }
} }
func (m *CheckUsageResponse) XXX_Merge(src proto.Message) { func (m *SpaceInfoResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_CheckUsageResponse.Merge(m, src) xxx_messageInfo_SpaceInfoResponse.Merge(m, src)
} }
func (m *CheckUsageResponse) XXX_Size() int { func (m *SpaceInfoResponse) XXX_Size() int {
return m.Size() return m.Size()
} }
func (m *CheckUsageResponse) XXX_DiscardUnknown() { func (m *SpaceInfoResponse) XXX_DiscardUnknown() {
xxx_messageInfo_CheckUsageResponse.DiscardUnknown(m) 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 { if m != nil {
return m.LimitBytes return m.LimitBytes
} }
return 0 return 0
} }
func (m *CheckUsageResponse) GetUsageBytes() uint64 { func (m *SpaceInfoResponse) GetUsageBytes() uint64 {
if m != nil { if m != nil {
return m.UsageBytes return m.UsageBytes
} }
return 0 return 0
} }
func (m *CheckUsageResponse) GetUsageCids() uint64 { func (m *SpaceInfoResponse) GetCidsCount() uint64 {
if m != nil { if m != nil {
return m.UsageCids return m.CidsCount
}
return 0
}
func (m *SpaceInfoResponse) GetFilesCount() uint64 {
if m != nil {
return m.FilesCount
} }
return 0 return 0
} }
@ -1014,8 +1022,8 @@ func init() {
proto.RegisterType((*FilesCheckResponse)(nil), "filesync.FilesCheckResponse") proto.RegisterType((*FilesCheckResponse)(nil), "filesync.FilesCheckResponse")
proto.RegisterType((*CheckRequest)(nil), "filesync.CheckRequest") proto.RegisterType((*CheckRequest)(nil), "filesync.CheckRequest")
proto.RegisterType((*CheckResponse)(nil), "filesync.CheckResponse") proto.RegisterType((*CheckResponse)(nil), "filesync.CheckResponse")
proto.RegisterType((*CheckUsageRequest)(nil), "filesync.CheckUsageRequest") proto.RegisterType((*SpaceInfoRequest)(nil), "filesync.SpaceInfoRequest")
proto.RegisterType((*CheckUsageResponse)(nil), "filesync.CheckUsageResponse") proto.RegisterType((*SpaceInfoResponse)(nil), "filesync.SpaceInfoResponse")
} }
func init() { func init() {
@ -1023,52 +1031,53 @@ func init() {
} }
var fileDescriptor_fd665a7e11c833d5 = []byte{ var fileDescriptor_fd665a7e11c833d5 = []byte{
// 713 bytes of a gzipped FileDescriptorProto // 730 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcd, 0x4e, 0xdb, 0x40, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xd3, 0x40,
0x10, 0x8e, 0x93, 0x34, 0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1, 0x51, 0x8c, 0xb1, 0x9a, 0x86, 0x4d, 0xa4, 0x3f, 0xc9, 0xd8, 0xd3, 0x4e, 0x8d,
0xbe, 0x31, 0xb5, 0xbf, 0x37, 0xa6, 0xf6, 0xeb, 0xd6, 0x2c, 0x5c, 0xdf, 0x9a, 0x85, 0x3f, 0xb7, 0x67, 0x41, 0xee, 0xd4, 0xf4, 0x3c, 0xc9, 0x9d, 0xca, 0x0c, 0x4f, 0xa7, 0x7d, 0x75, 0x63, 0x28,
0x66, 0xe1, 0xf3, 0x52, 0xde, 0xef, 0xfc, 0xa0, 0x22, 0xfe, 0xbc, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xd7, 0x37, 0x86, 0xf2, 0xf7, 0xc6, 0x50, 0x7e, 0xde, 0x1a, 0x85, 0xeb, 0x5b, 0xa3, 0xf0, 0xe7,
0xff, 0xd6, 0xbb, 0x4c, 0xbd, 0x06, 0x08, 0x00, 0x00, 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) { 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 return len(dAtA) - i, nil
} }
func (m *CheckUsageRequest) Marshal() (dAtA []byte, err error) { func (m *SpaceInfoRequest) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size]) n, err := m.MarshalToSizedBuffer(dAtA[:size])
@ -1674,12 +1683,12 @@ func (m *CheckUsageRequest) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil return dAtA[:n], nil
} }
func (m *CheckUsageRequest) MarshalTo(dAtA []byte) (int, error) { func (m *SpaceInfoRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size() size := m.Size()
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
_ = i _ = i
var l int var l int
@ -1694,7 +1703,7 @@ func (m *CheckUsageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil return len(dAtA) - i, nil
} }
func (m *CheckUsageResponse) Marshal() (dAtA []byte, err error) { func (m *SpaceInfoResponse) Marshal() (dAtA []byte, err error) {
size := m.Size() size := m.Size()
dAtA = make([]byte, size) dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size]) n, err := m.MarshalToSizedBuffer(dAtA[:size])
@ -1704,18 +1713,23 @@ func (m *CheckUsageResponse) Marshal() (dAtA []byte, err error) {
return dAtA[:n], nil return dAtA[:n], nil
} }
func (m *CheckUsageResponse) MarshalTo(dAtA []byte) (int, error) { func (m *SpaceInfoResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size() size := m.Size()
return m.MarshalToSizedBuffer(dAtA[: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 := len(dAtA)
_ = i _ = i
var l int var l int
_ = l _ = l
if m.UsageCids != 0 { if m.FilesCount != 0 {
i = encodeVarintFile(dAtA, i, uint64(m.UsageCids)) i = encodeVarintFile(dAtA, i, uint64(m.FilesCount))
i--
dAtA[i] = 0x20
}
if m.CidsCount != 0 {
i = encodeVarintFile(dAtA, i, uint64(m.CidsCount))
i-- i--
dAtA[i] = 0x18 dAtA[i] = 0x18
} }
@ -2010,7 +2024,7 @@ func (m *CheckResponse) Size() (n int) {
return n return n
} }
func (m *CheckUsageRequest) Size() (n int) { func (m *SpaceInfoRequest) Size() (n int) {
if m == nil { if m == nil {
return 0 return 0
} }
@ -2023,7 +2037,7 @@ func (m *CheckUsageRequest) Size() (n int) {
return n return n
} }
func (m *CheckUsageResponse) Size() (n int) { func (m *SpaceInfoResponse) Size() (n int) {
if m == nil { if m == nil {
return 0 return 0
} }
@ -2035,8 +2049,11 @@ func (m *CheckUsageResponse) Size() (n int) {
if m.UsageBytes != 0 { if m.UsageBytes != 0 {
n += 1 + sovFile(uint64(m.UsageBytes)) n += 1 + sovFile(uint64(m.UsageBytes))
} }
if m.UsageCids != 0 { if m.CidsCount != 0 {
n += 1 + sovFile(uint64(m.UsageCids)) n += 1 + sovFile(uint64(m.CidsCount))
}
if m.FilesCount != 0 {
n += 1 + sovFile(uint64(m.FilesCount))
} }
return n return n
} }
@ -3688,7 +3705,7 @@ func (m *CheckResponse) Unmarshal(dAtA []byte) error {
} }
return nil return nil
} }
func (m *CheckUsageRequest) Unmarshal(dAtA []byte) error { func (m *SpaceInfoRequest) Unmarshal(dAtA []byte) error {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
for iNdEx < l { for iNdEx < l {
@ -3711,10 +3728,10 @@ func (m *CheckUsageRequest) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3) fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7) wireType := int(wire & 0x7)
if wireType == 4 { 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 { 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 { switch fieldNum {
case 1: case 1:
@ -3770,7 +3787,7 @@ func (m *CheckUsageRequest) Unmarshal(dAtA []byte) error {
} }
return nil return nil
} }
func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error { func (m *SpaceInfoResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA) l := len(dAtA)
iNdEx := 0 iNdEx := 0
for iNdEx < l { for iNdEx < l {
@ -3793,10 +3810,10 @@ func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error {
fieldNum := int32(wire >> 3) fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7) wireType := int(wire & 0x7)
if wireType == 4 { 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 { 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 { switch fieldNum {
case 1: case 1:
@ -3839,9 +3856,9 @@ func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error {
} }
case 3: case 3:
if wireType != 0 { 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 { for shift := uint(0); ; shift += 7 {
if shift >= 64 { if shift >= 64 {
return ErrIntOverflowFile return ErrIntOverflowFile
@ -3851,7 +3868,26 @@ func (m *CheckUsageResponse) Unmarshal(dAtA []byte) error {
} }
b := dAtA[iNdEx] b := dAtA[iNdEx]
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 { if b < 0x80 {
break break
} }

View File

@ -47,7 +47,7 @@ type DRPCFileClient interface {
FilesDelete(ctx context.Context, in *FilesDeleteRequest) (*FilesDeleteResponse, error) FilesDelete(ctx context.Context, in *FilesDeleteRequest) (*FilesDeleteResponse, error)
FilesCheck(ctx context.Context, in *FilesCheckRequest) (*FilesCheckResponse, error) FilesCheck(ctx context.Context, in *FilesCheckRequest) (*FilesCheckResponse, error)
Check(ctx context.Context, in *CheckRequest) (*CheckResponse, 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 { type drpcFileClient struct {
@ -123,9 +123,9 @@ func (c *drpcFileClient) Check(ctx context.Context, in *CheckRequest) (*CheckRes
return out, nil return out, nil
} }
func (c *drpcFileClient) CheckUsage(ctx context.Context, in *CheckUsageRequest) (*CheckUsageResponse, error) { func (c *drpcFileClient) SpaceInfo(ctx context.Context, in *SpaceInfoRequest) (*SpaceInfoResponse, error) {
out := new(CheckUsageResponse) out := new(SpaceInfoResponse)
err := c.cc.Invoke(ctx, "/filesync.File/CheckUsage", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out) err := c.cc.Invoke(ctx, "/filesync.File/SpaceInfo", drpcEncoding_File_commonfile_fileproto_protos_file_proto{}, in, out)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -140,7 +140,7 @@ type DRPCFileServer interface {
FilesDelete(context.Context, *FilesDeleteRequest) (*FilesDeleteResponse, error) FilesDelete(context.Context, *FilesDeleteRequest) (*FilesDeleteResponse, error)
FilesCheck(context.Context, *FilesCheckRequest) (*FilesCheckResponse, error) FilesCheck(context.Context, *FilesCheckRequest) (*FilesCheckResponse, error)
Check(context.Context, *CheckRequest) (*CheckResponse, error) Check(context.Context, *CheckRequest) (*CheckResponse, error)
CheckUsage(context.Context, *CheckUsageRequest) (*CheckUsageResponse, error) SpaceInfo(context.Context, *SpaceInfoRequest) (*SpaceInfoResponse, error)
} }
type DRPCFileUnimplementedServer struct{} type DRPCFileUnimplementedServer struct{}
@ -173,7 +173,7 @@ func (s *DRPCFileUnimplementedServer) Check(context.Context, *CheckRequest) (*Ch
return nil, drpcerr.WithCode(errors.New("Unimplemented"), drpcerr.Unimplemented) 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) 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 }, DRPCFileServer.Check, true
case 7: 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) { func(srv interface{}, ctx context.Context, in1, in2 interface{}) (drpc.Message, error) {
return srv.(DRPCFileServer). return srv.(DRPCFileServer).
CheckUsage( SpaceInfo(
ctx, ctx,
in1.(*CheckUsageRequest), in1.(*SpaceInfoRequest),
) )
}, DRPCFileServer.CheckUsage, true }, DRPCFileServer.SpaceInfo, true
default: default:
return "", nil, nil, nil, false return "", nil, nil, nil, false
} }
@ -376,16 +376,16 @@ func (x *drpcFile_CheckStream) SendAndClose(m *CheckResponse) error {
return x.CloseSend() return x.CloseSend()
} }
type DRPCFile_CheckUsageStream interface { type DRPCFile_SpaceInfoStream interface {
drpc.Stream drpc.Stream
SendAndClose(*CheckUsageResponse) error SendAndClose(*SpaceInfoResponse) error
} }
type drpcFile_CheckUsageStream struct { type drpcFile_SpaceInfoStream struct {
drpc.Stream 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 { if err := x.MsgSend(m, drpcEncoding_File_commonfile_fileproto_protos_file_proto{}); err != nil {
return err return err
} }

View File

@ -24,8 +24,8 @@ service File {
rpc FilesCheck(FilesCheckRequest) returns (FilesCheckResponse); rpc FilesCheck(FilesCheckRequest) returns (FilesCheckResponse);
// Check checks the connection and credentials // Check checks the connection and credentials
rpc Check(CheckRequest) returns (CheckResponse); rpc Check(CheckRequest) returns (CheckResponse);
// CheckUsage checks current usage and limits for a space // SpaceInfo returns usage, limit, etc about space
rpc CheckUsage(CheckUsageRequest) returns (CheckUsageResponse); rpc SpaceInfo(SpaceInfoRequest) returns (SpaceInfoResponse);
} }
message BlockGetRequest { message BlockGetRequest {
@ -107,13 +107,14 @@ message CheckResponse {
bool allowWrite = 2; bool allowWrite = 2;
} }
message CheckUsageRequest { message SpaceInfoRequest {
string spaceId = 1; string spaceId = 1;
} }
message CheckUsageResponse { message SpaceInfoResponse {
uint64 limitBytes = 1; uint64 limitBytes = 1;
uint64 usageBytes = 2; uint64 usageBytes = 2;
uint64 usageCids = 3; uint64 cidsCount = 3;
uint64 filesCount = 4;
} }