alert

package
v0.0.0-...-b7c0045 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alerter

type Alerter interface {
	Alert(status probe.Status, category, serviceName, message, link, date string)
}

Alerter is the interface all alerters should implement.

type Attachment

type Attachment struct {
	Color  string            `json:"color,omitempty"`
	Fields []AttachmentField `json:"fields,omitempty"`
}

Attachment Payload for postmessage rest API

https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage/

type AttachmentField

type AttachmentField struct {
	Short bool   `json:"short"`
	Title string `json:"title,omitempty"`
	Value string `json:"value,omitempty"`
}

AttachmentField Payload for postmessage rest API

https://rocket.chat/docs/developer-guides/rest-api/chat/postmessage/

type Pushbullet

type Pushbullet struct {
	// contains filtered or unexported fields
}

Pushbullet alert container.

func NewPushbullet

func NewPushbullet(token string) *Pushbullet

NewPushbullet returns a Pushbullet alerter from the private token available in the `account` page.

func (*Pushbullet) Alert

func (p *Pushbullet) Alert(status probe.Status, category, serviceName, message, link, date string)

Alert sends a pushbullet note to the owner of the provided token.

type Slack

type Slack struct {
	// contains filtered or unexported fields
}

Slack alert container.

func NewSlack

func NewSlack(webhookURL, channel string) *Slack

NewSlack returns a Slack alerter from the webhookURL

func (*Slack) Alert

func (p *Slack) Alert(status probe.Status, category, title, message, link, date string)

Alert sends a pushbullet note to the owner of the provided token.

type SlackPostMessage

type SlackPostMessage struct {
	RoomID      string       `json:"roomId,omitempty"`
	Channel     string       `json:"channel,omitempty"`
	Text        string       `json:"text,omitempty"`
	ParseUrls   bool         `json:"parseUrls,omitempty"`
	Alias       string       `json:"alias,omitempty"`
	Emoji       string       `json:"emoji,omitempty"`
	Avatar      string       `json:"avatar,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

SlackPostMessage is the main model for sending messages

Jump to

Keyboard shortcuts

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