Documentation
¶
Index ¶
- func DeterminePacketSize(data []byte) uint16
- func Handshake(conn *net.TCPConn) *[32]byte
- type OperationTypeEnum
- type PacketListData
- type PacketReceiveDataNext
- type PacketReceiveDataStartRequest
- type PacketReceiveDataStartResponse
- type PacketReceiveDataStartResponseEnum
- type PacketSendDataNext
- type PacketSendDataStart
- type PacketStartRequest
- type PacketStartResponse
- type PacketStartResponseEnum
- type SecureConnection
- type SecureMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeterminePacketSize ¶
Types ¶
type OperationTypeEnum ¶
type OperationTypeEnum byte
const ( OperationTypeSend OperationTypeEnum = iota OperationTypeList OperationTypeReceive )
type PacketListData ¶
type PacketReceiveDataNext ¶
type PacketReceiveDataStartRequest ¶
type PacketReceiveDataStartRequest struct {
Id uint32
}
PacketReceiveDataStart is sent from the server to the client when the client asks for a file to be sent to them.
type PacketReceiveDataStartResponse ¶
type PacketReceiveDataStartResponse struct { Status PacketReceiveDataStartResponseEnum Filename string Kind string TotalSize uint32 }
PacketReceiveDataStartResponse is the response to the above packet.
type PacketReceiveDataStartResponseEnum ¶
type PacketReceiveDataStartResponseEnum byte
const ( // File transfer can begin ReceiveDataStartResponseOK PacketReceiveDataStartResponseEnum = iota // No such file by index ReceiveDataStartResponseNotFound )
type PacketSendDataNext ¶
type PacketSendDataStart ¶
type PacketStartRequest ¶
type PacketStartRequest struct { OperationType OperationTypeEnum ClientName string ProtocolVersion string AuthToken string }
PacketStartRequest is sent from the client to the server at the beginning to authenticate and annonce the requested particular operation
type PacketStartResponse ¶
type PacketStartResponse struct {
Response PacketStartResponseEnum
}
type PacketStartResponseEnum ¶
type PacketStartResponseEnum byte
const ( // Client can connect PacketStartResponseEnumOK PacketStartResponseEnum = iota // Client using wrong protocol version PacketStartResponseEnumWrongProtocol // Client supplied bad auth token PacketStartResponseEnumBadAuthToken )
type SecureConnection ¶
type SecureConnection struct { // Conn *net.TCPConn Conn io.ReadWriteCloser Buffer *bytes.Buffer }
type SecureMessage ¶
func ConstructSecureMessage ¶
func ConstructSecureMessage(sm []byte) SecureMessage
Click to show internal directories.
Click to hide internal directories.