Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultTimeout = time.Second DefaultInterval = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func CreateHealthCheck ¶
func CreateHealthCheck(cfg v2.HealthCheck) types.HealthChecker
CreateHealthCheck is a extendable function that can create different health checker by different health check session. The Default session is TCPDial session
func RegisterCommonCallbacks ¶
func RegisterCommonCallbacks(name string, cb types.HealthCheckCb) bool
func RegisterSessionFactory ¶
func RegisterSessionFactory(p types.ProtocolName, f types.HealthCheckSessionFactory)
Types ¶
type TCPDialSession ¶
type TCPDialSession struct {
// contains filtered or unexported fields
}
func (*TCPDialSession) CheckHealth ¶
func (s *TCPDialSession) CheckHealth() bool
func (*TCPDialSession) OnTimeout ¶
func (s *TCPDialSession) OnTimeout()
type TCPDialSessionFactory ¶
type TCPDialSessionFactory struct{}
func (*TCPDialSessionFactory) NewSession ¶
func (f *TCPDialSessionFactory) NewSession(cfg map[string]interface{}, host types.Host) types.HealthCheckSession
Click to show internal directories.
Click to hide internal directories.