smtp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitWebHookNotifier

func InitWebHookNotifier(configBody []byte) (notifiers.Notifier, error)

InitWebHookNotifier initializes the smtp notifier

Types

type Notifier

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

Notifier is the notifier for email

func (*Notifier) Close

func (s *Notifier) Close() error

Close closes the notifier

func (*Notifier) Configure

func (s *Notifier) Configure(webhookConfig NotifierConfig) error

Configure configures the notifier

func (*Notifier) GetName

func (s *Notifier) GetName() notifiers.NotifierName

GetName returns the name of the notifier

func (*Notifier) Notify

func (s *Notifier) Notify(nBody *monitors.NotificationBody, params ...interface{}) error

Notify sends the message by webhook params[0] is the Notifier object

type NotifierConfig

type NotifierConfig struct {
	Enabled bool `json:"enabled"`
}

NotifierConfig is the config for the SMTP notifier

func (*NotifierConfig) Validate

func (s *NotifierConfig) Validate() error

Validate validates the config

type SendConfig

type SendConfig struct {
	URL     string            `json:"url"`
	Headers map[string]string `json:"headers"`
}

SendConfig is the config for the notifier

Jump to

Keyboard shortcuts

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