Documentation ¶
Index ¶
- Variables
- func AbortTransaction(ctx context.Context, cmd command.AbortTransaction, topo *topology.Topology, ...) (result.TransactionResult, error)
- func Aggregate(ctx context.Context, cmd command.Aggregate, topo *topology.Topology, ...) (command.Cursor, error)
- func BulkWrite(ctx context.Context, ns command.Namespace, models []WriteModel, ...) (result.BulkWrite, error)
- func CommitTransaction(ctx context.Context, cmd command.CommitTransaction, topo *topology.Topology, ...) (result.TransactionResult, error)
- func Count(ctx context.Context, cmd command.Count, topo *topology.Topology, ...) (int64, error)
- func CountDocuments(ctx context.Context, cmd command.CountDocuments, topo *topology.Topology, ...) (int64, error)
- func CreateIndexes(ctx context.Context, cmd command.CreateIndexes, topo *topology.Topology, ...) (result.CreateIndexes, error)
- func Delete(ctx context.Context, cmd command.Delete, topo *topology.Topology, ...) (result.Delete, error)
- func Distinct(ctx context.Context, cmd command.Distinct, topo *topology.Topology, ...) (result.Distinct, error)
- func DropCollection(ctx context.Context, cmd command.DropCollection, topo *topology.Topology, ...) (bson.Raw, error)
- func DropDatabase(ctx context.Context, cmd command.DropDatabase, topo *topology.Topology, ...) (bson.Raw, error)
- func DropIndexes(ctx context.Context, cmd command.DropIndexes, topo *topology.Topology, ...) (bson.Raw, error)
- func EndSessions(ctx context.Context, cmd command.EndSessions, topo *topology.Topology, ...) ([]result.EndSessions, []error)
- func Find(ctx context.Context, cmd command.Find, topo *topology.Topology, ...) (command.Cursor, error)
- func FindOneAndDelete(ctx context.Context, cmd command.FindOneAndDelete, topo *topology.Topology, ...) (result.FindAndModify, error)
- func FindOneAndReplace(ctx context.Context, cmd command.FindOneAndReplace, topo *topology.Topology, ...) (result.FindAndModify, error)
- func FindOneAndUpdate(ctx context.Context, cmd command.FindOneAndUpdate, topo *topology.Topology, ...) (result.FindAndModify, error)
- func Insert(ctx context.Context, cmd command.Insert, topo *topology.Topology, ...) (result.Insert, error)
- func ListCollections(ctx context.Context, cmd command.ListCollections, topo *topology.Topology, ...) (command.Cursor, error)
- func ListDatabases(ctx context.Context, cmd command.ListDatabases, topo *topology.Topology, ...) (result.ListDatabases, error)
- func ListIndexes(ctx context.Context, cmd command.ListIndexes, topo *topology.Topology, ...) (command.Cursor, error)
- func Read(ctx context.Context, cmd command.Read, topo *topology.Topology, ...) (bson.Raw, error)
- func Update(ctx context.Context, cmd command.Update, topo *topology.Topology, ...) (result.Update, error)
- func Write(ctx context.Context, cmd command.Write, topo *topology.Topology, ...) (bson.Raw, error)
- type BulkWriteError
- type BulkWriteException
- type DeleteManyModel
- type DeleteOneModel
- type InsertOneModel
- type ReplaceOneModel
- type UpdateManyModel
- type UpdateModel
- type UpdateOneModel
- type WriteModel
Constants ¶
This section is empty.
Variables ¶
var ErrArrayFilters = errors.New("array filters cannot be set for server versions < 3.6")
ErrArrayFilters is caused if array filters are given for an invalid server version.
var ErrCollation = errors.New("collation cannot be set for server versions < 3.4")
ErrCollation is caused if a collation is given for an invalid server version.
Functions ¶
func AbortTransaction ¶
func AbortTransaction( ctx context.Context, cmd command.AbortTransaction, topo *topology.Topology, selector description.ServerSelector, ) (result.TransactionResult, error)
AbortTransaction handles the full cycle dispatch and execution of abortting a transaction against the provided topology.
func Aggregate ¶
func Aggregate( ctx context.Context, cmd command.Aggregate, topo *topology.Topology, readSelector, writeSelector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, registry *bsoncodec.Registry, opts ...*options.AggregateOptions, ) (command.Cursor, error)
Aggregate handles the full cycle dispatch and execution of an aggregate command against the provided topology.
func BulkWrite ¶
func BulkWrite( ctx context.Context, ns command.Namespace, models []WriteModel, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, retryWrite bool, sess *session.Client, writeConcern *writeconcern.WriteConcern, clock *session.ClusterClock, registry *bsoncodec.Registry, opts ...*options.BulkWriteOptions, ) (result.BulkWrite, error)
BulkWrite handles the full dispatch cycle for a bulk write operation.
func CommitTransaction ¶
func CommitTransaction( ctx context.Context, cmd command.CommitTransaction, topo *topology.Topology, selector description.ServerSelector, ) (result.TransactionResult, error)
CommitTransaction handles the full cycle dispatch and execution of committing a transaction against the provided topology.
func Count ¶
func Count( ctx context.Context, cmd command.Count, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, registry *bsoncodec.Registry, opts ...*options.CountOptions, ) (int64, error)
Count handles the full cycle dispatch and execution of a count command against the provided topology.
func CountDocuments ¶
func CountDocuments( ctx context.Context, cmd command.CountDocuments, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, registry *bsoncodec.Registry, opts ...*options.CountOptions, ) (int64, error)
CountDocuments handles the full cycle dispatch and execution of a countDocuments command against the provided topology.
func CreateIndexes ¶
func CreateIndexes( ctx context.Context, cmd command.CreateIndexes, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, opts ...*options.CreateIndexesOptions, ) (result.CreateIndexes, error)
CreateIndexes handles the full cycle dispatch and execution of a createIndexes command against the provided topology.
func Delete ¶
func Delete( ctx context.Context, cmd command.Delete, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, retryWrite bool, opts ...*options.DeleteOptions, ) (result.Delete, error)
Delete handles the full cycle dispatch and execution of a delete command against the provided topology.
func Distinct ¶
func Distinct( ctx context.Context, cmd command.Distinct, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, opts ...*options.DistinctOptions, ) (result.Distinct, error)
Distinct handles the full cycle dispatch and execution of a distinct command against the provided topology.
func DropCollection ¶
func DropCollection( ctx context.Context, cmd command.DropCollection, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, ) (bson.Raw, error)
DropCollection handles the full cycle dispatch and execution of a dropCollection command against the provided topology.
func DropDatabase ¶
func DropDatabase( ctx context.Context, cmd command.DropDatabase, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, ) (bson.Raw, error)
DropDatabase handles the full cycle dispatch and execution of a dropDatabase command against the provided topology.
func DropIndexes ¶
func DropIndexes( ctx context.Context, cmd command.DropIndexes, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, opts ...*options.DropIndexesOptions, ) (bson.Raw, error)
DropIndexes handles the full cycle dispatch and execution of a dropIndexes command against the provided topology.
func EndSessions ¶
func EndSessions( ctx context.Context, cmd command.EndSessions, topo *topology.Topology, selector description.ServerSelector, ) ([]result.EndSessions, []error)
EndSessions handles the full cycle dispatch and execution of an endSessions command against the provided topology.
func Find ¶
func Find( ctx context.Context, cmd command.Find, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, registry *bsoncodec.Registry, opts ...*options.FindOptions, ) (command.Cursor, error)
Find handles the full cycle dispatch and execution of a find command against the provided topology.
func FindOneAndDelete ¶
func FindOneAndDelete( ctx context.Context, cmd command.FindOneAndDelete, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, retryWrite bool, registry *bsoncodec.Registry, opts ...*options.FindOneAndDeleteOptions, ) (result.FindAndModify, error)
FindOneAndDelete handles the full cycle dispatch and execution of a FindOneAndDelete command against the provided topology.
func FindOneAndReplace ¶
func FindOneAndReplace( ctx context.Context, cmd command.FindOneAndReplace, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, retryWrite bool, registry *bsoncodec.Registry, opts ...*options.FindOneAndReplaceOptions, ) (result.FindAndModify, error)
FindOneAndReplace handles the full cycle dispatch and execution of a FindOneAndReplace command against the provided topology.
func FindOneAndUpdate ¶
func FindOneAndUpdate( ctx context.Context, cmd command.FindOneAndUpdate, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, retryWrite bool, registry *bsoncodec.Registry, opts ...*options.FindOneAndUpdateOptions, ) (result.FindAndModify, error)
FindOneAndUpdate handles the full cycle dispatch and execution of a FindOneAndUpdate command against the provided topology.
func Insert ¶
func Insert( ctx context.Context, cmd command.Insert, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, retryWrite bool, opts ...*options.InsertManyOptions, ) (result.Insert, error)
Insert handles the full cycle dispatch and execution of an insert command against the provided topology.
func ListCollections ¶
func ListCollections( ctx context.Context, cmd command.ListCollections, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, opts ...*options.ListCollectionsOptions, ) (command.Cursor, error)
ListCollections handles the full cycle dispatch and execution of a listCollections command against the provided topology.
func ListDatabases ¶
func ListDatabases( ctx context.Context, cmd command.ListDatabases, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, opts ...*options.ListDatabasesOptions, ) (result.ListDatabases, error)
ListDatabases handles the full cycle dispatch and execution of a listDatabases command against the provided topology.
func ListIndexes ¶
func ListIndexes( ctx context.Context, cmd command.ListIndexes, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, opts ...*options.ListIndexesOptions, ) (command.Cursor, error)
ListIndexes handles the full cycle dispatch and execution of a listIndexes command against the provided topology.
func Read ¶
func Read( ctx context.Context, cmd command.Read, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, ) (bson.Raw, error)
Read handles the full cycle dispatch and execution of a read command against the provided topology.
func Update ¶
func Update( ctx context.Context, cmd command.Update, topo *topology.Topology, selector description.ServerSelector, clientID uuid.UUID, pool *session.Pool, retryWrite bool, opts ...*options.UpdateOptions, ) (result.Update, error)
Update handles the full cycle dispatch and execution of an update command against the provided topology.
Types ¶
type BulkWriteError ¶
type BulkWriteError struct { result.WriteError Model WriteModel }
BulkWriteError is an error from one operation in a bulk write.
type BulkWriteException ¶
type BulkWriteException struct { WriteConcernError *result.WriteConcernError WriteErrors []BulkWriteError }
BulkWriteException is a collection of errors returned by a bulk write operation.
func (BulkWriteException) Error ¶
func (BulkWriteException) Error() string
type DeleteManyModel ¶
DeleteManyModel is the write model for deleteMany operations.
type DeleteOneModel ¶
DeleteOneModel is the write model for delete operations.
type InsertOneModel ¶
type InsertOneModel struct {
Document interface{}
}
InsertOneModel is the write model for insert operations.
type ReplaceOneModel ¶
type ReplaceOneModel struct { Filter interface{} Replacement interface{} UpdateModel }
ReplaceOneModel is the write model for replace operations.
type UpdateManyModel ¶
type UpdateManyModel struct { Filter interface{} Update interface{} // default is to not send a value. for servers < 3.6, error raised if value given. for unack writes using opcodes, // error raised if value given ArrayFilters options.ArrayFilters ArrayFiltersSet bool UpdateModel }
UpdateManyModel is the write model for updateMany operations.
type UpdateModel ¶
UpdateModel contains the fields that are shared between the ReplaceOneModel, UpdateOneModel, and UpdateManyModel types
type UpdateOneModel ¶
type UpdateOneModel struct { Filter interface{} Update interface{} // default is to not send a value. for servers < 3.6, error raised if value given. for unack writes using opcodes, // error raised if value given ArrayFilters options.ArrayFilters ArrayFiltersSet bool UpdateModel }
UpdateOneModel is the write model for update operations.
type WriteModel ¶
type WriteModel interface {
// contains filtered or unexported methods
}
WriteModel is the interface satisfied by all models for bulk writes.
Source Files ¶
- abort_transaction.go
- aggregate.go
- bulk_write.go
- commit_transaction.go
- count.go
- count_documents.go
- create_indexes.go
- delete.go
- delete_indexes.go
- dispatch.go
- distinct.go
- drop_collection.go
- drop_database.go
- end_sessions.go
- find.go
- find_one_and_delete.go
- find_one_and_replace.go
- find_one_and_update.go
- insert.go
- list_collections.go
- list_databases.go
- list_indexes.go
- models.go
- read.go
- update.go
- write.go