notification

package
v0.1.26 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INFO  = 1
	ALERT = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Body

type Body struct {
	Blocks []Section `json:"blocks"`
}

type ErrorWriter

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

func (ErrorWriter) Write

func (s ErrorWriter) Write(data []byte) (n int, err error)

type ImageAccessory

type ImageAccessory struct {
	Type     string `json:"type"`
	ImageUrl string `json:"image_url"`
	AltText  string `json:"alt_text"`
}

type Section

type Section struct {
	Type      string          `json:"type"`
	Text      *Text           `json:"text,omitempty"`
	Accessory *ImageAccessory `json:"accessory,omitempty"` // This is a pointer because the encoder won't omit it otherwise
}

type Sender

type Sender interface {
	Alert(msg string)
	Info(msg string)
}

type Slack

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

func NewSlack

func NewSlack(infohook, alerthook, environment string, testMode bool) *Slack

func (*Slack) Alert

func (s *Slack) Alert(headline, msg string) error

func (*Slack) Info

func (s *Slack) Info(headline, msg string) error

func (*Slack) Writer

func (s *Slack) Writer(channel io.Writer) *ErrorWriter

type Text

type Text struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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