Versions in this module Expand all Collapse all v0 v0.1.0 Dec 6, 2018 Changes in this version + var ErrConnectionClosed = Error + var ErrPoolClosed = PoolError("pool is closed") + var ErrPoolConnected = PoolError("pool is connected") + var ErrPoolDisconnected = PoolError("pool is disconnected or disconnecting") + var ErrSizeLargerThanCapacity = PoolError("size is larger than capacity") + type Addr string + func (Addr) Canonicalize() Addr + func (Addr) Network() string + func (Addr) String() string + type Connection interface + Alive func() bool + Close func() error + Expired func() bool + ID func() string + ReadWireMessage func(context.Context) (wiremessage.WireMessage, error) + WriteWireMessage func(context.Context, wiremessage.WireMessage) error + func New(ctx context.Context, addr address.Address, opts ...Option) (Connection, *description.Server, error) + type Dialer interface + DialContext func(ctx context.Context, network, address string) (net.Conn, error) + var DefaultDialer Dialer = &net.Dialer{} + type DialerFunc func(ctx context.Context, network, address string) (net.Conn, error) + func (df DialerFunc) DialContext(ctx context.Context, network, address string) (net.Conn, error) + type Error struct + ConnectionID string + Wrapped error + func (e Error) Error() string + type Handler interface + HandleConnection func(Connection) + type Handshaker interface + Handshake func(context.Context, address.Address, wiremessage.ReadWriter) (description.Server, error) + type HandshakerFunc func(context.Context, address.Address, wiremessage.ReadWriter) (description.Server, error) + func (hf HandshakerFunc) Handshake(ctx context.Context, addr address.Address, rw wiremessage.ReadWriter) (description.Server, error) + type Listener interface + Accept func() (Connection, error) + Addr func() Addr + Close func() error + func Listen(network, address string) (Listener, error) + type NetworkError struct + ConnectionID string + Wrapped error + func (ne NetworkError) Error() string + type Option func(*config) error + func WithAppName(fn func(string) string) Option + func WithCompressors(fn func([]compressor.Compressor) []compressor.Compressor) Option + func WithConnectTimeout(fn func(time.Duration) time.Duration) Option + func WithDialer(fn func(Dialer) Dialer) Option + func WithHandshaker(fn func(Handshaker) Handshaker) Option + func WithIdleTimeout(fn func(time.Duration) time.Duration) Option + func WithLifeTimeout(fn func(time.Duration) time.Duration) Option + func WithMonitor(fn func(*event.CommandMonitor) *event.CommandMonitor) Option + func WithReadTimeout(fn func(time.Duration) time.Duration) Option + func WithTLSConfig(fn func(*TLSConfig) *TLSConfig) Option + func WithWriteTimeout(fn func(time.Duration) time.Duration) Option + type Pool interface + Connect func(context.Context) error + Disconnect func(context.Context) error + Drain func() error + Get func(context.Context) (Connection, *description.Server, error) + func NewPool(addr address.Address, size, capacity uint64, opts ...Option) (Pool, error) + type PoolError string + func (pe PoolError) Error() string + type Proxy struct + Pool Pool + Processor wiremessage.Transformer + func (*Proxy) HandleConnection(Connection) + type Server struct + Addr Addr + Handler Handler + func (*Server) ListenAndServe() error + func (*Server) Serve(Listener) error + func (*Server) Shutdown(context.Context) error + type TLSConfig struct + func NewTLSConfig() *TLSConfig + func (c *TLSConfig) AddCACertFromFile(file string) error + func (c *TLSConfig) AddClientCertFromFile(clientFile string) (string, error) + func (c *TLSConfig) Clone() *TLSConfig + func (c *TLSConfig) SetClientCertDecryptPassword(f func() string) + func (c *TLSConfig) SetInsecure(allow bool)