status

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSONResponse

func JSONResponse(w http.ResponseWriter, res Response)

Types

type DefaultStatus

type DefaultStatus struct{}

func (DefaultStatus) CheckUp

func (ds DefaultStatus) CheckUp(name, version string) http.HandlerFunc

func (DefaultStatus) Health

func (ds DefaultStatus) Health(name, version string) http.HandlerFunc

func (DefaultStatus) Ready

func (ds DefaultStatus) Ready(name, version string) http.HandlerFunc

type Response

type Response struct {
	Name    string `json:"name,omitempty"`
	Version string `json:"version,omitempty"`
	Status  string `json:"status,omitempty"`
}

type Status

type Status interface {
	// Health returns an handler function that compute the liveness property of the service
	Health(name, version string) http.HandlerFunc
	// Ready returns an handler function that compute the readiness property of the service
	Ready(name, version string) http.HandlerFunc
	// CheckUp returns an handler function that verify the status of potential dependent services
	// and report
	CheckUp(name, version string) http.HandlerFunc
}

Jump to

Keyboard shortcuts

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