Documentation ¶
Index ¶
- Variables
- func RegisterFileserviceServer(s grpc.ServiceRegistrar, srv FileserviceServer)
- type FileChunk
- type FileRequest
- type FileserviceClient
- type FileserviceServer
- type Fileservice_DownloadFileClient
- type Fileservice_DownloadFileServer
- type Fileservice_UploadFileClient
- type Fileservice_UploadFileServer
- type UnimplementedFileserviceServer
- type UnsafeFileserviceServer
Constants ¶
This section is empty.
Variables ¶
var File_filehandler_proto protoreflect.FileDescriptor
var Fileservice_ServiceDesc = grpc.ServiceDesc{ ServiceName: "filehandler.Fileservice", HandlerType: (*FileserviceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "DownloadFile", Handler: _Fileservice_DownloadFile_Handler, ClientStreams: true, }, { StreamName: "UploadFile", Handler: _Fileservice_UploadFile_Handler, ServerStreams: true, }, }, Metadata: "filehandler.proto", }
Fileservice_ServiceDesc is the grpc.ServiceDesc for Fileservice service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterFileserviceServer ¶
func RegisterFileserviceServer(s grpc.ServiceRegistrar, srv FileserviceServer)
Types ¶
type FileChunk ¶
type FileChunk struct { Chunk []byte `protobuf:"bytes,1,opt,name=chunk,proto3" json:"chunk,omitempty"` // contains filtered or unexported fields }
message designed to transfer chunks of a file from one machine to another.
func (*FileChunk) Descriptor
deprecated
func (*FileChunk) ProtoMessage ¶
func (*FileChunk) ProtoMessage()
func (*FileChunk) ProtoReflect ¶
func (x *FileChunk) ProtoReflect() protoreflect.Message
type FileRequest ¶
type FileRequest struct { Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // contains filtered or unexported fields }
message designed to request a file.
func (*FileRequest) Descriptor
deprecated
func (*FileRequest) Descriptor() ([]byte, []int)
Deprecated: Use FileRequest.ProtoReflect.Descriptor instead.
func (*FileRequest) GetFilename ¶
func (x *FileRequest) GetFilename() string
func (*FileRequest) ProtoMessage ¶
func (*FileRequest) ProtoMessage()
func (*FileRequest) ProtoReflect ¶
func (x *FileRequest) ProtoReflect() protoreflect.Message
func (*FileRequest) Reset ¶
func (x *FileRequest) Reset()
func (*FileRequest) String ¶
func (x *FileRequest) String() string
type FileserviceClient ¶
type FileserviceClient interface { // rpc designed to upload a file from the machine the // client is running on to the server. DownloadFile(ctx context.Context, opts ...grpc.CallOption) (Fileservice_DownloadFileClient, error) // rpc designed to download a file to the machine the // client is running on from the server. UploadFile(ctx context.Context, in *FileRequest, opts ...grpc.CallOption) (Fileservice_UploadFileClient, error) }
FileserviceClient is the client API for Fileservice 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 NewFileserviceClient ¶
func NewFileserviceClient(cc grpc.ClientConnInterface) FileserviceClient
type FileserviceServer ¶
type FileserviceServer interface { // rpc designed to upload a file from the machine the // client is running on to the server. DownloadFile(Fileservice_DownloadFileServer) error // rpc designed to download a file to the machine the // client is running on from the server. UploadFile(*FileRequest, Fileservice_UploadFileServer) error // contains filtered or unexported methods }
FileserviceServer is the server API for Fileservice service. All implementations must embed UnimplementedFileserviceServer for forward compatibility
type Fileservice_DownloadFileClient ¶
type Fileservice_DownloadFileClient interface { Send(*FileChunk) error CloseAndRecv() (*common.StatusMessage, error) grpc.ClientStream }
type Fileservice_DownloadFileServer ¶
type Fileservice_DownloadFileServer interface { SendAndClose(*common.StatusMessage) error Recv() (*FileChunk, error) grpc.ServerStream }
type Fileservice_UploadFileClient ¶
type Fileservice_UploadFileClient interface { Recv() (*FileChunk, error) grpc.ClientStream }
type Fileservice_UploadFileServer ¶
type Fileservice_UploadFileServer interface { Send(*FileChunk) error grpc.ServerStream }
type UnimplementedFileserviceServer ¶
type UnimplementedFileserviceServer struct { }
UnimplementedFileserviceServer must be embedded to have forward compatible implementations.
func (UnimplementedFileserviceServer) DownloadFile ¶
func (UnimplementedFileserviceServer) DownloadFile(Fileservice_DownloadFileServer) error
func (UnimplementedFileserviceServer) UploadFile ¶
func (UnimplementedFileserviceServer) UploadFile(*FileRequest, Fileservice_UploadFileServer) error
type UnsafeFileserviceServer ¶
type UnsafeFileserviceServer interface {
// contains filtered or unexported methods
}
UnsafeFileserviceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to FileserviceServer will result in compilation errors.