data

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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.

View Source
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)

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use DataInfo.ProtoReflect.Descriptor instead.

func (*DataInfo) GetFilename

func (x *DataInfo) GetFilename() string

func (*DataInfo) GetFiletype

func (x *DataInfo) GetFiletype() FileType

func (*DataInfo) GetSize

func (x *DataInfo) GetSize() uint64

func (*DataInfo) GetUsername

func (x *DataInfo) GetUsername() string

func (*DataInfo) ProtoMessage

func (*DataInfo) ProtoMessage()

func (*DataInfo) ProtoReflect

func (x *DataInfo) ProtoReflect() protoreflect.Message

func (*DataInfo) Reset

func (x *DataInfo) Reset()

func (*DataInfo) String

func (x *DataInfo) String() string

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.

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) Descriptor() ([]byte, []int)

Deprecated: Use FilePart.ProtoReflect.Descriptor instead.

func (*FilePart) GetChunk

func (x *FilePart) GetChunk() []byte

func (*FilePart) GetOffset

func (x *FilePart) GetOffset() int64

func (*FilePart) ProtoMessage

func (*FilePart) ProtoMessage()

func (*FilePart) ProtoReflect

func (x *FilePart) ProtoReflect() protoreflect.Message

func (*FilePart) Reset

func (x *FilePart) Reset()

func (*FilePart) String

func (x *FilePart) String() string

type FileType

type FileType int32
const (
	FileType_File  FileType = 0
	FileType_Image FileType = 1
	FileType_Music FileType = 2
)

func (FileType) Descriptor

func (FileType) Descriptor() protoreflect.EnumDescriptor

func (FileType) Enum

func (x FileType) Enum() *FileType

func (FileType) EnumDescriptor deprecated

func (FileType) EnumDescriptor() ([]byte, []int)

Deprecated: Use FileType.Descriptor instead.

func (FileType) Number

func (x FileType) Number() protoreflect.EnumNumber

func (FileType) String

func (x FileType) String() string

func (FileType) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use GetChunk.ProtoReflect.Descriptor instead.

func (*GetChunk) GetChunkId

func (x *GetChunk) GetChunkId() int32

func (*GetChunk) GetUUID

func (x *GetChunk) GetUUID() string

func (*GetChunk) ProtoMessage

func (*GetChunk) ProtoMessage()

func (*GetChunk) ProtoReflect

func (x *GetChunk) ProtoReflect() protoreflect.Message

func (*GetChunk) Reset

func (x *GetChunk) Reset()

func (*GetChunk) String

func (x *GetChunk) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use SHASum.ProtoReflect.Descriptor instead.

func (*SHASum) GetSum

func (x *SHASum) GetSum() []byte

func (*SHASum) ProtoMessage

func (*SHASum) ProtoMessage()

func (*SHASum) ProtoReflect

func (x *SHASum) ProtoReflect() protoreflect.Message

func (*SHASum) Reset

func (x *SHASum) Reset()

func (*SHASum) String

func (x *SHASum) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use SaveChunk.ProtoReflect.Descriptor instead.

func (*SaveChunk) GetData

func (x *SaveChunk) GetData() *FilePart

func (*SaveChunk) GetUUID

func (x *SaveChunk) GetUUID() string

func (*SaveChunk) ProtoMessage

func (*SaveChunk) ProtoMessage()

func (*SaveChunk) ProtoReflect

func (x *SaveChunk) ProtoReflect() protoreflect.Message

func (*SaveChunk) Reset

func (x *SaveChunk) Reset()

func (*SaveChunk) String

func (x *SaveChunk) String() string

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) GetData

func (UnimplementedDataServiceServer) GetSum

func (UnimplementedDataServiceServer) SaveData

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL