Documentation ¶
Index ¶
- Variables
- func GetConfigDir() string
- func InitEventsStore(config *pluginEventsStoreConfig)
- func InitializeCache()
- func LoadPlugin(id, dir, name string) (*lua.LState, error)
- func PreloadTools(id string, l *lua.LState) error
- func UpdateTaskConfig(taskConf *Config, conf *SenderConfig) error
- type Config
- type Sender
- type SenderConfig
Constants ¶
This section is empty.
Variables ¶
var GlobalCache *cache.TTLCache
GlobalCache for juggler checks
Functions ¶
func GetConfigDir ¶ added in v1.0.0
func GetConfigDir() string
GetConfigDir where senders config placed
func InitEventsStore ¶ added in v1.0.0
func InitEventsStore(config *pluginEventsStoreConfig)
InitEventsStore initiate global plugin events store for save juggler events history and use it as antiflap method
func LoadPlugin ¶
LoadPlugin cleanup lua state global/local environment and load lua plugin by name from juggler config section
func PreloadTools ¶
PreloadTools preload go functions in lua global environment
func UpdateTaskConfig ¶ added in v0.12.1
func UpdateTaskConfig(taskConf *Config, conf *SenderConfig) error
UpdateTaskConfig update current task config, set default settings if it need
Types ¶
type Config ¶
type Config struct { PluginsDir string `codec:"plugins_dir"` Plugin string `codec:"plugin"` Host string `codec:"Host"` Method string `codec:"Method"` Aggregator string `codec:"Aggregator"` AggregatorKWArgs repository.PluginConfig `codec:"aggregator_kwargs"` Notifications []repository.PluginConfig `codec:"notifications"` TTL int `codec:"ttl"` CheckName string `codec:"checkname"` Description string `codec:"description"` Tags []string `codec:"tags"` Flaps *jugglerFlapConfig `codec:"flaps"` Variables map[string]string `codec:"variables"` FlapsByChecks map[string]jugglerFlapConfig `codec:"flaps_by_checks"` JPluginConfig repository.PluginConfig `codec:"config"` JHosts []string `codec:"juggler_hosts"` JFrontend []string `codec:"juggler_frontend"` OK []string `codec:"OK"` INFO []string `codec:"INFO"` WARN []string `codec:"WARN"` CRIT []string `codec:"CRIT"` BatchSize int `codec:"batch_size"` BatchEndpoint string `codec:"batch_endpoint"` Namespace string `codec:"namespace"` Token string `codec:"-"` // do not pass token }
Config contains config section from combainer's aggregations section also it include default sender config (or user specified) yaml config
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig build default config for sender, it has sanity defaults
type Sender ¶
type Sender struct { *Config // contains filtered or unexported fields }
Sender main object
type SenderConfig ¶
type SenderConfig struct { CacheTTL time.Duration `yaml:"cache_ttl"` CacheCleanInterval time.Duration `yaml:"cache_clean_interval"` PluginsDir string `yaml:"plugins_dir"` Hosts []string `yaml:"juggler_hosts"` Frontend []string `yaml:"juggler_frontend"` BatchSize int `yaml:"batch_size"` BatchEndpoint string `yaml:"batch_endpoint"` Token string `yaml:"token"` Store pluginEventsStoreConfig `yaml:"store"` }
SenderConfig contains configuration loaded from combaine's config file placed in sender config
func GetSenderConfig ¶ added in v0.9.1
func GetSenderConfig() (*SenderConfig, error)
GetSenderConfig read global sender config usual from /etc/combaine/juggler.yaml