health

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: Apache-2.0 Imports: 10 Imported by: 9

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
}

health.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, interval time.Duration) 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"`
}

Jump to

Keyboard shortcuts

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