health

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: Apache-2.0 Imports: 12 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WaitForTestDial added in v0.12.2

func WaitForTestDial(ctx context.Context, addr *net.UnixAddr)

WaitForTestDial tries to create a client connection to the given target with a blocking dial and a timeout specified in testDialTimeout. Nothing is done with the connection, which is just closed in case it is created.

Types

type Checker

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

Checker is responsible for running health checks and serving the healthcheck HTTP paths

func NewChecker

func NewChecker(config Config, log logrus.FieldLogger) *Checker

func (*Checker) AddCheck

func (c *Checker) AddCheck(name string, checker health.ICheckable) error

func (*Checker) ListenAndServe

func (c *Checker) ListenAndServe(ctx context.Context) error

type Config

type Config struct {
	ListenerEnabled bool `hcl:"listener_enabled"`

	// Address and port to listen on, defaulting to localhost:80
	BindAddress string `hcl:"bind_address"`
	BindPort    string `hcl:"bind_port"`

	// Paths for /ready and /live
	ReadyPath string `hcl:"ready_path"`
	LivePath  string `hcl:"live_path"`

	UnusedKeys []string `hcl:",unusedKeys"`
}

type Details added in v0.12.2

type Details struct {
	Message string `json:"message,omitempty"`
}

Details are additional data to be used when the system is ready

Jump to

Keyboard shortcuts

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