health

package
v0.0.0-...-c7e85b4 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenericHealthCheck

type GenericHealthCheck struct {
	Name          string        `json:"name"`
	Period        time.Duration `json:"period_ns"`
	LastHeartBeat time.Time     `json:"last_heartbeat,omitempty"`
	// contains filtered or unexported fields
}

func NewGenericHealthCheck

func NewGenericHealthCheck(name string, period time.Duration) *GenericHealthCheck

func (*GenericHealthCheck) Healthy

func (hc *GenericHealthCheck) Healthy() bool

func (*GenericHealthCheck) HeartBeat

func (hc *GenericHealthCheck) HeartBeat()

func (*GenericHealthCheck) String

func (hc *GenericHealthCheck) String() string

type HealthCheck

type HealthCheck interface {
	Healthy() bool
}

type HealthManager

type HealthManager struct {
	Checks []HealthCheck
}

func NewHealthManager

func NewHealthManager(c ...HealthCheck) *HealthManager

func (*HealthManager) Healthy

func (hm *HealthManager) Healthy() bool

func (*HealthManager) RegisterCheck

func (hm *HealthManager) RegisterCheck(c ...HealthCheck)

func (*HealthManager) Status

func (hm *HealthManager) Status() (healthy, unhealthy []HealthCheck)

type HealthPublisher

type HealthPublisher struct {
	BindAddress   string
	Path          string
	Port          string
	HealthManager *HealthManager
}

func NewHealthPublisher

func NewHealthPublisher(bindAddr string, path string, port string, healthManager *HealthManager) *HealthPublisher

func (*HealthPublisher) ChecksHandler

func (hp *HealthPublisher) ChecksHandler(w http.ResponseWriter, req *http.Request)

func (*HealthPublisher) HealthHandler

func (hp *HealthPublisher) HealthHandler(w http.ResponseWriter, req *http.Request)

func (*HealthPublisher) Run

func (hp *HealthPublisher) Run(stopc <-chan struct{})

Jump to

Keyboard shortcuts

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