probes

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CheckInterval time.Duration `yaml:"check_interval" validate:"min=1s"`
	CheckTimeout  time.Duration `yaml:"check_timeout" validate:"min=1s"`
}

type Option

type Option = c.Option[*Prober]

func WithCheckInterval

func WithCheckInterval(d time.Duration) Option

func WithCheckTimeout

func WithCheckTimeout(d time.Duration) Option

func WithLogger

func WithLogger(logger *zap.Logger) Option

func WithProbe

func WithProbe(t ProbeType, probe Probe) Option

type Probe

type Probe = func(context.Context) error

type ProbeType

type ProbeType string
const (
	ProbeTypeStartup   ProbeType = "startup"
	ProbeTypeReadiness ProbeType = "readiness"
	ProbeTypeLiveness  ProbeType = "liveness"
)

type Prober

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

func New

func New(opts ...Option) (*Prober, error)

func (*Prober) Liveness

func (p *Prober) Liveness() bool

func (*Prober) Readiness

func (p *Prober) Readiness() bool

func (*Prober) Run

func (p *Prober) Run(ctx context.Context) error

func (*Prober) SetStartup

func (p *Prober) SetStartup(startup bool)

func (*Prober) Startup

func (p *Prober) Startup() bool

func (*Prober) Validate

func (obj *Prober) Validate() error

Jump to

Keyboard shortcuts

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