|
@@ -64,6 +64,7 @@ type Config struct {
|
|
|
MaxClusterSize int `toml:"max_cluster_size" env:"ETCD_MAX_CLUSTER_SIZE"`
|
|
MaxClusterSize int `toml:"max_cluster_size" env:"ETCD_MAX_CLUSTER_SIZE"`
|
|
|
MaxResultBuffer int `toml:"max_result_buffer" env:"ETCD_MAX_RESULT_BUFFER"`
|
|
MaxResultBuffer int `toml:"max_result_buffer" env:"ETCD_MAX_RESULT_BUFFER"`
|
|
|
MaxRetryAttempts int `toml:"max_retry_attempts" env:"ETCD_MAX_RETRY_ATTEMPTS"`
|
|
MaxRetryAttempts int `toml:"max_retry_attempts" env:"ETCD_MAX_RETRY_ATTEMPTS"`
|
|
|
|
|
+ RetryInterval float64 `toml:"retry_interval" env:"ETCD_RETRY_INTERVAL"`
|
|
|
Name string `toml:"name" env:"ETCD_NAME"`
|
|
Name string `toml:"name" env:"ETCD_NAME"`
|
|
|
Snapshot bool `toml:"snapshot" env:"ETCD_SNAPSHOT"`
|
|
Snapshot bool `toml:"snapshot" env:"ETCD_SNAPSHOT"`
|
|
|
SnapshotCount int `toml:"snapshot_count" env:"ETCD_SNAPSHOTCOUNT"`
|
|
SnapshotCount int `toml:"snapshot_count" env:"ETCD_SNAPSHOTCOUNT"`
|
|
@@ -93,6 +94,7 @@ func New() *Config {
|
|
|
c.MaxClusterSize = 9
|
|
c.MaxClusterSize = 9
|
|
|
c.MaxResultBuffer = 1024
|
|
c.MaxResultBuffer = 1024
|
|
|
c.MaxRetryAttempts = 3
|
|
c.MaxRetryAttempts = 3
|
|
|
|
|
+ c.RetryInterval = 10.0
|
|
|
c.Snapshot = true
|
|
c.Snapshot = true
|
|
|
c.SnapshotCount = 10000
|
|
c.SnapshotCount = 10000
|
|
|
c.Peer.Addr = "127.0.0.1:7001"
|
|
c.Peer.Addr = "127.0.0.1:7001"
|
|
@@ -282,6 +284,7 @@ func (c *Config) LoadFlags(arguments []string) error {
|
|
|
f.StringVar(&c.DataDir, "data-dir", c.DataDir, "")
|
|
f.StringVar(&c.DataDir, "data-dir", c.DataDir, "")
|
|
|
f.IntVar(&c.MaxResultBuffer, "max-result-buffer", c.MaxResultBuffer, "")
|
|
f.IntVar(&c.MaxResultBuffer, "max-result-buffer", c.MaxResultBuffer, "")
|
|
|
f.IntVar(&c.MaxRetryAttempts, "max-retry-attempts", c.MaxRetryAttempts, "")
|
|
f.IntVar(&c.MaxRetryAttempts, "max-retry-attempts", c.MaxRetryAttempts, "")
|
|
|
|
|
+ f.Float64Var(&c.RetryInterval, "retry-interval", c.RetryInterval, "")
|
|
|
f.IntVar(&c.MaxClusterSize, "max-cluster-size", c.MaxClusterSize, "")
|
|
f.IntVar(&c.MaxClusterSize, "max-cluster-size", c.MaxClusterSize, "")
|
|
|
f.IntVar(&c.Peer.HeartbeatTimeout, "peer-heartbeat-timeout", c.Peer.HeartbeatTimeout, "")
|
|
f.IntVar(&c.Peer.HeartbeatTimeout, "peer-heartbeat-timeout", c.Peer.HeartbeatTimeout, "")
|
|
|
f.IntVar(&c.Peer.ElectionTimeout, "peer-election-timeout", c.Peer.ElectionTimeout, "")
|
|
f.IntVar(&c.Peer.ElectionTimeout, "peer-election-timeout", c.Peer.ElectionTimeout, "")
|