alertmanager

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitAlertManager

func InitAlertManager(vConfAlerting ConfAlerting, vigieInstName, vigieURL string) error

func SendSlackNotification added in v0.4.0

func SendSlackNotification(webhookUrl, channel, body string) error

SendSlackNotification will post to an 'Incoming Webook' url setup in Slack Apps. It accepts some text and the slack channel is saved within Slack.

Types

type AlertManager

type AlertManager struct {
	sync.RWMutex
	Enable bool
	// contains filtered or unexported fields
}
var AM AlertManager

func (*AlertManager) AddToAlertList

func (am *AlertManager) AddToAlertList(task teststruct.Task) error

__________________________________________________________________________________________ AddToAlertList add the task into the AlertManager If a TxStep has no leafs => delete this TxStep on AM AlertList is a list that contanins only fail TestX

func (*AlertManager) IsEnable

func (am *AlertManager) IsEnable() (enable bool)

type ConfAlerting

type ConfAlerting struct {
	Enable   bool          `toml:"enable"`
	Interval time.Duration `toml:"interval"`
	Reminder time.Duration `toml:"reminder"`
	Email    struct {
		To       string `toml:"to"`
		From     string `toml:"from"`
		Username string `toml:"username"`
		Password string `toml:"password"`
		SMTP     string `toml:"smtp"`
		Port     int    `toml:"port"`
	} `toml:"email"`
	Slack struct {
		Hook    string `toml:"hook" valid:"url"`
		Channel string `toml:"channel"`
	} `toml:"slack"`
	Discord struct {
		Hook string `toml:"hook" valid:"url"`
	} `toml:"discord"`
	Teams struct {
		Hook string `toml:"hook" valid:"url"`
	} `toml:"slack"`
	Webhook struct {
		Hook string `toml:"hook" valid:"url"`
	} `toml:"webhook"`
}

Jump to

Keyboard shortcuts

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