-
Notifications
You must be signed in to change notification settings - Fork 1
/
config_types.go
52 lines (43 loc) · 1.41 KB
/
config_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
51
52
package main
// used for config file parsing
type ProbeConfig struct {
CheckInterval uint16 `yaml:"check_interval"`
Timeout uint8 `yaml:"timeout"`
Count uint8 `yaml:"success_count"`
}
type HealthCheckConfig struct {
Protocol string `yaml:"protocol"`
Port uint16 `yaml:"port"`
StartAvailable bool `yaml:"start_available"`
Probe ProbeConfig `yaml:"probe"`
}
type UpstreamDnsConfig struct {
Servers []string `yaml:"servers"`
Ttl uint32 `yaml:"ttl"`
}
type UpstreamsConfig struct {
Name string `yaml:"name"`
Host string `yaml:"host"`
Port uint16 `yaml:"port"`
Dns UpstreamDnsConfig `yaml:"dns"`
HealthCheck HealthCheckConfig `yaml:"health_check"`
}
type UpstreamGroupConfig struct {
Name string `yaml:"name"`
Distribution string `yaml:"distribution"`
Upstreams []UpstreamsConfig `yaml:"upstreams"`
}
type TargetsConfig struct {
Name string `yaml:"name"`
Protocol string `yaml:"protocol"`
Ip string `yaml:"ip"`
Port uint16 `yaml:"port"`
UpstreamGroup UpstreamGroupConfig `yaml:"upstream_group"`
}
type LbConfig struct {
Engine string `yaml:"engine"`
TargetsConfig []TargetsConfig `yaml:"targets"`
}
type ConfigYaml struct {
LbConfig []LbConfig `yaml:"lb"`
}