notification

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2022 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init added in v1.5.0

func Init(uri string) error

Init creates a notifier regarding the URI.

func Notify added in v1.5.0

func Notify(result HookResult)

Notify is the global method to notify hook result

Types

type HTTPNotifier

type HTTPNotifier struct {
	URL          *url.URL
	PrefixFilter string
}

HTTPNotifier is able to send a notification to a HTTP endpoint.

func (*HTTPNotifier) Notify

func (n *HTTPNotifier) Notify(result HookResult) error

Notify send a notification to a HTTP endpoint.

type HookResult added in v1.15.0

type HookResult interface {
	ID() uint64
	Name() string
	Logs(filter string) string
	StatusLabel() string
	Err() error
}

type Notifier

type Notifier interface {
	Notify(result HookResult) error
}

Notifier is able to send a notification.

type SMTPNotifier

type SMTPNotifier struct {
	Host         string
	Username     string
	Password     string
	Conn         string
	From         string
	To           string
	Subject      string
	PrefixFilter string
}

SMTPNotifier is able to send notification to a email destination.

func (*SMTPNotifier) Notify

func (n *SMTPNotifier) Notify(result HookResult) error

Notify send a notification to a email destination.

Jump to

Keyboard shortcuts

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