healthcheck

package
v0.0.0-...-e3e1183 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

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.Protocol, 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

Jump to

Keyboard shortcuts

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