health

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handle

func Handle(w http.ResponseWriter, r *http.Request)

func Set

func Set(ctx context.Context, h *Config) context.Context

Types

type Base

type Base struct {
	Key       string
	CheckFunc func(ctx context.Context) bool
}

func (Base) Check

func (b Base) Check(ctx context.Context) bool

func (Base) Clone

func (b Base) Clone() Component

func (Base) Close

func (b Base) Close() error

func (Base) Name

func (b Base) Name() string

type Component

type Component interface {
	Name() string
	Check(context.Context) bool
	Clone() Component
	io.Closer
}

type Config added in v0.0.8

type Config struct {
	Health
}

func Get

func Get(ctx context.Context) *Config

func (*Config) Ping added in v0.0.8

func (c *Config) Ping(name string) *Ping

type Health

type Health []Component

func (Health) Check

func (h Health) Check(ctx context.Context) map[string]bool

func (Health) Close

func (h Health) Close() error

type Ping

type Ping struct {
	Key     string
	Channel PingChannel
}

func NewPing

func NewPing(name string) *Ping

func (*Ping) Check

func (p *Ping) Check(ctx context.Context) bool

func (*Ping) Clone

func (p *Ping) Clone() Component

func (*Ping) Close

func (p *Ping) Close() error

func (Ping) Name

func (p Ping) Name() string

type PingChannel

type PingChannel chan func()

Jump to

Keyboard shortcuts

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