Versions in this module Expand all Collapse all v0 v0.0.2 Mar 6, 2018 Changes in this version type TLSConfig + func (c *TLSConfig) AddClientCertFromFile(clientFile string) (string, error) + func (c *TLSConfig) MakeConfig() *tls.Config v0.0.1 Feb 13, 2018 Changes in this version + var ErrMultiDocCommandResponse = errors.New("command returned multiple documents") + var ErrNoCommandResponse = errors.New("no command response document") + var ErrNoDocCommandResponse = errors.New("command returned no documents") + var ErrPoolClosed = errors.New("pool is closed") + var ErrUnknownCommandFailure = errors.New("unknown command failure") + func ExecuteCommand(ctx context.Context, c Connection, request msg.Request) (bson.Reader, error) + func ExecuteCommands(ctx context.Context, c Connection, requests []msg.Request) ([]bson.Reader, error) + func IsCommandNotFound(err error) bool + func IsNsNotFound(err error) bool + type CommandError struct + Code int32 + Message string + Name string + func (e *CommandError) Error() string + type CommandFailureError struct + Msg string + Response bson.Reader + func (e *CommandFailureError) Error() string + func (e *CommandFailureError) Message() string + type CommandResponseError struct + Message string + func NewCommandResponseError(msg string) *CommandResponseError + func (e *CommandResponseError) Error() string + type Connection interface + Alive func() bool + Close func() error + CloseIgnoreError func() + Expired func() bool + LocalAddr func() net.Addr + MarkDead func() + Model func() *model.Conn + Read func(context.Context, int32) (msg.Response, error) + Write func(context.Context, ...msg.Request) error + func New(ctx context.Context, addr model.Addr, opts ...Option) (Connection, error) + type Dialer func(ctx context.Context, dialer *net.Dialer, network, address string) (net.Conn, error) + type Error struct + ConnectionID string + func (e *Error) Error() string + func (e *Error) Inner() error + func (e *Error) Message() string + type Opener func(context.Context, model.Addr, ...Option) (Connection, error) + type Option func(*config) error + func WithAppName(name string) Option + func WithCodec(codec msg.Codec) Option + func WithConnectTimeout(timeout time.Duration) Option + func WithDialer(dialer Dialer) Option + func WithIdleTimeout(timeout time.Duration) Option + func WithLifeTimeout(timeout time.Duration) Option + func WithReadTimeout(timeout time.Duration) Option + func WithTLSConfig(tlsConfig *TLSConfig) Option + func WithWrappedDialer(wrapper func(dialer Dialer) Dialer) Option + func WithWriteTimeout(timeout time.Duration) Option + type Pool interface + Clear func() + Close func() error + Get func(context.Context) (Connection, error) + func NewPool(maxSize uint64, provider Provider) Pool + type Provider func(context.Context) (Connection, error) + func CappedProvider(max uint64, provider Provider) Provider + func OpeningProvider(opener Opener, addr model.Addr, opts ...Option) Provider + type TLSConfig struct + func NewTLSConfig() *TLSConfig + func (c *TLSConfig) AddCaCertFromFile(caFile string) error + func (c *TLSConfig) SetInsecure(allow bool) + type TrackedConnection struct + func Tracked(c Connection) *TrackedConnection + func (tc *TrackedConnection) Alive() bool + func (tc *TrackedConnection) Close() error + func (tc *TrackedConnection) Expired() bool + func (tc *TrackedConnection) Inc() + func (tc *TrackedConnection) Model() *model.Conn + func (tc *TrackedConnection) Read(ctx context.Context, responseTo int32) (msg.Response, error) + func (tc *TrackedConnection) Write(ctx context.Context, reqs ...msg.Request) error