Documentation ¶
Index ¶
- type File
- type TorrxferServer
- func (s *TorrxferServer) Close(clientID string)
- func (s *TorrxferServer) QueryFunction(clientID string, file *net.RPCFile) (*net.RPCFile, error)
- func (s *TorrxferServer) RegisterForWriteNotification(clientID string) (chan error, chan struct{})
- func (s *TorrxferServer) TransferFunction(clientID string, fileBytes []byte, blockSize uint32, currentOffset uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
File server representation of a file
func (*File) GenerateRPCFile ¶
GenerateRPCFile returns common RPC representation of a server file
func (*File) MarshalText ¶
MarshalText converts the clientFile representation to a utf encoded byte array
func (*File) UnmarshalText ¶
UnmarshalText takes a utf encoded byte array and builds a ClientFile object from it
type TorrxferServer ¶
TorrxferServer server struct
func RunServer ¶
func RunServer(serverConf common.ServerConfig, enableTLS bool, cafilePath, keyfilePath string) *TorrxferServer
RunServer starts the server
func (*TorrxferServer) Close ¶
func (s *TorrxferServer) Close(clientID string)
Close closes the active file for the clientID
func (*TorrxferServer) QueryFunction ¶
QueryFunction implementation for gRPC call query file. Returns current file information and sets the file as a target for that connection clientID
func (*TorrxferServer) RegisterForWriteNotification ¶
func (s *TorrxferServer) RegisterForWriteNotification(clientID string) (chan error, chan struct{})
RegisterForWriteNotification returns the notification channel for the clientID
func (*TorrxferServer) TransferFunction ¶
func (s *TorrxferServer) TransferFunction(clientID string, fileBytes []byte, blockSize uint32, currentOffset uint64) error
TransferFunction gRPC TransferFile implementation. Writes the file bytes at the specified offset to the currently active file for the clientID