hc

package
v0.0.0-...-1b7c243 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2017 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package hc provides a basic type for generic checks. With this packages, components can provide their own HealthChecker and register then for later use.

Index

Constants

View Source
const HealthCheckOK = "WORKING"

HealthCheckOK is the status returned when the healthcheck works.

Variables

View Source
var ErrDisabledComponent = errors.New("disabled component")

Functions

func AddChecker

func AddChecker(name string, check func() error)

AddChecker adds a new checker to the internal list of checkers. Checkers added to this list can then be checked using the Check function.

Types

type Result

type Result struct {
	Name     string
	Status   string
	Duration time.Duration
}

Result represents a result of a processed healthcheck call. It will contain the name of the healthchecker and the status returned in the checker call.

func Check

func Check() []Result

Check check the status of all registered checkers and return a list of results.

Jump to

Keyboard shortcuts

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