Documentation ¶
Index ¶
- Constants
- type Config
- func (c *Config) ClusterConfig() *server.ClusterConfig
- func (c *Config) DataDirFromName()
- func (c *Config) EtcdTLSInfo() *server.TLSInfo
- func (c *Config) Load(arguments []string) error
- func (c *Config) LoadEnv() error
- func (c *Config) LoadFile(path string) error
- func (c *Config) LoadFlags(arguments []string) error
- func (c *Config) LoadPeersFile() error
- func (c *Config) LoadSystemFile() error
- func (c *Config) MetricsBucketName() string
- func (c *Config) NameFromHostname()
- func (c *Config) PeerTLSInfo() *server.TLSInfo
- func (c *Config) Reset() error
- func (c *Config) Sanitize() error
- func (c *Config) Trace() bool
Constants ¶
const DefaultSystemConfigPath = "/etc/etcd/etcd.conf"
The default location for the etcd configuration file.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SystemPath string Addr string `toml:"addr" env:"ETCD_ADDR"` BindAddr string `toml:"bind_addr" env:"ETCD_BIND_ADDR"` CAFile string `toml:"ca_file" env:"ETCD_CA_FILE"` CertFile string `toml:"cert_file" env:"ETCD_CERT_FILE"` CPUProfileFile string CorsOrigins []string `toml:"cors" env:"ETCD_CORS"` DataDir string `toml:"data_dir" env:"ETCD_DATA_DIR"` Discovery string `toml:"discovery" env:"ETCD_DISCOVERY"` Force bool KeyFile string `toml:"key_file" env:"ETCD_KEY_FILE"` Peers []string `toml:"peers" env:"ETCD_PEERS"` PeersFile string `toml:"peers_file" env:"ETCD_PEERS_FILE"` MaxResultBuffer int `toml:"max_result_buffer" env:"ETCD_MAX_RESULT_BUFFER"` 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"` Snapshot bool `toml:"snapshot" env:"ETCD_SNAPSHOT"` SnapshotCount int `toml:"snapshot_count" env:"ETCD_SNAPSHOTCOUNT"` ShowHelp bool ShowVersion bool Verbose bool `toml:"verbose" env:"ETCD_VERBOSE"` VeryVerbose bool `toml:"very_verbose" env:"ETCD_VERY_VERBOSE"` VeryVeryVerbose bool `toml:"very_very_verbose" env:"ETCD_VERY_VERY_VERBOSE"` 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"` HeartbeatInterval int `toml:"heartbeat_interval" env:"ETCD_PEER_HEARTBEAT_INTERVAL"` ElectionTimeout int `toml:"election_timeout" env:"ETCD_PEER_ELECTION_TIMEOUT"` } GraphiteHost string `toml:"graphite_host" env:"ETCD_GRAPHITE_HOST"` Cluster struct { ActiveSize int `toml:"active_size" env:"ETCD_CLUSTER_ACTIVE_SIZE"` RemoveDelay float64 `toml:"remove_delay" env:"ETCD_CLUSTER_REMOVE_DELAY"` SyncInterval float64 `toml:"sync_interval" env:"ETCD_CLUSTER_SYNC_INTERVAL"` } // contains filtered or unexported fields }
Config represents the server configuration.
func (*Config) ClusterConfig ¶ added in v0.4.0
func (c *Config) ClusterConfig() *server.ClusterConfig
func (*Config) DataDirFromName ¶
func (c *Config) DataDirFromName()
DataDirFromName sets the data dir from a machine name and issue a warning that etcd is guessing.
func (*Config) EtcdTLSInfo ¶
EtcdTLSInfo retrieves a TLSInfo object for the etcd server
func (*Config) Load ¶
Loads the configuration from the system config, command line config, environment variables, and finally command line arguments.
func (*Config) LoadPeersFile ¶
LoadPeersFile loads the peers listed in the peers file.
func (*Config) LoadSystemFile ¶
Loads from the system etcd configuration file if it exists.
func (*Config) MetricsBucketName ¶
MetricsBucketName generates the name that should be used for a corresponding MetricsBucket object
func (*Config) NameFromHostname ¶
func (c *Config) NameFromHostname()
NameFromHostname sets the machine name from the hostname. This is to help people get started without thinking up a name.
func (*Config) PeerTLSInfo ¶
PeerRaftInfo retrieves a TLSInfo object for the peer server.