Documentation ¶
Overview ¶
Package redialer provides a generic redialer for connection-like types in Go. It is useful when you need to access a connection from multiple goroutines. It helps to keep the reconnection logic in a single goroutine and provide protected access to the connection.
See netredialer subpackage for usage example.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is the type that is returned from Redialer.Conn method.
type Dialer ¶
type Dialer interface { Addr() string // used in logs Dial() (conn io.Closer, err error) OnConnect(conn *Conn) error }
Dialer is the interface passed to New function.
type Redialer ¶
type Redialer struct {
// contains filtered or unexported fields
}
Redialer keeps connections connected.
Directories ¶
Path | Synopsis |
---|---|
Package amqpredialer provides a redialer for github.com/streadway/amqp.Conn.
|
Package amqpredialer provides a redialer for github.com/streadway/amqp.Conn. |
Package netredialer provides a reconnecting net.Conn implementation.
|
Package netredialer provides a reconnecting net.Conn implementation. |
Package smtpredialer provides a redialer for smtp.Client.
|
Package smtpredialer provides a redialer for smtp.Client. |
Click to show internal directories.
Click to hide internal directories.