Back to godoc.org

Package probe

v5.2.0-release+incompatible (release)
Latest Go to latest
Published: Apr 16, 2020 | License: LGPL-3.0 | Module: github.com/goodrain/rainbond

Index

Package Files

type HTTPProbe

type HTTPProbe struct {
	Name          string
	Address       string
	ResultsChan   chan *v1.HealthStatus
	Ctx           context.Context
	Cancel        context.CancelFunc
	TimeInterval  int
	MaxErrorsNum  int
	TimeoutSecond int
}

HTTPProbe probes through the http protocol

func (*HTTPProbe) Check

func (h *HTTPProbe) Check()

Check starts http probe.

func (*HTTPProbe) GetHTTPHealth

func (h *HTTPProbe) GetHTTPHealth() map[string]string

GetHTTPHealth get http health

func (*HTTPProbe) HTTPCheck

func (h *HTTPProbe) HTTPCheck()

HTTPCheck http check

func (*HTTPProbe) Stop

func (h *HTTPProbe) Stop()

Stop stops http probe.

type Probe

type Probe interface {
	Check()
	Stop()
}

Probe probe

func CreateProbe

func CreateProbe(ctx context.Context, statusChan chan *v1.HealthStatus, v *v1.Service) Probe

CreateProbe create probe

type TCPProbe

type TCPProbe struct {
	Name          string
	Address       string
	ResultsChan   chan *v1.HealthStatus
	Ctx           context.Context
	Cancel        context.CancelFunc
	TimeoutSecond int
	TimeInterval  int
	MaxErrorsNum  int
}

TCPProbe probes through the tcp protocol

func (*TCPProbe) Check

func (h *TCPProbe) Check()

Check starts tcp probe.

func (*TCPProbe) GetTCPHealth

func (h *TCPProbe) GetTCPHealth() map[string]string

GetTCPHealth get tcp health

func (*TCPProbe) Stop

func (h *TCPProbe) Stop()

Stop stops tcp probe.

func (*TCPProbe) TCPCheck

func (h *TCPProbe) TCPCheck()

TCPCheck -

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier