Documentation ¶
Index ¶
- Constants
- Variables
- func ChangeStatus(status string)
- func CheckService(c *config.HealthCheck, l7check L7Check, address string) error
- func HTTPCheck(check *config.HealthCheck, address string) error
- func InstallChecker(n string, c L7Check)
- func L4Check(address string) error
- func Run() error
- func UpdateInstanceStatus(err error)
- type Deal
- type L7Check
Constants ¶
View Source
const ( DefaultInterval = time.Second * 30 DefaultTimeout = time.Second * 10 )
Variables ¶
View Source
var ( ErrPortEmpty = errors.New("port is empty") ErrInvalidURI = errors.New("uri must start with /") )
Error definitions
Functions ¶
func CheckService ¶
func CheckService(c *config.HealthCheck, l7check L7Check, address string) error
CheckService check service health based on config
func HTTPCheck ¶
func HTTPCheck(check *config.HealthCheck, address string) error
HTTPCheck checks http service
func UpdateInstanceStatus ¶
func UpdateInstanceStatus(err error)
UpdateInstanceStatus update status in registrator, it just works in client side discovery
Types ¶
type L7Check ¶
type L7Check func(check *config.HealthCheck, address string) error
L7Check is the interface for L7 checker
func ParseConfig ¶
func ParseConfig(c *config.HealthCheck) (string, L7Check, error)
ParseConfig validate config and return address, checker port name must not be empty port name must named as {protocol}-{name} protocol must has checker
Click to show internal directories.
Click to hide internal directories.