-
Notifications
You must be signed in to change notification settings - Fork 0
/
configStructs.go
95 lines (83 loc) · 2.57 KB
/
configStructs.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package main
// Config for Application
type Config struct {
Server serverConfig `yaml:"server"`
Webhook webhookConfig `yaml:"webhook"`
DataStore dataStoreConfig `yaml:"dataStore"`
ZoneDefault zoneDefaultConfig `yaml:"zoneDefault"`
Zones []zoneConfig `yaml:"zones"`
TsigSecrets []tsigSecretConfig `yaml:"tsigSecrets"`
Netbox netboxConfig `yaml:"netbox"`
Slack slackConfig `yaml:"slack"`
}
type dataStoreConfig struct {
Mode string `yaml:"mode"`
Path string `yaml:"path"`
}
type webhookConfig struct {
Listen string `yaml:"listen"`
Timeout string `yaml:"timeout"`
AllowFrom []string `yaml:"allowFrom"`
}
type serverConfig struct {
CPUProfile *string `yaml:"cpuProfile"`
CPU *int `yaml:"cpu"`
SoReuseport *uint32 `yaml:"soReuseport"`
Listen []string `yaml:"listen"`
}
type zoneConfig struct {
Suffix string `yaml:"suffix"`
Origin *string `yaml:"origin"`
SOA soaConfig `yaml:"soa"`
TTL *uint32 `yaml:"ttl"`
NS *[]string `yaml:"ns"`
Records *[]addtionalRecordConfig `yaml:"records"`
AllowTransfer *[]string `yaml:"allowTransfer"`
}
type addtionalRecordConfig struct {
Name string `yaml:"name"`
CNAME *string `yaml:"cname"`
TXT *string `yaml:"txt"`
}
type tsigSecretConfig struct {
Name string `yaml:"name"`
Secret string `yaml:"secret"`
}
type zoneDefaultConfig struct {
SOA soaConfig `yaml:"soa"`
TTL *uint32 `yaml:"ttl"`
NS *[]string `yaml:"ns"`
AllowTransfer *[]string `yaml:"allowTransfer"`
}
type soaConfig struct {
NS *string `yaml:"ns"`
MBox *string `yaml:"mBox"`
Refresh *uint32 `yaml:"refresh"`
Retry *uint32 `yaml:"retry"`
Expire *uint32 `yaml:"expire"`
MinTTL *uint32 `yaml:"minTTL"`
}
type netboxConfig struct {
Host string `yaml:"host"`
ServerName *string `yaml:"serverName"`
UseTLS bool `yaml:"useTLS"`
VerifyTLS bool `yaml:"verifyTLS"`
Token string `yaml:"token"`
Mode string `yaml:"mode"`
Interval string `yaml:"interval"`
}
type soa struct {
NS string `yaml:"ns"`
MBox string `yaml:"mBox"`
Refresh uint32 `yaml:"refresh"`
Retry uint32 `yaml:"retry"`
Expire uint32 `yaml:"expire"`
MinTTL uint32 `yaml:"minTTL"`
}
type slackConfig struct {
WebhookURL string `yaml:"webhookURL"`
Channel string `yaml:"channel"`
Name string `yaml:"name"`
IconURL string `yaml:"iconURL"`
IcomEmoji string `yaml:"iconEmoji"`
}