status

package
v0.0.0-...-c283e9f Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2021 License: BSD-3-Clause Imports: 3 Imported by: 36

Documentation

Index

Constants

View Source
const Path = "/.well-known/status"

Variables

View Source
var (
	Healthy   = Status{Status: CodeHealthy}
	Unhealthy = Status{Status: CodeUnhealthy}

	HealthyHandler Handler = func() Status { return Healthy }
)

Functions

func AddHandler

func AddHandler(h Handler)

Types

type Code

type Code string
const (
	CodeHealthy   Code = "healthy"
	CodeUnhealthy Code = "unhealthy"
)

type Handler

type Handler func() Status

func SimpleHandler

func SimpleHandler(f func() error) Handler

func (Handler) ServeHTTP

func (f Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type Status

type Status struct {
	Status  Code             `json:"status"`
	Detail  *json.RawMessage `json:"detail,omitempty"`
	Version string           `json:"version,omitempty"`
}

func New

func New(healthy bool, detail interface{}) (Status, error)

Jump to

Keyboard shortcuts

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