notifiers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAll

func GetAll(config Config) map[string]Notifier

Types

type Config

type Config struct {
	Email    *EmailOptions    `json:"email"`
	Slack    *SlackOptions    `json:"slack"`
	Opsgenie *OpsgenieOptions `json:"opsgenie"`
}

type EmailOptions

type EmailOptions struct {
	Host               string `json:"host"`
	Port               int    `json:"port"`
	InsecureSkipVerify bool   `json:"insecure_skip_verify"`
	Username           string `json:"username"`
	Password           string `json:"password"`
	From               string `json:"from"`
}

type Notification added in v0.4.0

type Notification struct {
	Title string `json:"title,omitempty"`
	Body  string `json:"body,omitempty"`
	Slack *SlackSpecific
}

type Notifier

type Notifier interface {
	Send(notification Notification, recipient string) error
}

func NewEmailNotifier

func NewEmailNotifier(opts EmailOptions) Notifier

func NewOpsgenieNotifier added in v0.4.0

func NewOpsgenieNotifier(opts OpsgenieOptions) Notifier

func NewSlackNotifier

func NewSlackNotifier(opts SlackOptions) Notifier

type OpsgenieOptions added in v0.4.0

type OpsgenieOptions struct {
	ApiUrl  string            `json:"apiUrl"`
	ApiKeys map[string]string `json:"apiKeys"`
}

type SlackOptions

type SlackOptions struct {
	Username           string   `json:"username"`
	Icon               string   `json:"icon"`
	Token              string   `json:"token"`
	SigningSecret      string   `json:"signingSecret"`
	Channels           []string `json:"channels"`
	InsecureSkipVerify bool     `json:"insecureSkipVerify"`
}

type SlackSpecific added in v0.4.0

type SlackSpecific struct {
	Attachments string `json:"attachments,omitempty"`
	Blocks      string `json:"blocks,omitempty"`
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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