-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistration.go
49 lines (38 loc) · 1.04 KB
/
registration.go
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
39
40
41
42
43
44
45
46
47
48
49
package harper
type RegistrationInfoResponse struct {
Registered bool `json:"registered"`
Version string `json:"version"`
StorageType string `json:"storage_type"`
RAMAllocation int `json:"ram_allocation"`
LicenseExpirationDate string `json:"license_expiration_date"`
}
func (c *Client) RegistrationInfo() (*RegistrationInfoResponse, error) {
result := RegistrationInfoResponse{}
err := c.opRequest(operation{
Operation: OP_REGISTRATION_INFO,
}, &result)
if err != nil {
return nil, err
}
return &result, nil
}
type GetFingerprintResponse struct {
Message string `json:"message"`
}
func (c *Client) GetFingerprint() (*GetFingerprintResponse, error) {
result := GetFingerprintResponse{}
err := c.opRequest(operation{
Operation: OP_GET_FINGERPRINT,
}, &result)
if err != nil {
return nil, err
}
return &result, nil
}
func (c *Client) SetLicense(key, company string) error {
return c.opRequest(operation{
Operation: OP_SET_LICENSE,
Company: company,
Key: key,
}, nil)
}