Versions in this module Expand all Collapse all v0 v0.1.0 Dec 6, 2018 Changes in this version + const BatchSize + var ErrDocumentTooLarge = errors.New("an inserted document is too large") + 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 ErrNonPrimaryRP = errors.New("read preference in a transaction must be primary") + var ErrUnacknowledgedWrite = errors.New("unacknowledged write") + var ErrUnknownCommandFailure = errors.New("unknown command failure") + var NetworkError = "NetworkError" + var TransientTransactionError = "TransientTransactionError" + var UnknownTransactionCommitResult = "UnknownTransactionCommitResult" + func ClientDoc(app string) bsonx.Doc + func DecodeError(wm wiremessage.WireMessage) error + func IsNotFound(err error) bool + func IsWriteConcernErrorRetryable(wce *result.WriteConcernError) bool + type AbortTransaction struct + Session *session.Client + func (at *AbortTransaction) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *AbortTransaction + func (at *AbortTransaction) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (at *AbortTransaction) Err() error + func (at *AbortTransaction) Result() (result.TransactionResult, error) + func (at *AbortTransaction) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.TransactionResult, error) + type Aggregate struct + Clock *session.ClusterClock + CursorOpts []bsonx.Elem + NS Namespace + Opts []bsonx.Elem + Pipeline bsonx.Arr + ReadConcern *readconcern.ReadConcern + ReadPref *readpref.ReadPref + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (a *Aggregate) Decode(desc description.SelectedServer, cb CursorBuilder, wm wiremessage.WireMessage) *Aggregate + func (a *Aggregate) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (a *Aggregate) Err() error + func (a *Aggregate) HasDollarOut() bool + func (a *Aggregate) Result() (Cursor, error) + func (a *Aggregate) RoundTrip(ctx context.Context, desc description.SelectedServer, cb CursorBuilder, ...) (Cursor, error) + type BuildInfo struct + func (bi *BuildInfo) Decode(wm wiremessage.WireMessage) *BuildInfo + func (bi *BuildInfo) Encode() (wiremessage.WireMessage, error) + func (bi *BuildInfo) Err() error + func (bi *BuildInfo) Result() (result.BuildInfo, error) + func (bi *BuildInfo) RoundTrip(ctx context.Context, rw wiremessage.ReadWriter) (result.BuildInfo, error) + type CommitTransaction struct + Session *session.Client + func (ct *CommitTransaction) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *CommitTransaction + func (ct *CommitTransaction) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (ct *CommitTransaction) Err() error + func (ct *CommitTransaction) Result() (result.TransactionResult, error) + func (ct *CommitTransaction) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.TransactionResult, error) + type Count struct + Clock *session.ClusterClock + NS Namespace + Opts []bsonx.Elem + Query bsonx.Doc + ReadConcern *readconcern.ReadConcern + ReadPref *readpref.ReadPref + Session *session.Client + func (c *Count) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *Count + func (c *Count) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (c *Count) Err() error + func (c *Count) Result() (int64, error) + func (c *Count) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (int64, error) + type CountDocuments struct + Clock *session.ClusterClock + NS Namespace + Opts []bsonx.Elem + Pipeline bsonx.Arr + ReadConcern *readconcern.ReadConcern + ReadPref *readpref.ReadPref + Session *session.Client + func (c *CountDocuments) Decode(ctx context.Context, desc description.SelectedServer, cb CursorBuilder, ...) *CountDocuments + func (c *CountDocuments) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (c *CountDocuments) Err() error + func (c *CountDocuments) Result() (int64, error) + func (c *CountDocuments) RoundTrip(ctx context.Context, desc description.SelectedServer, cb CursorBuilder, ...) (int64, error) + type CreateIndexes struct + Clock *session.ClusterClock + Indexes bsonx.Arr + NS Namespace + Opts []bsonx.Elem + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (ci *CreateIndexes) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *CreateIndexes + func (ci *CreateIndexes) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (ci *CreateIndexes) Err() error + func (ci *CreateIndexes) Result() (result.CreateIndexes, error) + func (ci *CreateIndexes) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.CreateIndexes, error) + type Cursor interface + Close func(context.Context) error + Decode func(interface{}) error + DecodeBytes func() (bson.Raw, error) + Err func() error + ID func() int64 + Next func(context.Context) bool + type CursorBuilder interface + BuildCursor func(bson.Raw, *session.Client, *session.ClusterClock, ...bsonx.Elem) (Cursor, error) + type Delete struct + Clock *session.ClusterClock + ContinueOnError bool + Deletes []bsonx.Doc + NS Namespace + Opts []bsonx.Elem + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (d *Delete) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *Delete + func (d *Delete) Encode(desc description.SelectedServer) ([]wiremessage.WireMessage, error) + func (d *Delete) Err() error + func (d *Delete) Result() (result.Delete, error) + func (d *Delete) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.Delete, error) + type Distinct struct + Clock *session.ClusterClock + Field string + NS Namespace + Opts []bsonx.Elem + Query bsonx.Doc + ReadConcern *readconcern.ReadConcern + ReadPref *readpref.ReadPref + Session *session.Client + func (d *Distinct) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *Distinct + func (d *Distinct) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (d *Distinct) Err() error + func (d *Distinct) Result() (result.Distinct, error) + func (d *Distinct) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.Distinct, error) + type DropCollection struct + Clock *session.ClusterClock + Collection string + DB string + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (dc *DropCollection) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *DropCollection + func (dc *DropCollection) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (dc *DropCollection) Err() error + func (dc *DropCollection) Result() (bson.Raw, error) + func (dc *DropCollection) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (bson.Raw, error) + type DropDatabase struct + Clock *session.ClusterClock + DB string + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (dd *DropDatabase) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *DropDatabase + func (dd *DropDatabase) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (dd *DropDatabase) Err() error + func (dd *DropDatabase) Result() (bson.Raw, error) + func (dd *DropDatabase) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (bson.Raw, error) + type DropIndexes struct + Clock *session.ClusterClock + Index string + NS Namespace + Opts []bsonx.Elem + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (di *DropIndexes) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *DropIndexes + func (di *DropIndexes) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (di *DropIndexes) Err() error + func (di *DropIndexes) Result() (bson.Raw, error) + func (di *DropIndexes) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (bson.Raw, error) + type EndSessions struct + Clock *session.ClusterClock + SessionIDs []bsonx.Doc + func (es *EndSessions) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *EndSessions + func (es *EndSessions) Encode(desc description.SelectedServer) ([]wiremessage.WireMessage, error) + func (es *EndSessions) Result() ([]result.EndSessions, []error) + func (es *EndSessions) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) ([]result.EndSessions, []error) + type Error struct + Code int32 + Labels []string + Message string + Name string + func (e Error) Error() string + func (e Error) HasErrorLabel(label string) bool + func (e Error) Retryable() bool + type Find struct + Clock *session.ClusterClock + CursorOpts []bsonx.Elem + Filter bsonx.Doc + NS Namespace + Opts []bsonx.Elem + ReadConcern *readconcern.ReadConcern + ReadPref *readpref.ReadPref + Session *session.Client + func (f *Find) Decode(desc description.SelectedServer, cb CursorBuilder, wm wiremessage.WireMessage) *Find + func (f *Find) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (f *Find) Err() error + func (f *Find) Result() (Cursor, error) + func (f *Find) RoundTrip(ctx context.Context, desc description.SelectedServer, cb CursorBuilder, ...) (Cursor, error) + type FindOneAndDelete struct + Clock *session.ClusterClock + NS Namespace + Opts []bsonx.Elem + Query bsonx.Doc + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (f *FindOneAndDelete) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *FindOneAndDelete + func (f *FindOneAndDelete) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (f *FindOneAndDelete) Err() error + func (f *FindOneAndDelete) Result() (result.FindAndModify, error) + func (f *FindOneAndDelete) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.FindAndModify, error) + type FindOneAndReplace struct + Clock *session.ClusterClock + NS Namespace + Opts []bsonx.Elem + Query bsonx.Doc + Replacement bsonx.Doc + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (f *FindOneAndReplace) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *FindOneAndReplace + func (f *FindOneAndReplace) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (f *FindOneAndReplace) Err() error + func (f *FindOneAndReplace) Result() (result.FindAndModify, error) + func (f *FindOneAndReplace) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.FindAndModify, error) + type FindOneAndUpdate struct + Clock *session.ClusterClock + NS Namespace + Opts []bsonx.Elem + Query bsonx.Doc + Session *session.Client + Update bsonx.Doc + WriteConcern *writeconcern.WriteConcern + func (f *FindOneAndUpdate) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *FindOneAndUpdate + func (f *FindOneAndUpdate) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (f *FindOneAndUpdate) Err() error + func (f *FindOneAndUpdate) Result() (result.FindAndModify, error) + func (f *FindOneAndUpdate) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.FindAndModify, error) + type GetLastError struct + Clock *session.ClusterClock + Session *session.Client + func (gle *GetLastError) Decode(wm wiremessage.WireMessage) *GetLastError + func (gle *GetLastError) Encode() (wiremessage.WireMessage, error) + func (gle *GetLastError) Err() error + func (gle *GetLastError) Result() (result.GetLastError, error) + func (gle *GetLastError) RoundTrip(ctx context.Context, rw wiremessage.ReadWriter) (result.GetLastError, error) + type GetMore struct + Clock *session.ClusterClock + ID int64 + NS Namespace + Opts []bsonx.Elem + Session *session.Client + func (gm *GetMore) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *GetMore + func (gm *GetMore) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (gm *GetMore) Err() error + func (gm *GetMore) Result() (bson.Raw, error) + func (gm *GetMore) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (bson.Raw, error) + type Handshake struct + Client bsonx.Doc + Compressors []string + SaslSupportedMechs string + func (h *Handshake) Decode(wm wiremessage.WireMessage) *Handshake + func (h *Handshake) Encode() (wiremessage.WireMessage, error) + func (h *Handshake) Err() error + func (h *Handshake) Handshake(ctx context.Context, addr address.Address, rw wiremessage.ReadWriter) (description.Server, error) + func (h *Handshake) Result(addr address.Address) (description.Server, error) + type Insert struct + Clock *session.ClusterClock + ContinueOnError bool + Docs []bsonx.Doc + NS Namespace + Opts []bsonx.Elem + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (i *Insert) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *Insert + func (i *Insert) Encode(desc description.SelectedServer) ([]wiremessage.WireMessage, error) + func (i *Insert) Err() error + func (i *Insert) Result() (result.Insert, error) + func (i *Insert) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.Insert, error) + type IsMaster struct + Client bsonx.Doc + Compressors []string + SaslSupportedMechs string + func (im *IsMaster) Decode(wm wiremessage.WireMessage) *IsMaster + func (im *IsMaster) Encode() (wiremessage.WireMessage, error) + func (im *IsMaster) Err() error + func (im *IsMaster) Result() (result.IsMaster, error) + func (im *IsMaster) RoundTrip(ctx context.Context, rw wiremessage.ReadWriter) (result.IsMaster, error) + type KillCursors struct + Clock *session.ClusterClock + IDs []int64 + NS Namespace + func (kc *KillCursors) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *KillCursors + func (kc *KillCursors) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (kc *KillCursors) Err() error + func (kc *KillCursors) Result() (result.KillCursors, error) + func (kc *KillCursors) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.KillCursors, error) + type ListCollections struct + Clock *session.ClusterClock + CursorOpts []bsonx.Elem + DB string + Filter bsonx.Doc + Opts []bsonx.Elem + ReadPref *readpref.ReadPref + Session *session.Client + func (lc *ListCollections) Decode(desc description.SelectedServer, cb CursorBuilder, wm wiremessage.WireMessage) *ListCollections + func (lc *ListCollections) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (lc *ListCollections) Err() error + func (lc *ListCollections) Result() (Cursor, error) + func (lc *ListCollections) RoundTrip(ctx context.Context, desc description.SelectedServer, cb CursorBuilder, ...) (Cursor, error) + type ListDatabases struct + Clock *session.ClusterClock + Filter bsonx.Doc + Opts []bsonx.Elem + Session *session.Client + func (ld *ListDatabases) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *ListDatabases + func (ld *ListDatabases) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (ld *ListDatabases) Err() error + func (ld *ListDatabases) Result() (result.ListDatabases, error) + func (ld *ListDatabases) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.ListDatabases, error) + type ListIndexes struct + Clock *session.ClusterClock + CursorOpts []bsonx.Elem + NS Namespace + Opts []bsonx.Elem + Session *session.Client + func (li *ListIndexes) Decode(desc description.SelectedServer, cb CursorBuilder, wm wiremessage.WireMessage) *ListIndexes + func (li *ListIndexes) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (li *ListIndexes) Err() error + func (li *ListIndexes) Result() (Cursor, error) + func (li *ListIndexes) RoundTrip(ctx context.Context, desc description.SelectedServer, cb CursorBuilder, ...) (Cursor, error) + type Namespace struct + Collection string + DB string + func NewNamespace(db, collection string) Namespace + func ParseNamespace(name string) Namespace + func (ns *Namespace) FullName() string + func (ns *Namespace) Validate() error + type QueryFailureError struct + Message string + Response bson.Raw + func (e QueryFailureError) Error() string + type Read struct + Clock *session.ClusterClock + Command bsonx.Doc + DB string + ReadConcern *readconcern.ReadConcern + ReadPref *readpref.ReadPref + Session *session.Client + func (r *Read) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *Read + func (r *Read) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (r *Read) Err() error + func (r *Read) Result() (bson.Raw, error) + func (r *Read) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (bson.Raw, error) + type ResponseError struct + Message string + Wrapped error + func NewCommandResponseError(msg string, err error) ResponseError + func (e ResponseError) Error() string + type StartSession struct + Clock *session.ClusterClock + func (ss *StartSession) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *StartSession + func (ss *StartSession) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (ss *StartSession) Err() error + func (ss *StartSession) Result() (result.StartSession, error) + func (ss *StartSession) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.StartSession, error) + type Update struct + Clock *session.ClusterClock + ContinueOnError bool + Docs []bsonx.Doc + NS Namespace + Opts []bsonx.Elem + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (u *Update) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *Update + func (u *Update) Encode(desc description.SelectedServer) ([]wiremessage.WireMessage, error) + func (u *Update) Err() error + func (u *Update) Result() (result.Update, error) + func (u *Update) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (result.Update, error) + type Write struct + Clock *session.ClusterClock + Command bsonx.Doc + DB string + Session *session.Client + WriteConcern *writeconcern.WriteConcern + func (w *Write) Decode(desc description.SelectedServer, wm wiremessage.WireMessage) *Write + func (w *Write) Encode(desc description.SelectedServer) (wiremessage.WireMessage, error) + func (w *Write) Err() error + func (w *Write) Result() (bson.Raw, error) + func (w *Write) RoundTrip(ctx context.Context, desc description.SelectedServer, ...) (bson.Raw, error) + type WriteBatch struct + type WriteCommandKind int8 + const DeleteCommand + const InsertCommand + const UpdateCommand