forked from go-acme/lego
-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.go
74 lines (62 loc) · 1.97 KB
/
models.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
package internal
type APIError struct {
Error ErrorContent `json:"error"`
}
type ErrorContent struct {
Code int `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
type Authorization struct {
Email string `json:"email,omitempty"`
Password string `json:"password,omitempty"`
}
type AuthResponse struct {
Auth Auth `json:"auth,omitempty"`
}
type Auth struct {
AccessToken string `json:"accessToken,omitempty"`
RefreshToken string `json:"refreshToken,omitempty"`
}
type SearchQuery struct {
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
Search []Search `json:"search,omitempty"`
Sort []Sort `json:"sort,omitempty"`
}
// Search used for searches in the CloudDNS API.
type Search struct {
Name string `json:"name,omitempty"`
Operator string `json:"operator,omitempty"`
Type string `json:"type,omitempty"`
Value string `json:"value,omitempty"`
}
type Sort struct {
Ascending bool `json:"ascending,omitempty"`
Name string `json:"name,omitempty"`
}
type SearchResponse struct {
Items []Domain `json:"items,omitempty"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
TotalHits int `json:"totalHits,omitempty"`
}
type Domain struct {
ID string `json:"id,omitempty"`
DomainName string `json:"domainName,omitempty"`
Status string `json:"status,omitempty"`
}
// Record represents a DNS record.
type Record struct {
ID string `json:"id,omitempty"`
DomainID string `json:"domainId,omitempty"`
Name string `json:"name,omitempty"`
Value string `json:"value,omitempty"`
Type string `json:"type,omitempty"`
}
type DomainInfo struct {
ID string `json:"id,omitempty"`
DomainName string `json:"domainName,omitempty"`
LastDomainRecordList []Record `json:"lastDomainRecordList,omitempty"`
SoaTTL int `json:"soaTtl,omitempty"`
Status string `json:"status,omitempty"`
}