filehandler

package
v0.0.51 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_filehandler_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use FileChunk.ProtoReflect.Descriptor instead.

func (*FileChunk) GetChunk

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

func (*FileChunk) ProtoMessage

func (*FileChunk) ProtoMessage()

func (*FileChunk) ProtoReflect

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

func (*FileChunk) Reset

func (x *FileChunk) Reset()

func (*FileChunk) String

func (x *FileChunk) String() string

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.

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

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.

Jump to

Keyboard shortcuts

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