notifier

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: GPL-3.0 Imports: 10 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")
	ErrRetriesExhausted = errors.New("retries exhausted")
)

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(ctx context.Context, err error) error

func (*Healthchecks) SendStatus

func (h *Healthchecks) SendStatus(ctx context.Context, status Status, log string) error

func (*Healthchecks) SetLog added in v1.13.0

func (h *Healthchecks) SetLog(log string)

func (*Healthchecks) Started

func (h *Healthchecks) Started(ctx context.Context) error

type Logs added in v1.13.0

type Logs interface {
	SetLog(log string)
}

type Notifier

type Notifier interface {
	Started(ctx context.Context) error
	Finished(ctx context.Context, 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