added client calls for running servers

This commit is contained in:
2021-03-07 18:40:45 -09:00
parent 86f304e1b8
commit aa65b64867
4 changed files with 90 additions and 4 deletions

View File

@ -15,6 +15,14 @@ type Command struct {
Signature []byte `json:"sig,omitempty"`
}
func NewCommand(cm string) *Command {
return &Command{
Expires: time.Now().Add(time.Second * 5),
Command: cm,
Scheme: "hmac-sha256",
}
}
func ParseCommand(jsn []byte) (*Command, error) {
cmd := &Command{}
err := json.Unmarshal(jsn, cmd)