alert

package
v0.0.0-...-a7d1f21 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package alert alert rules and templatize.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	Name        string            `yaml:"name"`
	Interval    string            `yaml:"interval"`
	SearchIndex string            `yaml:"search_index"`
	SearchType  string            `yaml:"search_type"`
	Search      search.Dict       `yaml:"search"`
	SearchQuery string            `yaml:"search_query"`
	Process     luautil.LuaRunner `yaml:"process"`

	Jobber         *jobber.FullTimeSpec
	SearchIndexTPL *template.Template
	SearchTypeTPL  *template.Template
	SearchTPL      *template.Template
}

Alert encompasses a search query which will be run periodically, the results of which will be checked against a condition. If the condition returns true a set of actions will be performed

func (Alert) CreateSearch

func (a Alert) CreateSearch(c context.Context) (string, string, interface{}, error)

func (*Alert) Init

func (a *Alert) Init() error

Init initializes some internal data inside the Alert, and must be called after the Alert is unmarshaled from yaml (or otherwise created)

func (Alert) Run

func (a Alert) Run()

Jump to

Keyboard shortcuts

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