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{})
Click to show internal directories.
Click to hide internal directories.