healthcheck

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 13 Imported by: 5

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

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