|
|
@@ -67,14 +67,14 @@ type Config struct {
|
|
|
ShowVersion bool
|
|
|
Verbose bool `toml:"verbose" env:"ETCD_VERBOSE"`
|
|
|
VeryVerbose bool `toml:"very_verbose" env:"ETCD_VERY_VERBOSE"`
|
|
|
- HeartbeatTimeout int `toml:"peer_heartbeat_timeout" env:"ETCD_PEER_HEARTBEAT_TIMEOUT"`
|
|
|
- ElectionTimeout int `toml:"peer_election_timeout" env:"ETCD_PEER_ELECTION_TIMEOUT"`
|
|
|
Peer struct {
|
|
|
Addr string `toml:"addr" env:"ETCD_PEER_ADDR"`
|
|
|
BindAddr string `toml:"bind_addr" env:"ETCD_PEER_BIND_ADDR"`
|
|
|
CAFile string `toml:"ca_file" env:"ETCD_PEER_CA_FILE"`
|
|
|
CertFile string `toml:"cert_file" env:"ETCD_PEER_CERT_FILE"`
|
|
|
KeyFile string `toml:"key_file" env:"ETCD_PEER_KEY_FILE"`
|
|
|
+ HeartbeatTimeout int `toml:"heartbeat_timeout" env:"ETCD_PEER_HEARTBEAT_TIMEOUT"`
|
|
|
+ ElectionTimeout int `toml:"election_timeout" env:"ETCD_PEER_ELECTION_TIMEOUT"`
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -86,10 +86,10 @@ func NewConfig() *Config {
|
|
|
c.MaxClusterSize = 9
|
|
|
c.MaxResultBuffer = 1024
|
|
|
c.MaxRetryAttempts = 3
|
|
|
- c.Peer.Addr = "127.0.0.1:7001"
|
|
|
c.SnapshotCount = 10000
|
|
|
- c.ElectionTimeout = 0
|
|
|
- c.HeartbeatTimeout = 0
|
|
|
+ c.Peer.Addr = "127.0.0.1:7001"
|
|
|
+ c.Peer.HeartbeatTimeout = 0
|
|
|
+ c.Peer.ElectionTimeout = 0
|
|
|
return c
|
|
|
}
|
|
|
|
|
|
@@ -236,8 +236,8 @@ func (c *Config) LoadFlags(arguments []string) error {
|
|
|
f.IntVar(&c.MaxResultBuffer, "max-result-buffer", c.MaxResultBuffer, "")
|
|
|
f.IntVar(&c.MaxRetryAttempts, "max-retry-attempts", c.MaxRetryAttempts, "")
|
|
|
f.IntVar(&c.MaxClusterSize, "max-cluster-size", c.MaxClusterSize, "")
|
|
|
- f.IntVar(&c.HeartbeatTimeout, "peer-heartbeat-timeout", c.HeartbeatTimeout, "")
|
|
|
- f.IntVar(&c.ElectionTimeout, "peer-election-timeout", c.ElectionTimeout, "")
|
|
|
+ f.IntVar(&c.Peer.HeartbeatTimeout, "peer-heartbeat-timeout", c.Peer.HeartbeatTimeout, "")
|
|
|
+ f.IntVar(&c.Peer.ElectionTimeout, "peer-election-timeout", c.Peer.ElectionTimeout, "")
|
|
|
|
|
|
f.StringVar(&cors, "cors", "", "")
|
|
|
|