notifier

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Disabled

type Disabled struct {
}

Disabled is a notifier that doesn't send any notifications

func (Disabled) Error

func (d Disabled) Error(header, body string, err error, data map[string]interface{})

func (Disabled) Info

func (d Disabled) Info(header, body string, data map[string]interface{})

type Notifier

type Notifier interface {
	Info(header, body string, data map[string]interface{})
	Error(header, body string, err error, data map[string]interface{})
}

Notifier an interface for sending notifications

func New

func New(options Options, logger *zap.SugaredLogger) Notifier

type Options

type Options struct {
	Webhook *WebhookOptions
}

type Webhook

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

Webhook is an implementation of Notifier that sends HTML messages to a given URL

func NewWebhook

func NewWebhook(options WebhookOptions, logger *zap.SugaredLogger) *Webhook

func (*Webhook) Error

func (w *Webhook) Error(header, body string, err error, data map[string]interface{})

Error sends an error message

func (*Webhook) Info

func (w *Webhook) Info(header, body string, data map[string]interface{})

Info sends an informational message

type WebhookOptions

type WebhookOptions struct {
	Url          string
	MessageField string
}

Jump to

Keyboard shortcuts

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