{"modulePath":"github.com/StackVista/stackstate-process-agent","version":"v0.99.35","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package config\n\nThis is a duplicate of config/config.go without a dependency on dd-go/util to avoid pulling in the world.\n\n## Constants\n\n```go\nconst (\n\tDefaultLogLevel    = \"info\"\n\tDefaultSyslogHost  = \"localhost:514\"\n\tDefaultSyslogLevel = \"error\"\n)\n```\n\n## Functions\n\n```go\nfunc IsBlacklisted(cmdline []string, blacklist []*regexp.Regexp) bool\n```\nIsBlacklisted returns a boolean indicating if the given command is blacklisted by our config.\n\n```go\nfunc NewLoggerLevel(logLevel string) error\n```\n\n```go\nfunc ReplaceLogger(cfg *LoggerConfig) error\n```\n\n```go\nfunc Set(config *ini.File)\n```\nSet points to the given config as the new global config. This is only used for testing.\n\n## Types\n\n```go\ntype AgentConfig struct {\n\tEnabled       bool\n\tAPIKey        string\n\tHostName      string\n\tAPIEndpoint   *url.URL\n\tLogLevel      string\n\tQueueSize     int\n\tBlacklist     []*regexp.Regexp\n\tMaxProcFDs    int\n\tProcLimit     int\n\tAllowRealTime bool\n\tProxy         *url.URL\n\tTimers        *CheckTimers\n\tLogger        *LoggerConfig\n\n\t// Kubernetes\n\tCollectKubernetesMetadata  bool\n\tKubernetesKubeletHost      string\n\tKubernetesHTTPKubeletPort  int\n\tKubernetesHTTPSKubeletPort int\n}\n```\n\n```go\nfunc NewAgentConfig(agentConf, legacyConf *File) (*AgentConfig, error)\n```\nNewAgentConfig returns an AgentConfig using a conf and legacy configuration. conf will be nil if there is no configuration available but legacyConf will give an error if nil.\n\n```go\nfunc NewDefaultAgentConfig() *AgentConfig\n```\nNewDefaultAgentConfig returns an AgentConfig with defaults initialized\n\n```go\ntype CheckTimers struct {\n\tProcess     *time.Ticker\n\tConnections *time.Ticker\n\tRealTime    *time.Ticker\n}\n```\n\n```go\ntype File struct {\n\tPath string\n\t// contains filtered or unexported fields\n}\n```\nA File is a representation of an ini file with some custom convenience methods.\n\n```go\nfunc Get() *File\n```\nGet returns the currently active global config (the previous config opened via NewFile)\n\n```go\nfunc New(configPath string) (*File, error)\n```\nNew reads the file in configPath and returns a corresponding \\*File or an error if encountered.  This File is set as the default active config file.\n\n```go\nfunc NewIfExists(configPath string) (*File, error)\n```\nNewIfExists works as New, but does not return an error if the file does not exist. Instead, it returns a null File pointer.\n\n```go\nfunc (c *File) Get(section, name string) (string, error)\n```\nGet returns a value from the section/name pair, or an error if it can't be found.\n\n```go\nfunc (c *File) GetBool(section, name string, defaultVal bool) bool\n```\nGetBool returns a truthy config value. It accepts 1, t, T, TRUE, true, True, YES, yes, Yes, y, ON, on, On, 0, f, F, FALSE, false, False, NO, no, No, n, OFF, off, Off. Any other value returns an error.\n\n```go\nfunc (c *File) GetDefault(section, name string, defaultVal string) string\n```\nGetDefault attempts to get the value in section/name, but returns the default if one is not found.\n\n```go\nfunc (c *File) GetDuration(section, name string, unit time.Duration) (time.Duration, error)\n```\nGetDuration returns a value from section/name converted to a duration using unit.\n\n```go\nfunc (c *File) GetDurationDefault(section, name string, unit, defaultVal time.Duration) time.Duration\n```\nGetDuration returns a value from section/name converted to a duration using unit and returns the default if any error occurs.\n\n```go\nfunc (c *File) GetFloat(section, name string) (float64, error)\n```\nGetFloat gets an float value from section/name, or an error if it is missing or cannot be converted to an float.\n\n```go\nfunc (c *File) GetInt(section, name string) (int, error)\n```\nGetInt gets an integer value from section/name, or an error if it is missing or cannot be converted to an integer.\n\n```go\nfunc (c *File) GetIntDefault(section, name string, defaultVal int) int\n```\nGetIntDefault gets an integer value from section/name, but returns the default if one is not found.\n\n```go\nfunc (c *File) GetSection(key string) (*ini.Section, error)\n```\nGetSection is a convenience method to return an entire section of ini config\n\n```go\nfunc (c *File) GetStrArray(section, name, sep string) ([]string, error)\n```\nGetStrArray returns the value split across \\`sep\\` into an array of strings.\n\n```go\nfunc (c *File) GetStrArrayDefault(section, name, sep string, defaultVal []string) []string\n```\nGetStrArrayDefault returns the value split across \\`sep\\` into an array of strings or the defaultVal if the key is not available in section.\n\n```go\ntype LoggerConfig struct {\n\tAppName     string\n\tLogLevel    string\n\tConsole     bool\n\tSyslog      bool\n\tSyslogLevel string\n\tSyslogHost  string\n\tFilename    string\n}\n```\nLoggerConfig defines the configuration of a logger\n\n```go\nfunc (cfg *LoggerConfig) SeelogConfig() (*seelogConfig, error)\n```\n\n```go\nfunc (cfg *LoggerConfig) SeelogLogger() (log.LoggerInterface, error)\n```\nSeelogLogger returns a new seelog Logger\n\n","path":"github.com/StackVista/stackstate-process-agent/config","name":"config","synopsis":"This is a duplicate of config/config.go without a dependency on dd-go/util to avoid pulling in the world.","isRedistributable":true}
