Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HealthCheck ¶
type HealthCheck struct {
// contains filtered or unexported fields
}
HealthCheck is looking after the proxy origin availability using either a set by HealthCheck.SetHealthCheck check function or the defaultHealthCheck func.
func NewHealthCheck ¶
func NewHealthCheck(origin *url.URL) *HealthCheck
NewHealthCheck is the ProxyHealth constructor
func (*HealthCheck) IsAvailable ¶
func (h *HealthCheck) IsAvailable() bool
IsAvailable returns whether the proxy origin was successfully connected at the last check time.
func (*HealthCheck) SetCheckFunc ¶
SetCheckFunc sets the passed check func as the algorithm of checking the origin availability and calls for it with interval defined with the passed period variable. The SetCheckFunc provides a concurrency save way of setting and replacing the current health check algorithm, so the Stop function shouldn't be called before the SetCheckFunc call.
func (*HealthCheck) Stop ¶
func (h *HealthCheck) Stop()
Stop gracefully stops the instance execution. Should be called when the instance work is no more needed.