server

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// ContentType is the media (MIME) type returned by the server.
	ContentType = "application/health+json"

	// Port is the default port for checking health over HTTP.
	Port = 9_999
)

Variables

This section is empty.

Functions

func Handle

func Handle(w http.ResponseWriter, req *http.Request)

Handle serves a health response over HTTP. It supports the GET, HEAD and OPTIONS methods as well as content negotiation.

func Start

func Start() error

Start starts an HTTP server at 0.0.0.0:9999 serving health checks. Can be called multiple times but will only start one server.

Will block until the server is listening.

Types

This section is empty.

Jump to

Keyboard shortcuts

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