healthz

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2016 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package healthz implements basic http server health checking. Usage:

import _ "healthz" registers a handler on the path '/healthz', that serves 200s

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultHealthz added in v0.14.0

func DefaultHealthz(checks ...HealthzChecker)

DefaultHealthz installs the default healthz check to the http.DefaultServeMux.

func InstallHandler

func InstallHandler(mux mux, checks ...HealthzChecker)

InstallHandler registers a handler for health checking on the path "/healthz" to mux.

Types

type HealthzChecker added in v0.14.0

type HealthzChecker interface {
	Name() string
	Check(req *http.Request) error
}

HealthzChecker is a named healthz check.

var PingHealthz HealthzChecker = ping{}

PingHealthz returns true automatically when checked

func NamedCheck added in v0.14.0

func NamedCheck(name string, check func(r *http.Request) error) HealthzChecker

NamedCheck returns a health checker for the given name and function.

Jump to

Keyboard shortcuts

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