config

package
v0.0.0-...-2e4375a Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultForwarderRecoveryInterval = 2

DefaultForwarderRecoveryInterval is the default recovery interval, also used if the user-provided value is invalid.

Variables

View Source
var (
	Datadog = viper.New()
)

Datadog is the global configuration object

Functions

func AddAgentVersionToDomain

func AddAgentVersionToDomain(domain string, app string) (string, error)

AddAgentVersionToDomain prefix the domain with the agent version: X-Y-Z.domain

func BindEnvAndSetDefault

func BindEnvAndSetDefault(key string, val interface{})

BindEnvAndSetDefault sets the default value for a config parameter, and adds an env binding

func FileUsedDir

func FileUsedDir() string

FileUsedDir returns the absolute path to the folder containing the config file used to populate the registry

func GetMultipleEndpoints

func GetMultipleEndpoints() (map[string][]string, error)

GetMultipleEndpoints returns the api keys per domain specified in the main agent config

func GetSyslogURI

func GetSyslogURI() string

GetSyslogURI returns the configured/default syslog uri

func IsContainerized

func IsContainerized() bool

IsContainerized returns whether the Agent is running on a Docker container

func IsKubernetes

func IsKubernetes() bool

IsKubernetes returns whether the Agent is running on a kubernetes cluster

func Load

func Load() error

Load reads configs files and initializes the config module

func SetupLogger

func SetupLogger(logLevel, logFile, uri string, rfc, logToConsole, jsonFormat bool) error

SetupLogger sets up the default logger

Types

type ConfigurationProviders

type ConfigurationProviders struct {
	Name        string `mapstructure:"name"`
	Polling     bool   `mapstructure:"polling"`
	TemplateURL string `mapstructure:"template_url"`
	TemplateDir string `mapstructure:"template_dir"`
	Username    string `mapstructure:"username"`
	Password    string `mapstructure:"password"`
	CAFile      string `mapstructure:"ca_file"`
	CAPath      string `mapstructure:"ca_path"`
	CertFile    string `mapstructure:"cert_file"`
	KeyFile     string `mapstructure:"key_file"`
	Token       string `mapstructure:"token"`
}

ConfigurationProviders helps unmarshalling `config_providers` config param

type ErrorLogWriter

type ErrorLogWriter struct{}

ErrorLogWriter is a Writer that logs all written messages with the global seelog logger at an error level

func (*ErrorLogWriter) Write

func (s *ErrorLogWriter) Write(p []byte) (n int, err error)

type Listeners

type Listeners struct {
	Name string `mapstructure:"name"`
}

Listeners helps unmarshalling `listeners` config param

type MetadataProviders

type MetadataProviders struct {
	Name     string        `mapstructure:"name"`
	Interval time.Duration `mapstructure:"interval"`
}

MetadataProviders helps unmarshalling `metadata_providers` config param

type Proxy

type Proxy struct {
	HTTP    string   `mapstructure:"http"`
	HTTPS   string   `mapstructure:"https"`
	NoProxy []string `mapstructure:"no_proxy"`
}

Proxy represents the configuration for proxies in the agent

func GetProxies

func GetProxies() *Proxy

GetProxies returns the proxy settings from the configuration

type SyslogReceiver

type SyslogReceiver struct {
	// contains filtered or unexported fields
}

SyslogReceiver implements seelog.CustomReceiver

func (*SyslogReceiver) AfterParse

func (s *SyslogReceiver) AfterParse(initArgs seelog.CustomReceiverInitArgs) error

AfterParse parses the receiver configuration

func (*SyslogReceiver) Close

func (s *SyslogReceiver) Close() error

Close is a NOP in current implementation

func (*SyslogReceiver) Flush

func (s *SyslogReceiver) Flush()

Flush is a NOP in current implementation

func (*SyslogReceiver) ReceiveMessage

func (s *SyslogReceiver) ReceiveMessage(message string, level seelog.LogLevel, context seelog.LogContextInterface) error

ReceiveMessage process current log message

Jump to

Keyboard shortcuts

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