config

package
v2.0.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2016 License: Apache-2.0 Imports: 12 Imported by: 165

Documentation

Overview

Package config exposes configuration information

Index

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 Load

func Load(configPaths []string) (*Monkey, error)

Load returns a Monkey config that loads config from a file

func NewFromReader

func NewFromReader(in io.Reader) (*Monkey, error)

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

func (m *Monkey) AccountEnabled(account string) (bool, error)

AccountEnabled returns true if Chaos Monkey is enabled for that account

func (*Monkey) Accounts

func (m *Monkey) Accounts() ([]string, error)

Accounts return a list of accounts where Choas Monkey is enabled

func (*Monkey) BindPFlag

func (m *Monkey) BindPFlag(parameter string, flag *pflag.Flag) (err error)

BindPFlag binds a specific parameter to a pflag

func (*Monkey) CronExpression

func (m *Monkey) CronExpression() (string, error)

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

func (m *Monkey) CronPath() string

CronPath returns the path to where Chaos Monkey puts the cron job file with daily terminations

func (*Monkey) DatabaseEncryptedPassword

func (m *Monkey) DatabaseEncryptedPassword() string

DatabaseEncryptedPassword returns an encrypted version of the database credentials

func (*Monkey) DatabaseHost

func (m *Monkey) DatabaseHost() string

DatabaseHost returns the hostname the database is running on

func (*Monkey) DatabaseName

func (m *Monkey) DatabaseName() string

DatabaseName returns the name of the database that stores the Chaos Monkey state

func (*Monkey) DatabasePort

func (m *Monkey) DatabasePort() int

DatabasePort returns the port the database is listening on

func (*Monkey) DatabaseUser

func (m *Monkey) DatabaseUser() string

DatabaseUser returns the database user associated with the credentials

func (*Monkey) Decryptor

func (m *Monkey) Decryptor() string

Decryptor returns an interface for decrypting sercrets

func (*Monkey) Enabled

func (m *Monkey) Enabled() (bool, error)

Enabled returns true if Chaos Monkey is enabled

func (*Monkey) EndHour

func (m *Monkey) EndHour() int

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

func (m *Monkey) ErrorCounter() string

ErrorCounter returns the names of the backend implementions for error counters. Intended for monitoring/alerting.

func (*Monkey) Leashed

func (m *Monkey) Leashed() (bool, error)

Leashed returns true if Chaos Monkey is leashed In leashed mode, Chaos Monkey records terminations but does not actually terminate

func (*Monkey) Location

func (m *Monkey) Location() (*time.Location, error)

Location returns the time zone of StartHour and EndHour. May return an error if time.LoadLocation fails

func (*Monkey) LogPath

func (m *Monkey) LogPath() string

LogPath returns the path to which log files should be written

func (*Monkey) MaxApps

func (m *Monkey) MaxApps() int

MaxApps returns the maximum number of apps to examine for termination

func (*Monkey) OutageChecker

func (m *Monkey) OutageChecker() string

OutageChecker returns an interface for checking if there is an ongoing outage

func (*Monkey) ScheduleCronPath

func (m *Monkey) ScheduleCronPath() string

ScheduleCronPath returns the path to which main chaosmonkey crontab is located

func (*Monkey) ScheduleEnabled

func (m *Monkey) ScheduleEnabled() (bool, error)

ScheduleEnabled returns true if Chaos Monkey termination scheduling is enabled if false, Chaos Monkey will not generate a termination schedule

func (*Monkey) SchedulePath

func (m *Monkey) SchedulePath() string

SchedulePath returns the path to which main chaosmonkey schedule script(invoked from cron) is located

func (*Monkey) Set

func (m *Monkey) Set(key string, value interface{})

Set overrides the config value. Used for testing

func (*Monkey) SetRemoteProvider

func (m *Monkey) SetRemoteProvider(provider string, endpoint string, path string) error

SetRemoteProvider sets remote configuration parameters. These will typically be set by parsing the config files. This method exists to facilitate testing

func (*Monkey) SpinnakerCertificate

func (m *Monkey) SpinnakerCertificate() string

SpinnakerCertificate retunrs a path to a .p12 file that contains a TLS cert for authenticating against Spinnaker

func (*Monkey) SpinnakerEncryptedPassword

func (m *Monkey) SpinnakerEncryptedPassword() string

SpinnakerEncryptedPassword returns an password that is used to decrypt the Spinnaker certificate. The encryption scheme is defined by the Decryptor parameter

func (*Monkey) SpinnakerEndpoint

func (m *Monkey) SpinnakerEndpoint() string

SpinnakerEndpoint returns the spinnaker endpoint

func (*Monkey) SpinnakerUser

func (m *Monkey) SpinnakerUser() string

SpinnakerUser is sent in the "user" field in the terminateInstances task sent to Spinnaker when Spinnaker terminates an instance

func (*Monkey) StartHour

func (m *Monkey) StartHour() int

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

func (m *Monkey) TermAccount() string

TermAccount returns the account that cron will use to execute the termination command

func (*Monkey) TermPath

func (m *Monkey) TermPath() string

TermPath returns the path to the executable that wraps the chaos monkey binary for terminating instances

func (*Monkey) Trackers

func (m *Monkey) Trackers() ([]string, error)

Trackers returns the names of the backend implementation for termination trackers. Used for things like logging and metrics collection

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

type RemoteProvider

type RemoteProvider viper.RemoteProvider

RemoteProvider is a type alias

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL