health

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker is a health checker which reports to whether the target actor app endpoint is in a healthy state, according to the configured status code.

func New

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

func (*Checker) Close

func (c *Checker) Close()

func (*Checker) HealthChannel

func (c *Checker) HealthChannel() <-chan bool

func (*Checker) Run

func (c *Checker) Run(ctx context.Context)

type Option

type Option func(o *options)

Option is a function that applies a health check option.

func WithAddress

func WithAddress(address string) Option

WithAddress sets the endpoint address for the health check.

func WithFailureThreshold

func WithFailureThreshold(threshold int) Option

WithFailureThreshold sets the failure threshold for the health check.

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

WithHTTPClient sets the http.Client to use.

func WithHealthyStateInterval

func WithHealthyStateInterval(interval time.Duration) Option

WithHealthyStateInterval 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.

func WithUnHealthyStateInterval

func WithUnHealthyStateInterval(interval time.Duration) Option

WithUnHealthyStateInterval sets the interval for the health check.

Jump to

Keyboard shortcuts

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