Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypePing = "ping" TypeHTTP = "http" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthCheck ¶
type HealthCheck struct { Name string `record:"name,optional"` Type string `record:"type,optional"` Timeout time.Duration `record:"timeout"` Failures int `record:"failures"` // contains filtered or unexported fields }
func (*HealthCheck) Copy ¶
func (hc *HealthCheck) Copy() *HealthCheck
Copies the health check without duplicating the target.
func (*HealthCheck) SetRequestTransformer ¶
func (hc *HealthCheck) SetRequestTransformer(transformer func(interface{}) interface{})
func (*HealthCheck) SetTarget ¶
func (hc *HealthCheck) SetTarget(target string)
func (*HealthCheck) Target ¶
func (hc *HealthCheck) Target() string
type HealthCheckAction ¶
type HealthCheckAction struct { Check *HealthCheck FailedAction func(*HealthCheck) error ReviveAction func(*HealthCheck) error }
type HealthChecker ¶
type HealthChecker struct { HealthChecks []*HealthCheckAction Failures []int // contains filtered or unexported fields }
func Init ¶
func Init(checks []*HealthCheckAction, minDuration time.Duration) *HealthChecker
func (*HealthChecker) Shutdown ¶
func (hcr *HealthChecker) Shutdown()
func (*HealthChecker) Start ¶
func (hcr *HealthChecker) Start()
Click to show internal directories.
Click to hide internal directories.