Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthCheck ¶ added in v1.1.0
type HealthCheck struct {
// contains filtered or unexported fields
}
HealthCheck provides an HTTP endpoint that returns the health status of the service
func New ¶ added in v1.1.0
func New(state Status, options ...Option) *HealthCheck
New creates a HealthCheck with the specified initial state.
func (*HealthCheck) Close ¶ added in v1.1.0
func (hc *HealthCheck) Close() error
Close stops the HTTP server
func (*HealthCheck) Get ¶ added in v1.1.0
func (hc *HealthCheck) Get() Status
Get the current status of this health check
func (*HealthCheck) Ready ¶ added in v1.1.0
func (hc *HealthCheck) Ready()
Ready is a shortcut for Set(Ready) (kept for backwards compatibility)
func (*HealthCheck) Serve ¶ added in v1.1.0
func (hc *HealthCheck) Serve(port int) (*HealthCheck, error)
Serve starts HTTP server on the specified port.
func (*HealthCheck) Set ¶ added in v1.1.0
func (hc *HealthCheck) Set(state Status)
Set a new health check status
type Option ¶ added in v1.1.0
type Option func(*HealthCheck)
Option is a functional option for passing parameters to New()
Click to show internal directories.
Click to hide internal directories.