health

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartEndpointHealthCheck

func StartEndpointHealthCheck(endpointAddress string, opts ...Option) chan bool

StartEndpointHealthCheck starts a health check on the specified address with the given options. It returns a channel that will emit true if the endpoint is healthy and false if the failure conditions Have been met.

Types

type Option

type Option func(o *healthCheckOptions)

Option is an a function that applies a health check option.

func WithFailureThreshold

func WithFailureThreshold(threshold int) Option

WithFailureThreshold sets the failure threshold for the health check.

func WithInitialDelay

func WithInitialDelay(delay time.Duration) Option

WithInitialDelay sets the initial delay for the health check.

func WithInterval

func WithInterval(interval time.Duration) Option

WithInterval sets the interval for the health check.

func WithRequestTimeout

func WithRequestTimeout(timeout time.Duration) Option

WithRequestTimeout sets the request timeout for the health check.

func WithSuccessStatusCode

func WithSuccessStatusCode(code int) Option

WithSuccessStatusCode sets the status code for the health check.

type Server added in v0.8.0

type Server interface {
	Run(context.Context, int) error
	Ready()
	NotReady()
}

Server is the interface for the healthz server.

func NewServer added in v0.8.0

func NewServer(log logger.Logger) Server

NewServer returns a new healthz server.

Jump to

Keyboard shortcuts

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