stalemiddleware

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c Config) endpoint.Middleware

New returns a new stale middleware This middleware marks the application as unhealthy if no request is received in the allotted time.

If a request is received after being unhealthy, it's not considered stale anymore abd becomes healthy again.

Types

type Config

type Config struct {
	Logger                 *zerolog.Logger
	MaxTimeBetweenRequests time.Duration
	StartCheckAfter        time.Duration
	HealthinessPobe        app.Probe
}

Config is a struct used to configure a new stale middleware.

func NewDefaultConfig

func NewDefaultConfig(pg *app.ProbeGroup) Config

NewDefaultConfig returns a new `Config` with all values filled with a sane default.

Jump to

Keyboard shortcuts

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