-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlicense.go
40 lines (35 loc) · 1.02 KB
/
license.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
package directadmin
import (
"fmt"
"net/http"
"time"
)
type License struct {
Expires time.Time `json:"expires"`
Lid int `json:"lid"`
Limits struct {
Legacy bool `json:"legacy"`
MaxAdminsOrResellers int `json:"maxAdminsOrResellers"`
MaxDomains int `json:"maxDomains"`
MaxUsers int `json:"maxUsers"`
OnlyVPS bool `json:"onlyVPS"`
ProPack bool `json:"proPack"`
Trial bool `json:"trial"`
} `json:"limits"`
Name string `json:"name"`
Pid int `json:"pid"`
Type string `json:"type"`
Uid int `json:"uid"`
Usage struct {
AdminsOrResellers int `json:"adminsOrResellers"`
Domains int `json:"domains"`
Users int `json:"users"`
} `json:"usage"`
}
func (c *AdminContext) GetLicense() (*License, error) {
var license License
if _, err := c.makeRequestNew(http.MethodGet, "license", nil, &license); err != nil {
return nil, fmt.Errorf("failed to get license: %v", err)
}
return &license, nil
}