Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeepAliveDeadlineExceeded = fmt.Errorf("keepalive: %w", context.DeadlineExceeded)
ErrKeepAliveDeadlineExceeded occurs during waiting for pong response
Functions ¶
This section is empty.
Types ¶
type ClientConn ¶
type Config ¶
type Config struct { // Interval between two success pings Interval time.Duration // WaitForPong how long it will waits for pong response. WaitForPong time.Duration // NewRetryPolicy creates retry policy for the connection when ping fails. NewRetryPolicy RetryFuncFactory }
Config KeepAlive config
func MakeConfig ¶
MakeConfig creates a policy that detects dropped connections within the connTimeout limit while attempting to make 3 pings during that period.
type KeepAlive ¶
type KeepAlive struct {
// contains filtered or unexported fields
}
func (*KeepAlive) Run ¶
func (k *KeepAlive) Run(c ClientConn) error
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
A Option sets options such as config etc.
type RetryFuncFactory ¶
type RetryFuncFactory = func() RetryFunc
Click to show internal directories.
Click to hide internal directories.