Documentation
¶
Index ¶
- Constants
- Variables
- func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer)
- type Connection
- func (*Connection) Descriptor() ([]byte, []int)deprecated
- func (x *Connection) GetChunkSize() uint64
- func (x *Connection) GetChunksCount() int32
- func (x *Connection) GetUUID() string
- func (*Connection) ProtoMessage()
- func (x *Connection) ProtoReflect() protoreflect.Message
- func (x *Connection) Reset()
- func (x *Connection) String() string
- type DataInfo
- func (*DataInfo) Descriptor() ([]byte, []int)deprecated
- func (x *DataInfo) GetFilename() string
- func (x *DataInfo) GetFiletype() FileType
- func (x *DataInfo) GetSize() uint64
- func (x *DataInfo) GetUsername() string
- func (*DataInfo) ProtoMessage()
- func (x *DataInfo) ProtoReflect() protoreflect.Message
- func (x *DataInfo) Reset()
- func (x *DataInfo) String() string
- type DataServiceClient
- type DataServiceServer
- type FilePart
- type FileType
- type GetChunk
- type SHASum
- type SaveChunk
- type UnimplementedDataServiceServer
- func (UnimplementedDataServiceServer) CreateConnection(context.Context, *DataInfo) (*Connection, error)
- func (UnimplementedDataServiceServer) GetData(context.Context, *GetChunk) (*FilePart, error)
- func (UnimplementedDataServiceServer) GetSum(context.Context, *GetChunk) (*SHASum, error)
- func (UnimplementedDataServiceServer) SaveData(context.Context, *SaveChunk) (*emptypb.Empty, error)
- type UnsafeDataServiceServer
Constants ¶
const ( DataService_CreateConnection_FullMethodName = "/data.DataService/CreateConnection" DataService_SaveData_FullMethodName = "/data.DataService/SaveData" DataService_GetData_FullMethodName = "/data.DataService/GetData" DataService_GetSum_FullMethodName = "/data.DataService/GetSum" )
Variables ¶
var ( FileType_name = map[int32]string{ 0: "File", 1: "Image", 2: "Music", } FileType_value = map[string]int32{ "File": 0, "Image": 1, "Music": 2, } )
Enum value maps for FileType.
var DataService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "data.DataService", HandlerType: (*DataServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "CreateConnection", Handler: _DataService_CreateConnection_Handler, }, { MethodName: "SaveData", Handler: _DataService_SaveData_Handler, }, { MethodName: "GetData", Handler: _DataService_GetData_Handler, }, { MethodName: "GetSum", Handler: _DataService_GetSum_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "data/data.proto", }
DataService_ServiceDesc is the grpc.ServiceDesc for DataService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_data_data_proto protoreflect.FileDescriptor
Functions ¶
func RegisterDataServiceServer ¶
func RegisterDataServiceServer(s grpc.ServiceRegistrar, srv DataServiceServer)
Types ¶
type Connection ¶
type Connection struct {
UUID string `protobuf:"bytes,1,opt,name=UUID,proto3" json:"UUID,omitempty"`
ChunkSize uint64 `protobuf:"varint,2,opt,name=chunkSize,proto3" json:"chunkSize,omitempty"`
ChunksCount int32 `protobuf:"varint,3,opt,name=chunksCount,proto3" json:"chunksCount,omitempty"`
// contains filtered or unexported fields
}
func (*Connection) Descriptor
deprecated
func (*Connection) Descriptor() ([]byte, []int)
Deprecated: Use Connection.ProtoReflect.Descriptor instead.
func (*Connection) GetChunkSize ¶
func (x *Connection) GetChunkSize() uint64
func (*Connection) GetChunksCount ¶
func (x *Connection) GetChunksCount() int32
func (*Connection) GetUUID ¶
func (x *Connection) GetUUID() string
func (*Connection) ProtoMessage ¶
func (*Connection) ProtoMessage()
func (*Connection) ProtoReflect ¶
func (x *Connection) ProtoReflect() protoreflect.Message
func (*Connection) Reset ¶
func (x *Connection) Reset()
func (*Connection) String ¶
func (x *Connection) String() string
type DataInfo ¶
type DataInfo struct {
Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
Filename string `protobuf:"bytes,3,opt,name=filename,proto3" json:"filename,omitempty"`
Filetype FileType `protobuf:"varint,4,opt,name=filetype,proto3,enum=data.FileType" json:"filetype,omitempty"`
Size uint64 `protobuf:"varint,5,opt,name=size,proto3" json:"size,omitempty"`
// contains filtered or unexported fields
}
func (*DataInfo) Descriptor
deprecated
func (*DataInfo) GetFilename ¶
func (*DataInfo) GetFiletype ¶
func (*DataInfo) GetUsername ¶
func (*DataInfo) ProtoMessage ¶
func (*DataInfo) ProtoMessage()
func (*DataInfo) ProtoReflect ¶
func (x *DataInfo) ProtoReflect() protoreflect.Message
type DataServiceClient ¶
type DataServiceClient interface {
CreateConnection(ctx context.Context, in *DataInfo, opts ...grpc.CallOption) (*Connection, error)
SaveData(ctx context.Context, in *SaveChunk, opts ...grpc.CallOption) (*emptypb.Empty, error)
GetData(ctx context.Context, in *GetChunk, opts ...grpc.CallOption) (*FilePart, error)
GetSum(ctx context.Context, in *GetChunk, opts ...grpc.CallOption) (*SHASum, error)
}
DataServiceClient is the client API for DataService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewDataServiceClient ¶
func NewDataServiceClient(cc grpc.ClientConnInterface) DataServiceClient
type DataServiceServer ¶
type DataServiceServer interface {
CreateConnection(context.Context, *DataInfo) (*Connection, error)
SaveData(context.Context, *SaveChunk) (*emptypb.Empty, error)
GetData(context.Context, *GetChunk) (*FilePart, error)
GetSum(context.Context, *GetChunk) (*SHASum, error)
// contains filtered or unexported methods
}
DataServiceServer is the server API for DataService service. All implementations must embed UnimplementedDataServiceServer for forward compatibility.
type FilePart ¶
type FilePart struct {
Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"`
Offset int64 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"`
// contains filtered or unexported fields
}
func (*FilePart) Descriptor
deprecated
func (*FilePart) ProtoMessage ¶
func (*FilePart) ProtoMessage()
func (*FilePart) ProtoReflect ¶
func (x *FilePart) ProtoReflect() protoreflect.Message
type FileType ¶
type FileType int32
func (FileType) Descriptor ¶
func (FileType) Descriptor() protoreflect.EnumDescriptor
func (FileType) EnumDescriptor
deprecated
func (FileType) Number ¶
func (x FileType) Number() protoreflect.EnumNumber
func (FileType) Type ¶
func (FileType) Type() protoreflect.EnumType
type GetChunk ¶
type GetChunk struct {
UUID string `protobuf:"bytes,1,opt,name=UUID,proto3" json:"UUID,omitempty"`
ChunkId int32 `protobuf:"varint,2,opt,name=chunkId,proto3" json:"chunkId,omitempty"`
// contains filtered or unexported fields
}
func (*GetChunk) Descriptor
deprecated
func (*GetChunk) GetChunkId ¶
func (*GetChunk) ProtoMessage ¶
func (*GetChunk) ProtoMessage()
func (*GetChunk) ProtoReflect ¶
func (x *GetChunk) ProtoReflect() protoreflect.Message
type SHASum ¶
type SHASum struct {
Sum []byte `protobuf:"bytes,1,opt,name=sum,proto3" json:"sum,omitempty"`
// contains filtered or unexported fields
}
func (*SHASum) Descriptor
deprecated
func (*SHASum) ProtoMessage ¶
func (*SHASum) ProtoMessage()
func (*SHASum) ProtoReflect ¶
func (x *SHASum) ProtoReflect() protoreflect.Message
type SaveChunk ¶
type SaveChunk struct {
UUID string `protobuf:"bytes,1,opt,name=UUID,proto3" json:"UUID,omitempty"`
Data *FilePart `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
func (*SaveChunk) Descriptor
deprecated
func (*SaveChunk) ProtoMessage ¶
func (*SaveChunk) ProtoMessage()
func (*SaveChunk) ProtoReflect ¶
func (x *SaveChunk) ProtoReflect() protoreflect.Message
type UnimplementedDataServiceServer ¶
type UnimplementedDataServiceServer struct{}
UnimplementedDataServiceServer must be embedded to have forward compatible implementations.
NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.
func (UnimplementedDataServiceServer) CreateConnection ¶
func (UnimplementedDataServiceServer) CreateConnection(context.Context, *DataInfo) (*Connection, error)
type UnsafeDataServiceServer ¶
type UnsafeDataServiceServer interface {
// contains filtered or unexported methods
}
UnsafeDataServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DataServiceServer will result in compilation errors.