health

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2015 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package health defines a standard healthcheck response format and expose a function that summarizes registered healthchecks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Healthcheck

func Healthcheck() (bool, map[string]interface{})

Healthcheck calls every registered Healthchecker and summarize their output

func RegisterHealthchecker

func RegisterHealthchecker(name string, f Healthchecker)

RegisterHealthchecker registers a Healthchecker function which will be part of Healthchecks

Types

type Healthchecker

type Healthchecker func() Status

A Healthchecker function is a method returning the Status of the tested service

type Status

type Status struct {
	// IsEssential determines if the service is essential to the app, which can't
	// run in case of a failure
	IsEssential bool
	// IsHealthy defines whether the service is working or not
	IsHealthy bool
	// Details gives informations specific to the service
	Details interface{}
}

Status defines a way to know the health status of a service

Jump to

Keyboard shortcuts

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