Documentation ¶
Index ¶
- type Bucket
- func (b *Bucket) Delete(fileID interface{}) error
- func (b *Bucket) DownloadToStream(fileID interface{}, stream io.Writer) (int64, error)
- func (b *Bucket) DownloadToStreamByName(filename string, stream io.Writer, opts ...*options.NameOptions) (int64, error)
- func (b *Bucket) Drop() error
- func (b *Bucket) Find(filter interface{}, opts ...*options.GridFSFindOptions) (CursorInterface, error)
- func (b *Bucket) OpenDownloadStream(fileID interface{}) (DownloadStreamInterface, error)
- func (b *Bucket) OpenDownloadStreamByName(filename string, opts ...*options.NameOptions) (DownloadStreamInterface, error)
- func (b *Bucket) OpenUploadStream(filename string, opts ...*options.UploadOptions) (UploadStreamInterface, error)
- func (b *Bucket) OpenUploadStreamWithID(fileID interface{}, filename string, opts ...*options.UploadOptions) (UploadStreamInterface, error)
- func (b *Bucket) Rename(fileID interface{}, newFilename string) error
- func (b *Bucket) SetReadDeadline(t time.Time) error
- func (b *Bucket) SetWriteDeadline(t time.Time) error
- func (b *Bucket) UploadFromStream(filename string, source io.Reader, opts ...*options.UploadOptions) (primitive.ObjectID, error)
- func (b *Bucket) UploadFromStreamWithID(fileID interface{}, filename string, source io.Reader, ...) error
- type BucketInterface
- type Client
- func (c *Client) Connect(ctx context.Context) error
- func (c *Client) Database(name string, opts ...*options.DatabaseOptions) DatabaseInterface
- func (c *Client) Disconnect(ctx context.Context) error
- func (c *Client) ListDatabaseNames(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) ([]string, error)
- func (c *Client) ListDatabases(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) (mongo.ListDatabasesResult, error)
- func (c *Client) NumberSessionsInProgress() int
- func (c *Client) Ping(ctx context.Context, rp *readpref.ReadPref) error
- func (c *Client) StartSession(opts ...*options.SessionOptions) (SessionInterface, error)
- func (c *Client) UseSession(ctx context.Context, fn func(mongo.SessionContext) error) error
- func (c *Client) UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, ...) error
- func (c *Client) Watch(ctx context.Context, pipeline interface{}, ...) (*mongo.ChangeStream, error)
- type ClientInterface
- type Collection
- func (c *Collection) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (CursorInterface, error)
- func (c *Collection) BulkWrite(ctx context.Context, models []mongo.WriteModel, ...) (*mongo.BulkWriteResult, error)
- func (c *Collection) Clone(opts ...*options.CollectionOptions) (CollectionInterface, error)
- func (c *Collection) CountDocuments(ctx context.Context, filter interface{}, opts ...*options.CountOptions) (int64, error)
- func (c *Collection) Database() DatabaseInterface
- func (c *Collection) DeleteMany(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func (c *Collection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func (c *Collection) Distinct(ctx context.Context, fieldName string, filter interface{}, ...) ([]interface{}, error)
- func (c *Collection) Drop(ctx context.Context) error
- func (c *Collection) EstimatedDocumentCount(ctx context.Context, opts ...*options.EstimatedDocumentCountOptions) (int64, error)
- func (c *Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (CursorInterface, error)
- func (c *Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) SingleResultInterface
- func (c *Collection) FindOneAndDelete(ctx context.Context, filter interface{}, ...) SingleResultInterface
- func (c *Collection) FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}, ...) SingleResultInterface
- func (c *Collection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, ...) SingleResultInterface
- func (c *Collection) Indexes() IndexViewInterface
- func (c *Collection) InsertMany(ctx context.Context, documents []interface{}, ...) (*mongo.InsertManyResult, error)
- func (c *Collection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
- func (c *Collection) Name() string
- func (c *Collection) ReplaceOne(ctx context.Context, filter interface{}, replacement interface{}, ...) (*mongo.UpdateResult, error)
- func (c *Collection) UpdateMany(ctx context.Context, filter interface{}, update interface{}, ...) (*mongo.UpdateResult, error)
- func (c *Collection) UpdateOne(ctx context.Context, filter interface{}, update interface{}, ...) (*mongo.UpdateResult, error)
- func (c *Collection) Watch(ctx context.Context, pipeline interface{}, ...) (*mongo.ChangeStream, error)
- type CollectionInterface
- type CursorInterface
- type Database
- func (d *Database) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (CursorInterface, error)
- func (d *Database) Client() ClientInterface
- func (d *Database) Collection(name string, opts ...*options.CollectionOptions) CollectionInterface
- func (d *Database) Drop(ctx context.Context) error
- func (d *Database) ListCollectionNames(ctx context.Context, filter interface{}, ...) ([]string, error)
- func (d *Database) ListCollections(ctx context.Context, filter interface{}, ...) (CursorInterface, error)
- func (d *Database) Name() string
- func (d *Database) NewBucket(opts ...*options.BucketOptions) (BucketInterface, error)
- func (d *Database) ReadConcern() *readconcern.ReadConcern
- func (d *Database) ReadPreference() *readpref.ReadPref
- func (d *Database) RunCommand(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) SingleResultInterface
- func (d *Database) RunCommandCursor(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) (CursorInterface, error)
- func (d *Database) Watch(ctx context.Context, pipeline interface{}, ...) (*mongo.ChangeStream, error)
- func (d *Database) WriteConcern() *writeconcern.WriteConcern
- type DatabaseInterface
- type DownloadStreamInterface
- type IndexView
- func (i IndexView) CreateMany(ctx context.Context, models []mongo.IndexModel, ...) ([]string, error)
- func (i IndexView) CreateOne(ctx context.Context, model mongo.IndexModel, ...) (string, error)
- func (i IndexView) DropAll(ctx context.Context, opts ...*options.DropIndexesOptions) (bson.Raw, error)
- func (i IndexView) DropOne(ctx context.Context, name string, opts ...*options.DropIndexesOptions) (bson.Raw, error)
- func (i IndexView) List(ctx context.Context, opts ...*options.ListIndexesOptions) (CursorInterface, error)
- type IndexViewInterface
- type SessionInterface
- type SingleResultInterface
- type UploadStreamInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bucket ¶
type Bucket struct {
// contains filtered or unexported fields
}
func (*Bucket) DownloadToStream ¶
func (*Bucket) DownloadToStreamByName ¶
func (*Bucket) Find ¶
func (b *Bucket) Find(filter interface{}, opts ...*options.GridFSFindOptions) (CursorInterface, error)
func (*Bucket) OpenDownloadStream ¶
func (b *Bucket) OpenDownloadStream(fileID interface{}) (DownloadStreamInterface, error)
func (*Bucket) OpenDownloadStreamByName ¶
func (b *Bucket) OpenDownloadStreamByName(filename string, opts ...*options.NameOptions) (DownloadStreamInterface, error)
func (*Bucket) OpenUploadStream ¶
func (b *Bucket) OpenUploadStream(filename string, opts ...*options.UploadOptions) (UploadStreamInterface, error)
func (*Bucket) OpenUploadStreamWithID ¶
func (b *Bucket) OpenUploadStreamWithID(fileID interface{}, filename string, opts ...*options.UploadOptions) (UploadStreamInterface, error)
func (*Bucket) UploadFromStream ¶
func (*Bucket) UploadFromStreamWithID ¶
type BucketInterface ¶
type BucketInterface interface { Delete(fileID interface{}) error DownloadToStream(fileID interface{}, stream io.Writer) (int64, error) DownloadToStreamByName(filename string, stream io.Writer, opts ...*options.NameOptions) (int64, error) Drop() error Find(filter interface{}, opts ...*options.GridFSFindOptions) (CursorInterface, error) OpenDownloadStream(fileID interface{}) (DownloadStreamInterface, error) OpenDownloadStreamByName(filename string, opts ...*options.NameOptions) (DownloadStreamInterface, error) OpenUploadStream(filename string, opts ...*options.UploadOptions) (UploadStreamInterface, error) OpenUploadStreamWithID(fileID interface{}, filename string, opts ...*options.UploadOptions) (UploadStreamInterface, error) Rename(fileID interface{}, newFilename string) error SetReadDeadline(t time.Time) error SetWriteDeadline(t time.Time) error UploadFromStream(filename string, source io.Reader, opts ...*options.UploadOptions) (primitive.ObjectID, error) UploadFromStreamWithID(fileID interface{}, filename string, source io.Reader, opts ...*options.UploadOptions) error }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Database ¶
func (c *Client) Database(name string, opts ...*options.DatabaseOptions) DatabaseInterface
func (*Client) ListDatabaseNames ¶
func (*Client) ListDatabases ¶
func (c *Client) ListDatabases(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) (mongo.ListDatabasesResult, error)
func (*Client) NumberSessionsInProgress ¶
func (*Client) StartSession ¶
func (c *Client) StartSession(opts ...*options.SessionOptions) (SessionInterface, error)
func (*Client) UseSession ¶
func (*Client) UseSessionWithOptions ¶
func (c *Client) UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, fn func(mongo.SessionContext) error) error
func (*Client) Watch ¶
func (c *Client) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error)
type ClientInterface ¶
type ClientInterface interface { Connect(ctx context.Context) error Database(name string, opts ...*options.DatabaseOptions) DatabaseInterface Disconnect(ctx context.Context) error ListDatabaseNames(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) ([]string, error) ListDatabases(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) (mongo.ListDatabasesResult, error) NumberSessionsInProgress() int Ping(ctx context.Context, rp *readpref.ReadPref) error StartSession(opts ...*options.SessionOptions) (SessionInterface, error) UseSession(ctx context.Context, fn func(mongo.SessionContext) error) error UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, fn func(mongo.SessionContext) error) error Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error) }
func NewClient ¶
func NewClient(c *mongo.Client) ClientInterface
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func NewCollection ¶
func NewCollection(coll *mongo.Collection) *Collection
func (*Collection) Aggregate ¶
func (c *Collection) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (CursorInterface, error)
func (*Collection) BulkWrite ¶
func (c *Collection) BulkWrite(ctx context.Context, models []mongo.WriteModel, opts ...*options.BulkWriteOptions) (*mongo.BulkWriteResult, error)
func (*Collection) Clone ¶
func (c *Collection) Clone(opts ...*options.CollectionOptions) (CollectionInterface, error)
func (*Collection) CountDocuments ¶
func (c *Collection) CountDocuments(ctx context.Context, filter interface{}, opts ...*options.CountOptions) (int64, error)
func (*Collection) Database ¶
func (c *Collection) Database() DatabaseInterface
func (*Collection) DeleteMany ¶
func (c *Collection) DeleteMany(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func (*Collection) DeleteOne ¶
func (c *Collection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
func (*Collection) Distinct ¶
func (c *Collection) Distinct(ctx context.Context, fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error)
func (*Collection) EstimatedDocumentCount ¶
func (c *Collection) EstimatedDocumentCount(ctx context.Context, opts ...*options.EstimatedDocumentCountOptions) (int64, error)
func (*Collection) Find ¶
func (c *Collection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (CursorInterface, error)
func (*Collection) FindOne ¶
func (c *Collection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) SingleResultInterface
func (*Collection) FindOneAndDelete ¶
func (c *Collection) FindOneAndDelete(ctx context.Context, filter interface{}, opts ...*options.FindOneAndDeleteOptions) SingleResultInterface
func (*Collection) FindOneAndReplace ¶
func (c *Collection) FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.FindOneAndReplaceOptions) SingleResultInterface
func (*Collection) FindOneAndUpdate ¶
func (c *Collection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) SingleResultInterface
func (*Collection) Indexes ¶
func (c *Collection) Indexes() IndexViewInterface
func (*Collection) InsertMany ¶
func (c *Collection) InsertMany(ctx context.Context, documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)
func (*Collection) InsertOne ¶
func (c *Collection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
func (*Collection) Name ¶
func (c *Collection) Name() string
func (*Collection) ReplaceOne ¶
func (c *Collection) ReplaceOne(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)
func (*Collection) UpdateMany ¶
func (c *Collection) UpdateMany(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func (*Collection) UpdateOne ¶
func (c *Collection) UpdateOne(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)
func (*Collection) Watch ¶
func (c *Collection) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error)
type CollectionInterface ¶
type CollectionInterface interface { Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (CursorInterface, error) BulkWrite(ctx context.Context, models []mongo.WriteModel, opts ...*options.BulkWriteOptions) (*mongo.BulkWriteResult, error) Clone(opts ...*options.CollectionOptions) (CollectionInterface, error) CountDocuments(ctx context.Context, filter interface{}, opts ...*options.CountOptions) (int64, error) Database() DatabaseInterface DeleteMany(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error) Distinct(ctx context.Context, fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error) Drop(ctx context.Context) error EstimatedDocumentCount(ctx context.Context, opts ...*options.EstimatedDocumentCountOptions) (int64, error) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (CursorInterface, error) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) SingleResultInterface FindOneAndDelete(ctx context.Context, filter interface{}, opts ...*options.FindOneAndDeleteOptions) SingleResultInterface FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.FindOneAndReplaceOptions) SingleResultInterface FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) SingleResultInterface Indexes() IndexViewInterface InsertMany(ctx context.Context, documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error) Name() string ReplaceOne(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error) UpdateMany(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error) UpdateOne(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error) }
type CursorInterface ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func NewDatabase ¶
func (*Database) Aggregate ¶
func (d *Database) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (CursorInterface, error)
func (*Database) Client ¶
func (d *Database) Client() ClientInterface
func (*Database) Collection ¶
func (d *Database) Collection(name string, opts ...*options.CollectionOptions) CollectionInterface
func (*Database) ListCollectionNames ¶
func (*Database) ListCollections ¶
func (d *Database) ListCollections(ctx context.Context, filter interface{}, opts ...*options.ListCollectionsOptions) (CursorInterface, error)
func (*Database) NewBucket ¶
func (d *Database) NewBucket(opts ...*options.BucketOptions) (BucketInterface, error)
func (*Database) ReadConcern ¶
func (d *Database) ReadConcern() *readconcern.ReadConcern
func (*Database) ReadPreference ¶
func (*Database) RunCommand ¶
func (d *Database) RunCommand(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) SingleResultInterface
func (*Database) RunCommandCursor ¶
func (d *Database) RunCommandCursor(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) (CursorInterface, error)
func (*Database) Watch ¶
func (d *Database) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error)
func (*Database) WriteConcern ¶
func (d *Database) WriteConcern() *writeconcern.WriteConcern
type DatabaseInterface ¶
type DatabaseInterface interface { Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (CursorInterface, error) Client() ClientInterface Collection(name string, opts ...*options.CollectionOptions) CollectionInterface Drop(ctx context.Context) error ListCollectionNames(ctx context.Context, filter interface{}, opts ...*options.ListCollectionsOptions) ([]string, error) ListCollections(ctx context.Context, filter interface{}, opts ...*options.ListCollectionsOptions) (CursorInterface, error) Name() string ReadConcern() *readconcern.ReadConcern ReadPreference() *readpref.ReadPref RunCommand(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) SingleResultInterface RunCommandCursor(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) (CursorInterface, error) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error) WriteConcern() *writeconcern.WriteConcern NewBucket(opts ...*options.BucketOptions) (BucketInterface, error) }
type DownloadStreamInterface ¶
type IndexView ¶
type IndexView struct {
// contains filtered or unexported fields
}
func NewIndexView ¶
func (IndexView) CreateMany ¶
func (i IndexView) CreateMany(ctx context.Context, models []mongo.IndexModel, opts ...*options.CreateIndexesOptions) ([]string, error)
func (IndexView) CreateOne ¶
func (i IndexView) CreateOne(ctx context.Context, model mongo.IndexModel, opts ...*options.CreateIndexesOptions) (string, error)
func (IndexView) List ¶
func (i IndexView) List(ctx context.Context, opts ...*options.ListIndexesOptions) (CursorInterface, error)
type IndexViewInterface ¶
type IndexViewInterface interface { List(ctx context.Context, opts ...*options.ListIndexesOptions) (CursorInterface, error) CreateOne(ctx context.Context, model mongo.IndexModel, opts ...*options.CreateIndexesOptions) (string, error) CreateMany(ctx context.Context, models []mongo.IndexModel, opts ...*options.CreateIndexesOptions) ([]string, error) DropOne(ctx context.Context, name string, opts ...*options.DropIndexesOptions) (bson.Raw, error) DropAll(ctx context.Context, opts ...*options.DropIndexesOptions) (bson.Raw, error) }
type SessionInterface ¶
type SessionInterface interface { StartTransaction(opts ...*options.TransactionOptions) error AbortTransaction(ctx context.Context) error CommitTransaction(ctx context.Context) error WithTransaction(ctx context.Context, fn func(sessCtx mongo.SessionContext) (interface{}, error), opts ...*options.TransactionOptions) (interface{}, error) EndSession(ctx context.Context) ClusterTime() bson.Raw OperationTime() *primitive.Timestamp Client() ClientInterface ID() bson.Raw AdvanceClusterTime(bson.Raw) error AdvanceOperationTime(ts *primitive.Timestamp) error }
type SingleResultInterface ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock_pmongo is a generated GoMock package.
|
Package mock_pmongo is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.