healthcheck

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2017 License: Apache-2.0 Imports: 13 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	Start(chan error)
	Stop()
}

Agent executes a health check a given interval.

func BuildAgent

func BuildAgent(conf config.HealthCheck) (Agent, error)

BuildAgent constructs a health check agent using the given configuration.

func BuildAgents

func BuildAgents(confs []config.HealthCheck) ([]Agent, error)

BuildAgents constructs health check agents.

func NewAgent

func NewAgent(check Check, interval time.Duration) Agent

NewAgent creates a new health check agent.

type Check

type Check interface {
	// Execute the health check and return an error on failure.
	Execute() error
}

Check is an interface for performing a health check.

func NewCommand

func NewCommand(conf config.HealthCheck) (Check, error)

NewCommand creates a new executable health check.

func NewHTTP

func NewHTTP(conf config.HealthCheck) (Check, error)

NewHTTP creates a new HTTP health check.

func NewTCP

func NewTCP(conf config.HealthCheck) (Check, error)

NewTCP creates a new TCP health check.

type Command

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

Command performs a health check by running a command and inspecting the results.

func (*Command) Execute

func (c *Command) Execute() error

Execute the command and check the results. TODO: return any of stdout, stderr?

type HTTP

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

HTTP performs periodic HTTP health checks.

func (*HTTP) Execute

func (h *HTTP) Execute() error

Execute a HTTP operation on the URL and check the response code.

type TCP

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

TCP health check.

func (*TCP) Execute

func (t *TCP) Execute() error

Execute the TCP health check by attempting to connect to the URL via TCP.

Jump to

Keyboard shortcuts

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