forked from nylone/CloudflareDDNS-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstructure.go
More file actions
57 lines (48 loc) · 1.29 KB
/
Copy pathstructure.go
File metadata and controls
57 lines (48 loc) · 1.29 KB
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
package main
import (
"time"
)
type config struct {
Token string `fig:"token" validate:"required"`
Timeout time.Duration `fig:"timeout" default:"60s"`
LogLevel string `fig:"loglevel" default:"error"`
Domains map[string]struct {
V4Records map[string]interface{} `fig:"v4-records"`
} `fig:"zones" validate:"required"`
Endpoint string `fig:"endpoint" validate:"required"`
DDDomain string `fig:"dd_domain" validate:"required"`
DDToken string `fig:"dd_token" validate:"required"`
}
// StationJSON is the dumb structure used to unmarshall the request from the router
type StationJSON struct {
WanIP4Addr string `json:"wan_ip4_addr"`
}
type apiZones struct {
Result []struct {
ID string `json:"id"`
Name string `json:"name"`
} `json:"result"`
Success bool `json:"success"`
}
type apiRecords struct {
Result []dnsRecord `json:"result"`
Success bool `json:"success"`
Errors []apiError `json:"errors"`
}
type apiFeedback struct {
Success bool `json:"success"`
Errors []apiError `json:"errors"`
}
type apiError struct {
Code int `json:"code"`
Message string `json:"message"`
}
type dnsRecord struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
}
type zoneAndRecords struct {
ZoneID string
Records []dnsRecord
}