Refactor and create a start packet response so the client knows it can continue. Start to add command line/config options.
This commit is contained in:
@@ -182,15 +182,30 @@ const (
|
||||
OperationTypeReceive
|
||||
)
|
||||
|
||||
// PacketStart is sent from the client to the server at the beginning
|
||||
// PacketStartRequest is sent from the client to the server at the beginning
|
||||
// to authenticate and annonce the requested particular operation
|
||||
type PacketStart struct {
|
||||
type PacketStartRequest struct {
|
||||
OperationType OperationTypeEnum
|
||||
ClientName string
|
||||
ProtocolVersion string
|
||||
AuthToken string
|
||||
}
|
||||
|
||||
type PacketStartResponseEnum byte
|
||||
|
||||
const (
|
||||
// Client can connect
|
||||
PacketStartResponseEnumOK PacketStartResponseEnum = iota
|
||||
// Client using wrong protocol version
|
||||
PacketStartResponseEnumWrongProtocol
|
||||
// Client supplied bad auth token
|
||||
PacketStartResponseEnumBadAuthToken
|
||||
)
|
||||
|
||||
type PacketStartResponse struct {
|
||||
Response PacketStartResponseEnum
|
||||
}
|
||||
|
||||
type PacketSendDataStart struct {
|
||||
Filename string
|
||||
TotalSize uint32
|
||||
|
||||
Reference in New Issue
Block a user