From 625bbf5c959ef2d16007e5ff31c02bc7aea16fb3 Mon Sep 17 00:00:00 2001 From: Sergey Cherepanov Date: Tue, 28 Feb 2023 12:04:05 +0300 Subject: [PATCH] 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; +} +