This repository has been archived by the owner on Jul 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ip.go
58 lines (54 loc) · 1.42 KB
/
ip.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
package config
import "gopkg.in/urfave/cli.v2"
func RequiredIPSliceFlags() []string {
return []string{
"mysql-ip",
"diego-cell-ip",
"consul-ip",
"doppler-ip",
"mysql-proxy-ip",
"loggregator-traffic-controller-ip",
"nats-machine-ip",
"etcd-machine-ip",
"diego-brain-ip",
"diego-db-ip",
"router-ip",
}
}
func RequiredIPFlags() []string {
return []string{
"nfs-ip",
}
}
func NewIP(c *cli.Context) IP {
return IP{
MySQLIPs: c.StringSlice("mysql-ip"),
NFSIP: c.String("nfs-ip"),
DiegoCellIPs: c.StringSlice("diego-cell-ip"),
ConsulIPs: c.StringSlice("consul-ip"),
DopplerIPs: c.StringSlice("doppler-ip"),
MySQLProxyIPs: c.StringSlice("mysql-proxy-ip"),
LoggregratorIPs: c.StringSlice("loggregator-traffic-controller-ip"),
NATSMachines: c.StringSlice("nats-machine-ip"),
HAProxyIPs: c.StringSlice("haproxy-ip"),
EtcdMachines: c.StringSlice("etcd-machine-ip"),
DiegoBrainIPs: c.StringSlice("diego-brain-ip"),
DiegoDBIPs: c.StringSlice("diego-db-ip"),
RouterMachines: c.StringSlice("router-ip"),
}
}
type IP struct {
HAProxyIPs []string
NFSIP string
MySQLIPs []string
LoggregratorIPs []string
DopplerIPs []string
EtcdMachines []string
DiegoCellIPs []string
ConsulIPs []string
DiegoBrainIPs []string
MySQLProxyIPs []string
RouterMachines []string
DiegoDBIPs []string
NATSMachines []string
}