Documentation ¶
Index ¶
- type Conf
- func (c *Conf) AlertSquelched(a *conf.Alert) func(opentsdb.TagSet) bool
- func (c *Conf) BulkEdit(edits conf.BulkEditRequest) error
- func (c *Conf) Expand(v string, vars map[string]string, ignoreBadExpand bool) string
- func (c *Conf) GetAlert(s string) *conf.Alert
- func (c *Conf) GetAlerts() map[string]*conf.Alert
- func (c *Conf) GetFuncs(backends conf.EnabledBackends) map[string]eparse.Func
- func (c *Conf) GetHash() string
- func (c *Conf) GetLookup(s string) *conf.Lookup
- func (c *Conf) GetMacro(s string) *conf.Macro
- func (c *Conf) GetNotification(s string) *conf.Notification
- func (c *Conf) GetNotifications() map[string]*conf.Notification
- func (c *Conf) GetRawText() string
- func (c *Conf) GetSquelches() conf.Squelches
- func (c *Conf) GetTemplate(s string) *conf.Template
- func (c *Conf) NewExpr(s string) *expr.Expr
- func (c *Conf) RawDiff(rawConf string) (string, error)
- func (c *Conf) Reload() error
- func (c *Conf) SaveConf(newConf *Conf) error
- func (c *Conf) SaveRawText(rawConfig, diff, user, message string, args ...string) error
- func (c *Conf) SetReload(reload func() error)
- func (c *Conf) SetSaveHook(sh conf.SaveHook)
- func (c *Conf) Squelched(a *conf.Alert, tags opentsdb.TagSet) bool
- type Location
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conf ¶
type Conf struct { Vars conf.Vars Name string // Config file name Templates map[string]*conf.Template Alerts map[string]*conf.Alert Notifications map[string]*conf.Notification `json:"-"` RawText string Macros map[string]*conf.Macro Lookups map[string]*conf.Lookup Squelch conf.Squelches `json:"-"` NoSleep bool Hash string // contains filtered or unexported fields }
func (*Conf) AlertSquelched ¶
func (*Conf) BulkEdit ¶
func (c *Conf) BulkEdit(edits conf.BulkEditRequest) error
BulkEdit applies sequental edits to the configuration file. Each individual edit must generate a valid configuration or the edit request will fail.
func (*Conf) GetNotification ¶
func (c *Conf) GetNotification(s string) *conf.Notification
func (*Conf) GetNotifications ¶
func (c *Conf) GetNotifications() map[string]*conf.Notification
func (*Conf) GetRawText ¶
func (*Conf) GetSquelches ¶
func (*Conf) RawDiff ¶
RawDiff returns a contextual diff of the running rule configuration against the provided configuration. This contextual diff library does not guarantee that the generated unified diff can be applied so this is only used for human consumption and verifying that the diff has not change since an edit request was issued
func (*Conf) SaveRawText ¶
SaveRawText saves a new configuration file. The contextual diff of the change is provided to verify that no other changes have happened since the save request is issue. User, message, and args are passed to an optionally configured save hook. If the config file is not valid the file will not be saved. If the savehook fails to run or returns an error thaen the orginal config will be restored and the reload will not take place.