notifier

package
v1.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidResponse = errors.New("invalid http response")
	ErrUnknownHandler  = errors.New("unknown handler")
	ErrEmptyURL        = errors.New("url must be set")
)

Functions

func NewContext

func NewContext(ctx context.Context, n Notifier) context.Context

Types

type Healthchecks

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

func (Healthchecks) Finished

func (h Healthchecks) Finished(err error) error

func (Healthchecks) SendStatus

func (h Healthchecks) SendStatus(status Status, log string) error

func (Healthchecks) Started

func (h Healthchecks) Started() error

type Notifier

type Notifier interface {
	Started() error
	Finished(err error) error
}

func FromContext

func FromContext(ctx context.Context) (Notifier, bool)

func New

func New(handler, url string) (Notifier, error)

func NewHealthchecks

func NewHealthchecks(url string) (Notifier, error)

type Status

type Status uint8
const (
	StatusSuccess Status = iota
	StatusFailure
	StatusStart
)

Jump to

Keyboard shortcuts

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