-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem.go
More file actions
38 lines (34 loc) · 934 Bytes
/
system.go
File metadata and controls
38 lines (34 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package xapi
import (
"github.com/MateoGreil/xapi-go/internal/protocols/socket"
)
func (c *client) GetServerTime() (socket.ServerTime, error) {
request := struct {
Command string `json:"command"`
}{Command: "getServerTime"}
var result socket.ServerTime
if err := c.sendSocketCommand(request, &result); err != nil {
return socket.ServerTime{}, err
}
return result, nil
}
func (c *client) GetStepRules() ([]socket.StepRule, error) {
request := struct {
Command string `json:"command"`
}{Command: "getStepRules"}
var result []socket.StepRule
if err := c.sendSocketCommand(request, &result); err != nil {
return nil, err
}
return result, nil
}
func (c *client) GetVersion() (string, error) {
request := struct {
Command string `json:"command"`
}{Command: "getVersion"}
var result socket.Version
if err := c.sendSocketCommand(request, &result); err != nil {
return "", err
}
return result.Version, nil
}