alert

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Color      string   `json:"color"`
	AuthorName string   `json:"author_name"`
	Text       string   `json:"text"`
	MrkdwnIn   []string `json:"mrkdwn_in"`
}

Attachment holds the markdown message body

type Payload

type Payload struct {
	Channel     string       `json:"channel"`
	Username    string       `json:"username"`
	Text        string       `json:"text,omitempty"`
	Attachments []Attachment `json:"attachments,omitempty"`
}

Payload holds the channel and attachments

type Provider

type Provider struct {
	URL      string
	Username string
	Channel  string
}

Provider holds the information needed to post alerts

func NewProvider

func NewProvider(providerType string, hookURL string, username string, channel string) (*Provider, error)

NewProvider validates the URL and returns a provider object

func (*Provider) Post

func (s *Provider) Post(name string, namespace string, message string, severity string) error

Post message to the provider hook URL

Jump to

Keyboard shortcuts

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