health

package
v0.0.0-...-4d3f714 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultInterval = time.Second * 30
	DefaultTimeout  = time.Second * 10
)

Variables

View Source
var (
	ErrPortNameEmpty = errors.New("portName is empty")
	ErrInvalidURI    = errors.New("uri must start with /")
)

Error definitions

Functions

func ChangeStatus

func ChangeStatus(status string)

ChangeStatus change status in local and remote

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 InstallChecker

func InstallChecker(n string, c L7Check)

InstallChecker install checkers

func L4Check

func L4Check(address string) error

L4Check check tcp connection

func Run

func Run() error

Run Launch go routines to check service health

func UpdateInstanceStatus

func UpdateInstanceStatus(err error)

UpdateInstanceStatus update status in registrator, it just works in client side discovery

Types

type Deal

type Deal func(err error)

Deal handle the unhealthy status

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

Jump to

Keyboard shortcuts

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