healthchecker

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckFn

type CheckFn func(ctx context.Context, log *zerolog.Logger) bool

type Checker

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

func New

func New(l zerolog.Logger, checkFn CheckFn, cfg Config) *Checker

func (*Checker) Start

func (c *Checker) Start(_ context.Context) error

func (*Checker) Stop

func (c *Checker) Stop(_ context.Context) error

type Config

type Config struct {
	MaxBlockLag  time.Duration `env:"HEALTHCHECK_MAX_LAST_BLOCK_LAG" envDefault:"5m"`
	Interval     time.Duration `env:"HEALTHCHECK_INTERVAL" envDefault:"1m"`
	StartDelay   time.Duration `env:"HEALTHCHECK_START_DELAY"`
	Enabled      bool          `env:"HEALTHCHECK_ENABLED" envDefault:"false"`
	FatalOnCheck bool          `env:"HEALTHCHECK_FATAL_ON_CHECK" envDefault:"true"`
}

Jump to

Keyboard shortcuts

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