health

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 6 Imported by: 4

Documentation

Overview

Package health defines standard interfaces and utilities for health checks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Liveness

func Liveness(cf ...CheckFunc) http.Handler

Liveness returns an HTTP handler for checking the health of the service.

func Readiness

func Readiness() http.Handler

Readiness returns an HTTP handler for checking Readiness state. Will return 503 until Ready() is called

func Ready

func Ready()

Ready marks the service as ready to receive traffic.

Types

type CheckFunc

type CheckFunc func(context.Context) error

CheckFunc function signature for health checks.

func Check

func Check(name string, addr string) CheckFunc

Check return a CheckFunc for checking if the target server is OK or not. The target server can be considered OK, if its return status code is "200 OK". If the given addr is in simple form of "server:port", it will be transformed to http://server:port/internal/liveness

Jump to

Keyboard shortcuts

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