Documentation ¶
Overview ¶
Package config declares the data structures used for all execution entry points
Constants
Index ¶
- Constants
- Variables
- func IsUsingStaging() bool
- func LoadDevelopmentCAs(pemFilename string) *x509.CertPool
- func LoadProductionCAs() *x509.CertPool
- func LoadRootCAs(insecure bool, useStaging bool) *x509.CertPool
- func LoadStagingCAs() *x509.CertPool
- type BadConfig
- type Config
- func (cfg *Config) ComputeReadDeadline(offset time.Duration) time.Time
- func (cfg *Config) ComputeWriteDeadline(offset time.Duration) time.Time
- func (cfg *Config) DefineConfigEntries() []configEntry
- func (cfg *Config) LoadFromFile(filepath string) error
- func (cfg *Config) ParseFields(configEntries []configEntry, fields []string) error
- func (cfg *Config) PostProcess() error
- func (cfg *Config) SetPrivateZones(zones []string)
- func (cfg *Config) Validate() error
- type EndpointConfig
Constants ¶
View Source
const ( DefaultTimeoutRead = 10 * time.Second DefaultTimeoutWrite = 10 * time.Second DefaultTimeoutPrepareEnd = 60 * time.Second DefaultAgentId = "-poller-" )
View Source
const ( DefaultConfigPathLinux = "/etc/rackspace-monitoring-agent.cfg" DefaultPort = "50041" EnvStaging = "STAGING" EnvDevCA = "DEV_CA" EnabledEnvOpt = "1" )
Variables ¶
View Source
var ( ErrorNoZones = errors.New("No zones are defined") ErrorNoToken = errors.New("No token is defined") )
View Source
var ( DefaultProdSrvEndpoints = []string{ "_monitoringagent._tcp.dfw1.prod.monitoring.api.rackspacecloud.com", "_monitoringagent._tcp.ord1.prod.monitoring.api.rackspacecloud.com", "_monitoringagent._tcp.lon3.prod.monitoring.api.rackspacecloud.com", } DefaultStagingSrvEndpoints = []string{ "_monitoringagent._tcp.dfw1.stage.monitoring.api.rackspacecloud.com", "_monitoringagent._tcp.ord1.stage.monitoring.api.rackspacecloud.com", "_monitoringagent._tcp.lon3.stage.monitoring.api.rackspacecloud.com", } ValidSnetRegions = []string{ "dfw", "ord", "lon", "syd", "hkg", "iad", } SnetMonitoringTemplateSrvQueries = []*template.Template{ template.Must(template.New("0").Parse("_monitoringagent._tcp.snet-{{.SnetRegion}}-region0.prod.monitoring.api.rackspacecloud.com")), template.Must(template.New("1").Parse("_monitoringagent._tcp.snet-{{.SnetRegion}}-region1.prod.monitoring.api.rackspacecloud.com")), template.Must(template.New("2").Parse("_monitoringagent._tcp.snet-{{.SnetRegion}}-region2.prod.monitoring.api.rackspacecloud.com")), } SnetMonitoringTemplateSrvQueriesStaging = []*template.Template{ template.Must(template.New("0").Parse("_monitoringagent._tcp.snet-{{.SnetRegion}}-region0.stage.monitoring.api.rackspacecloud.com")), template.Must(template.New("1").Parse("_monitoringagent._tcp.snet-{{.SnetRegion}}-region1.stage.monitoring.api.rackspacecloud.com")), template.Must(template.New("2").Parse("_monitoringagent._tcp.snet-{{.SnetRegion}}-region2.stage.monitoring.api.rackspacecloud.com")), } )
Functions ¶
func IsUsingStaging ¶
func IsUsingStaging() bool
func LoadDevelopmentCAs ¶
func LoadProductionCAs ¶
func LoadStagingCAs ¶
Types ¶
type Config ¶
type Config struct { // Addresses UseSrv bool UseStaging bool SrvQueries []string Addresses []string // Agent Info AgentId string AgentName string Features []map[string]string Guid string BundleVersion string ProcessVersion string Token string SnetRegion string // Zones ZoneIds []string // Timeouts TimeoutRead time.Duration TimeoutWrite time.Duration // TimeoutPrepareEnd declares the max time to elapse between poller.prepare and poller.prepare.end, but // is reset upon receipt of each poller.prepare.block. TimeoutPrepareEnd time.Duration }
func (*Config) ComputeReadDeadline ¶
func (*Config) ComputeWriteDeadline ¶
func (*Config) DefineConfigEntries ¶
func (cfg *Config) DefineConfigEntries() []configEntry
func (*Config) LoadFromFile ¶
LoadFromFile populates this Config with the values defined in that file and then calls PostProcess.
func (*Config) ParseFields ¶
func (*Config) PostProcess ¶
func (*Config) SetPrivateZones ¶
type EndpointConfig ¶
type EndpointConfig struct { CertFile string KeyFile string // In the form of "IP:port" or just ":port" to bind to all interfaces BindAddr string // StatsDAddr specifies the UDP host:port of a StatsD backend StatsDAddr string // AgentsConfigDir references a directory that is structured as // <ZONE>/ // <AGENT ID>/ // checks/ // *.json AgentsConfigDir string PrepareBlockSize int }
func NewEndpointConfig ¶
func NewEndpointConfig() *EndpointConfig
func (*EndpointConfig) LoadFromFile ¶
func (cfg *EndpointConfig) LoadFromFile(filepath string) error
Click to show internal directories.
Click to hide internal directories.