Documentation ¶
Overview ¶
Package config exposes configuration information
Index ¶
- func SetRemoteProvider(name string, factory RemoteConfigFactory)
- type Monkey
- func (m *Monkey) AccountEnabled(account string) (bool, error)
- func (m *Monkey) Accounts() ([]string, error)
- func (m *Monkey) BindPFlag(parameter string, flag *pflag.Flag) (err error)
- func (m *Monkey) CronExpression() (string, error)
- func (m *Monkey) CronPath() string
- func (m *Monkey) DatabaseEncryptedPassword() string
- func (m *Monkey) DatabaseHost() string
- func (m *Monkey) DatabaseName() string
- func (m *Monkey) DatabasePort() int
- func (m *Monkey) DatabaseUser() string
- func (m *Monkey) Decryptor() string
- func (m *Monkey) Enabled() (bool, error)
- func (m *Monkey) EndHour() int
- func (m *Monkey) ErrorCounter() string
- func (m *Monkey) Leashed() (bool, error)
- func (m *Monkey) Location() (*time.Location, error)
- func (m *Monkey) LogPath() string
- func (m *Monkey) MaxApps() int
- func (m *Monkey) OutageChecker() string
- func (m *Monkey) ScheduleCronPath() string
- func (m *Monkey) ScheduleEnabled() (bool, error)
- func (m *Monkey) SchedulePath() string
- func (m *Monkey) Set(key string, value interface{})
- func (m *Monkey) SetRemoteProvider(provider string, endpoint string, path string) error
- func (m *Monkey) SpinnakerCertificate() string
- func (m *Monkey) SpinnakerEncryptedPassword() string
- func (m *Monkey) SpinnakerEndpoint() string
- func (m *Monkey) SpinnakerUser() string
- func (m *Monkey) StartHour() int
- func (m *Monkey) TermAccount() string
- func (m *Monkey) TermPath() string
- func (m *Monkey) Trackers() ([]string, error)
- type RemoteConfigFactory
- type RemoteProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRemoteProvider ¶
func SetRemoteProvider(name string, factory RemoteConfigFactory)
SetRemoteProvider sets viper's remote provider
Types ¶
type Monkey ¶
type Monkey struct {
// contains filtered or unexported fields
}
Monkey is is a config implementation backed by viper
func Defaults ¶
func Defaults() *Monkey
Defaults returns a Monkey config that just has the default values set it will not load local files or remote ones
func NewFromReader ¶
NewFromReader returns a Monkey config which parses the initial config from a reader. It may load remote if configured to Config file must be in toml format
func (*Monkey) AccountEnabled ¶
AccountEnabled returns true if Chaos Monkey is enabled for that account
func (*Monkey) CronExpression ¶
CronExpression returns the chaosmonkey main run cron expression. It defaults to 2 hour before start_hour on weekdays, if no cron expression is specified in the config
func (*Monkey) CronPath ¶
CronPath returns the path to where Chaos Monkey puts the cron job file with daily terminations
func (*Monkey) DatabaseEncryptedPassword ¶
DatabaseEncryptedPassword returns an encrypted version of the database credentials
func (*Monkey) DatabaseHost ¶
DatabaseHost returns the hostname the database is running on
func (*Monkey) DatabaseName ¶
DatabaseName returns the name of the database that stores the Chaos Monkey state
func (*Monkey) DatabasePort ¶
DatabasePort returns the port the database is listening on
func (*Monkey) DatabaseUser ¶
DatabaseUser returns the database user associated with the credentials
func (*Monkey) EndHour ¶
EndHour (o'clock) is the time after which Chaos Monkey will not terminate instances. this value is in [0,23] This is time-zone dependent, see the Location method
func (*Monkey) ErrorCounter ¶
ErrorCounter returns the names of the backend implementions for error counters. Intended for monitoring/alerting.
func (*Monkey) Leashed ¶
Leashed returns true if Chaos Monkey is leashed In leashed mode, Chaos Monkey records terminations but does not actually terminate
func (*Monkey) Location ¶
Location returns the time zone of StartHour and EndHour. May return an error if time.LoadLocation fails
func (*Monkey) OutageChecker ¶
OutageChecker returns an interface for checking if there is an ongoing outage
func (*Monkey) ScheduleCronPath ¶
ScheduleCronPath returns the path to which main chaosmonkey crontab is located
func (*Monkey) ScheduleEnabled ¶
ScheduleEnabled returns true if Chaos Monkey termination scheduling is enabled if false, Chaos Monkey will not generate a termination schedule
func (*Monkey) SchedulePath ¶
SchedulePath returns the path to which main chaosmonkey schedule script(invoked from cron) is located
func (*Monkey) SetRemoteProvider ¶
SetRemoteProvider sets remote configuration parameters. These will typically be set by parsing the config files. This method exists to facilitate testing
func (*Monkey) SpinnakerCertificate ¶
SpinnakerCertificate retunrs a path to a .p12 file that contains a TLS cert for authenticating against Spinnaker
func (*Monkey) SpinnakerEncryptedPassword ¶
SpinnakerEncryptedPassword returns an password that is used to decrypt the Spinnaker certificate. The encryption scheme is defined by the Decryptor parameter
func (*Monkey) SpinnakerEndpoint ¶
SpinnakerEndpoint returns the spinnaker endpoint
func (*Monkey) SpinnakerUser ¶
SpinnakerUser is sent in the "user" field in the terminateInstances task sent to Spinnaker when Spinnaker terminates an instance
func (*Monkey) StartHour ¶
StartHour (o'clock) is when Chaos Monkey starts terminating this value is in [0,23] This is time-zone dependent, see the Location method
func (*Monkey) TermAccount ¶
TermAccount returns the account that cron will use to execute the termination command
type RemoteConfigFactory ¶
type RemoteConfigFactory interface { Get(rp RemoteProvider) (io.Reader, error) Watch(rp RemoteProvider) (io.Reader, error) }
RemoteConfigFactory is the same interface as viper.remoteConfigFactory This is a workaround to be able to support backends other than etc/consul without modifying viper