Documentation
¶
Index ¶
- Constants
- type Check
- type Checks
- type Destination
- type Instance
- type Mon
- func (m *Mon) Init(services map[Instance]Target) error
- func (m *Mon) Probe(addr netip.Addr, c Check) (ok bool, s string)
- func (m *Mon) ProbeVIP(vip, addr netip.Addr, c Check) (ok bool, s string)
- func (m *Mon) Start(addr netip.Addr, services map[Instance]Target) error
- func (m *Mon) Status(svc Service, dst Destination) (status Status, _ bool)
- func (m *Mon) Stop()
- func (m *Mon) Update(checks map[Instance]Target)
- type Notifier
- type Prober
- type SYN
- type Service
- type Services
- type Status
- type SynChecks
- type Target
Constants ¶
View Source
const ( GET method = false HEAD method = true UDP method = false TCP method = true )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
type Check struct {
// Type of check; http, https, syn, dns
Type string `json:"type,omitempty"`
// TCP/UDP port to use for L4/L7 checks
Port uint16 `json:"port,omitempty"`
// HTTP Host header to send in healthcheck
Host string `json:"host,omitempty"`
// Path of resource to use when building a URI for HTTP/HTTPS healthchecks
Path string `json:"path,omitempty"`
// Expected HTTP status codes to allow check to succeed
Expect []int `json:"expect,omitempty"`
// Method - HTTP: GET=false, HEAD=true DNS: UDP=false TCP=true
Method method `json:"method,omitempty"`
}
type Destination ¶
type Instance ¶
type Instance struct {
Service Service
Destination Destination
}
type Mon ¶
type Mon struct {
C chan bool // Used to signal changes in monitored service status
Prober Prober // Override standard probing functionalitry
Notifier Notifier // For logging
CloseIdleConnections bool // Call CloseIdleConnections on http.Client after probe if true
IPv4 netip.Addr // IP address to use as source for SYN probes (optional)
// contains filtered or unexported fields
}
func (*Mon) ProbeVIP ¶ added in v0.1.4
in case the http/s check has no host defined, use the vip as the host portion in the url (for DSR checks)
Click to show internal directories.
Click to hide internal directories.