Documentation ¶
Overview ¶
Package failover implements the failover procedure by sending pings and checking if the VPN is up
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DroppedConMon ¶
type DroppedConMon struct {
// contains filtered or unexported fields
}
The DroppedConMon is a connection monitor that checks for an increase in rx bytes in certain intervals
func New ¶
func New(readRxBytes func() (int64, error)) *DroppedConMon
New creates a failover monitor for the gateway and the rx bytes function reader This is a simple wrapper over `NewDroppedMonitor` to create one with the default settings If this function returns True, the connection is dropped. False means it has exited and we don't know for sure if it's dropped or not
func NewDroppedMonitor ¶
func NewDroppedMonitor(pingInterval time.Duration, pDropped int, readRxBytes func() (int64, error)) *DroppedConMon
NewDroppedMonitor creates a new failover monitor `pingInterval` is the interval in which to send pings `pDropped` is how many pings we need to send before we deem it is dropped `readRxBytes` is a function that gets the rx bytes from the client