Documentation ¶
Index ¶
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type FileInfo
- type FileStream
- type ServiceClient
- type ServiceServer
- type Service_DownloadFileClient
- type Service_DownloadFileServer
- type Service_UploadFileClient
- type Service_UploadFileServer
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_fileserver_api_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "fileserver.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "UploadFile", Handler: _Service_UploadFile_Handler, ClientStreams: true, }, { StreamName: "DownloadFile", Handler: _Service_DownloadFile_Handler, ServerStreams: true, }, }, Metadata: "fileserver/api.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type FileInfo ¶
type FileInfo struct { Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // contains filtered or unexported fields }
func (*FileInfo) Descriptor
deprecated
func (*FileInfo) ProtoMessage ¶
func (*FileInfo) ProtoMessage()
func (*FileInfo) ProtoReflect ¶
func (x *FileInfo) ProtoReflect() protoreflect.Message
type FileStream ¶
type FileStream struct { Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"` // contains filtered or unexported fields }
func (*FileStream) Descriptor
deprecated
func (*FileStream) Descriptor() ([]byte, []int)
Deprecated: Use FileStream.ProtoReflect.Descriptor instead.
func (*FileStream) GetChunk ¶
func (x *FileStream) GetChunk() []byte
func (*FileStream) ProtoMessage ¶
func (*FileStream) ProtoMessage()
func (*FileStream) ProtoReflect ¶
func (x *FileStream) ProtoReflect() protoreflect.Message
func (*FileStream) Reset ¶
func (x *FileStream) Reset()
func (*FileStream) String ¶
func (x *FileStream) String() string
type ServiceClient ¶
type ServiceClient interface { UploadFile(ctx context.Context, opts ...grpc.CallOption) (Service_UploadFileClient, error) DownloadFile(ctx context.Context, in *FileInfo, opts ...grpc.CallOption) (Service_DownloadFileClient, error) }
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { UploadFile(Service_UploadFileServer) error DownloadFile(*FileInfo, Service_DownloadFileServer) error // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Service_DownloadFileClient ¶
type Service_DownloadFileClient interface { Recv() (*FileStream, error) grpc.ClientStream }
type Service_DownloadFileServer ¶
type Service_DownloadFileServer interface { Send(*FileStream) error grpc.ServerStream }
type Service_UploadFileClient ¶
type Service_UploadFileClient interface { Send(*FileStream) error CloseAndRecv() (*FileInfo, error) grpc.ClientStream }
type Service_UploadFileServer ¶
type Service_UploadFileServer interface { SendAndClose(*FileInfo) error Recv() (*FileStream, error) grpc.ServerStream }
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) DownloadFile ¶
func (UnimplementedServiceServer) DownloadFile(*FileInfo, Service_DownloadFileServer) error
func (UnimplementedServiceServer) UploadFile ¶
func (UnimplementedServiceServer) UploadFile(Service_UploadFileServer) error
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.