-
-
Notifications
You must be signed in to change notification settings - Fork 977
/
types.go
50 lines (39 loc) · 1.03 KB
/
types.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
package internal
import (
"fmt"
"time"
)
type Token struct {
// The bearer token for use in API requests
Token string `json:"access_token"`
// The maximum lifetime of the token in seconds
Lifetime int `json:"expires_in"`
// The token type (must be 'bearer')
TokenType string `json:"token_type"`
Deadline time.Time `json:"-"`
}
type authResponseError struct {
ErrorMsg string `json:"error"`
ErrorDescription string `json:"error_description"`
}
func (a authResponseError) Error() string {
return fmt.Sprintf("%s: %s", a.ErrorMsg, a.ErrorDescription)
}
type createTXTRequest struct {
Records []createTXTRecord `json:"records"`
}
type createTXTRecord struct {
Host string `json:"host"`
TTL int `json:"ttl"`
Type string `json:"type"`
Data string `json:"data"`
}
type createTXTResponse struct {
Added int `json:"records_added"`
Removed int `json:"records_removed"`
Message string `json:"message"`
}
type deleteTXTResponse struct {
Removed int `json:"records_removed"`
Message string `json:"message"`
}