health

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2017 License: Apache-2.0 Imports: 2 Imported by: 10

Documentation

Overview

package health defines health checking primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	Name() string
	// Check runs a health check and records any errors into the specified reporter.
	Check(context.Context, Reporter)
}

Checker is an interface for executing a health check.

type CheckerRepository

type CheckerRepository interface {
	AddChecker(checker Checker)
}

CheckerRepository represents a collection of checkers.

type Checkers

type Checkers []Checker

Checkers is a collection of checkers. It implements CheckerRepository interface.

func (*Checkers) AddChecker

func (r *Checkers) AddChecker(checker Checker)

type Probes

type Probes []*pb.Probe

Probes is a list of probes. It implements the Reporter interface.

func (*Probes) Add

func (r *Probes) Add(probe *pb.Probe)

func (Probes) GetFailed added in v0.0.8

func (r Probes) GetFailed() []*pb.Probe

GetFailed returns all probes that reported an error

func (Probes) GetProbes

func (r Probes) GetProbes() []*pb.Probe

func (Probes) Status

func (r Probes) Status() pb.NodeStatus_Type

Status computes the node status based on collected probes.

type Reporter

type Reporter interface {
	// Add adds an health probe for a specific node.
	Add(probe *pb.Probe)
	// Status retrieves the collected status after executing all checks.
	GetProbes() []*pb.Probe
}

Reporter defines an obligation to report structured errors.

Jump to

Keyboard shortcuts

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