Documentation ¶
Index ¶
- Constants
- func ReceiveByteStrings(receiver ByteReceiver, fptr *os.File) (err error)
- func ReceiveFileBytes(receiver Receiver, fptr *os.File) (err error)
- func TransmitByteStrings(transmitter ByteTransmitter, byteReader *bytes.Reader) (err error)
- func TransmitFileBytes(transmitter Transmitter, scanner *bufio.Reader) (err error)
- type ByteReceiver
- type ByteTransmitter
- type Receiver
- type Transmitter
Constants ¶
const CHUNKSIZE int = 1024
amount of bytes each file chunk will contain when uploading or downloading a file.
const DEFAULTTIMEOUT int = 15
default timeout to use for timeout contexts. defaults to 15 (usually seconds).
Variables ¶
This section is empty.
Functions ¶
func ReceiveByteStrings ¶
func ReceiveByteStrings(receiver ByteReceiver, fptr *os.File) (err error)
function designed to read ByteStrings from a stream and save the data to a file.
func ReceiveFileBytes ¶
function designed to read bytes from a stream and save them to a file.
func TransmitByteStrings ¶
func TransmitByteStrings(transmitter ByteTransmitter, byteReader *bytes.Reader) (err error)
function designed to transmit bytes over the wire using ByteString objects.
func TransmitFileBytes ¶
func TransmitFileBytes(transmitter Transmitter, scanner *bufio.Reader) (err error)
function designed to read a file and transmit its contents to another machine via a Transmitter object. this takes in a pointer to a bufio.Reader object which should already be pointing to a target file.
Types ¶
type ByteReceiver ¶
type ByteReceiver interface {
Recv() (*common.ByteString, error)
}
a generic object designed to read ByteString data via a Recv function.
type ByteTransmitter ¶
type ByteTransmitter interface {
Send(*common.ByteString) error
}
a generic object designed to transmit ByteString data via a Send function.
type Receiver ¶
type Receiver interface {
Recv() (*filehandler.FileChunk, error)
}
a generic object designed to read FileChunk data via a Recv function.
type Transmitter ¶
type Transmitter interface {
Send(*filehandler.FileChunk) error
}
a generic object designed to transmit FileChunk data via a Send function.