Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnMonitor ¶ added in v1.2.0
type ConnMonitor struct{}
ConnMonitor represents a connection monitor that can be used to check the availability of a backend server by establishing a TCP connection with the specified IP address and port. It provides a method `CheckBackendConnection` to perform the check and returns an error if the connection cannot be established within the timeout period. This monitor does not retry the connection and closes the connection before returning.
func (ConnMonitor) CheckBackendConnection ¶ added in v1.2.0
func (ConnMonitor) CheckBackendConnection(ipAddress string, port int, haproxyv2 bool, useTLS bool) error
CheckBackendConnection checks the availability of a backend server by trying to establish a TCP connection with the specified IP address and port. It returns an error if the connection cannot be established within the timeout period. The function does not retry the connection and closes the connection before returning.
type Monitor ¶ added in v1.2.0
type Monitor interface {
// CheckBackendConnection checks the backend connection of a server based on the provided IP address, port number, whether the server runs with HAProxy V2 protocol, and whether TLS should be used. It returns an error if the connection fails.
CheckBackendConnection(ipAddress string, port int, haproxyv2 bool, useTLS bool) error
}
Monitor represents an interface used to check the backend connection of a server. It provides the method CheckBackendConnection to perform the check and returns an error if the connection fails. The CheckBackendConnection method takes the IP address, port number, whether the server runs with HAProxy V2 protocol, and whether TLS should be used as parameters.
func NewMonitor ¶ added in v1.2.0
func NewMonitor() Monitor
NewMonitor returns a new instance of the Monitor interface. The returned Monitor is implemented by the ConnMonitor struct.