feature: Adds more commands and adds an example.
This commit is contained in:
parent
0d0f16174b
commit
3cb9526716
9 changed files with 352 additions and 41 deletions
|
@ -156,8 +156,8 @@ func Marshal(commandType string, command interface{}) ([]byte, error) {
|
|||
removeConnectionBytes[6+len(ipBytes)] = protocol
|
||||
|
||||
return removeConnectionBytes, nil
|
||||
case "getAllConnections":
|
||||
allConnectionsCommand, ok := command.(*GetAllConnections)
|
||||
case "connectionsResponse":
|
||||
allConnectionsCommand, ok := command.(*ConnectionsResponse)
|
||||
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("failed to typecast")
|
||||
|
@ -247,9 +247,9 @@ func Marshal(commandType string, command interface{}) ([]byte, error) {
|
|||
|
||||
var checkMethod uint8
|
||||
|
||||
if checkParametersCommand.InReplyTo == "checkClientParameters" {
|
||||
if checkParametersCommand.InResponseTo == "checkClientParameters" {
|
||||
checkMethod = CheckClientParametersID
|
||||
} else if checkParametersCommand.InReplyTo == "checkServerParameters" {
|
||||
} else if checkParametersCommand.InResponseTo == "checkServerParameters" {
|
||||
checkMethod = CheckServerParametersID
|
||||
} else {
|
||||
return nil, fmt.Errorf("invalid mode recieved (must be either checkClientParameters or checkServerParameters)")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue