notifiers

package
v0.0.0-...-7082fca Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Notifier

type Notifier interface {
	Initialize(context.Context) error
	Configure(map[string]interface{}) error
	Notify(string) error
}

Notifier interface is the interface that all notifiers has to implement

func FromString

func FromString(checkType string) (Notifier, error)

FromString returns a `Check` parsed by a string

type SlackNotifier

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

SlackNotifier holds the configuration for an instance of slack notifier

func (*SlackNotifier) Configure

func (notifier *SlackNotifier) Configure(config map[string]interface{}) error

Configure configures the slack notifier, it creates a new slack client and finds the channel ID by the configured channel name. It also verifies that the auth token is correct

func (*SlackNotifier) Initialize

func (notifier *SlackNotifier) Initialize(ctx context.Context) error

Initialize initializes the slack notifier

func (*SlackNotifier) Notify

func (notifier *SlackNotifier) Notify(msg string) error

Notify notifies tha slack channel with the given message

Jump to

Keyboard shortcuts

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