Documentation
¶
Index ¶
- Variables
- func GetEnv(key string) string
- func GetOutboundIP() (net.IP, error)
- func InitConfig(configDir string, testMode bool, interval int64, plugins, url, loglevel string) error
- type Alerting
- type ConfigType
- type Duration
- type Flashduty
- type Global
- type HTTPConfig
- type InternalConfig
- type LogConfig
- type Size
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "0.9.0"
Functions ¶
Types ¶
type Alerting ¶
type Alerting struct {
Disabled bool `toml:"disabled"`
// like prometheus `for`
ForDuration Duration `toml:"for_duration"`
// repeat interval
RepeatInterval Duration `toml:"repeat_interval"`
// maximum number of notifications
RepeatNumber int `toml:"repeat_number"`
// set to true to suppress recovery notifications
DisableRecoveryNotification bool `toml:"disable_recovery_notification"`
}
type ConfigType ¶
type ConfigType struct {
ConfigDir string `toml:"-"`
StateDir string `toml:"-"`
TestMode bool `toml:"-"`
Plugins string `toml:"-"`
Url string `toml:"-"`
Loglevel string `toml:"-"`
Global Global `toml:"global"`
LogConfig LogConfig `toml:"log"`
Flashduty Flashduty `toml:"flashduty"`
}
var Config *ConfigType
type Duration ¶
Duration is a time.Duration
func (*Duration) HumanString ¶
func (*Duration) UnmarshalTOML ¶
UnmarshalTOML parses the duration from the TOML config file
func (*Duration) UnmarshalText ¶
type HTTPConfig ¶
type HTTPConfig struct {
Interface string `toml:"interface"`
Method string `toml:"method"`
Timeout Duration `toml:"timeout"`
FollowRedirects *bool `toml:"follow_redirects"`
BasicAuthUser string `toml:"basic_auth_user"`
BasicAuthPass string `toml:"basic_auth_pass"`
Headers []string `toml:"headers"`
Payload string `toml:"payload"`
HTTPProxy string `toml:"http_proxy"`
tls.ClientConfig
}
func (*HTTPConfig) GetMethod ¶
func (hc *HTTPConfig) GetMethod() string
func (*HTTPConfig) GetProxy ¶
func (hc *HTTPConfig) GetProxy() (proxyFunc, error)
func (*HTTPConfig) GetTimeout ¶
func (hc *HTTPConfig) GetTimeout() Duration
type InternalConfig ¶
type InternalConfig struct {
// append labels to every event
Labels map[string]string `toml:"labels"`
// gather interval
Interval Duration `toml:"interval"`
// alerting rule
Alerting Alerting `toml:"alerting"`
}
func (*InternalConfig) GetAlerting ¶
func (ic *InternalConfig) GetAlerting() Alerting
func (*InternalConfig) GetInterval ¶
func (ic *InternalConfig) GetInterval() Duration
func (*InternalConfig) GetLabels ¶
func (ic *InternalConfig) GetLabels() map[string]string
type Size ¶
type Size int64
Size represents a byte size with human-readable TOML parsing. Supports: "50MB", "1GB", "512KB", "1024" (bytes), etc. Case-insensitive units: B, KB, MB, GB, TB.
func (*Size) UnmarshalTOML ¶
func (*Size) UnmarshalText ¶
Click to show internal directories.
Click to hide internal directories.