health

package
v1.11.0-rc.8 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartEndpointHealthCheck

func StartEndpointHealthCheck(ctx context.Context, 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 a function that applies a health check option.

func WithClock added in v1.10.1

func WithClock(clock kclock.WithTicker) Option

WithClock sets a custom clock (for mocking time).

func WithFailureThreshold

func WithFailureThreshold(threshold int32) Option

WithFailureThreshold sets the failure threshold for the health check.

func WithHTTPClient added in v1.10.5

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the http.Client to use.

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