mongodb

package
v1.0.0-beta.27 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDecodeToNil         = bson.ErrDecodeToNil
	ErrNilContext          = bson.ErrNilContext
	ErrNilReader           = bson.ErrNilReader
	ErrNilRegistry         = bson.ErrNilRegistry
	ErrClientDisconnected  = mongo.ErrClientDisconnected
	ErrEmptySlice          = mongo.ErrEmptySlice
	ErrInvalidIndexValue   = mongo.ErrInvalidIndexValue
	ErrMissingResumeToken  = mongo.ErrMissingResumeToken
	ErrMultipleIndexDrop   = mongo.ErrMultipleIndexDrop
	ErrNilCursor           = mongo.ErrNilCursor
	ErrNilDocument         = mongo.ErrNilDocument
	ErrNoDocuments         = mongo.ErrNoDocuments
	ErrNonStringIndexName  = mongo.ErrNonStringIndexName
	ErrUnacknowledgedWrite = mongo.ErrUnacknowledgedWrite
	ErrWrongClient         = mongo.ErrWrongClient
	ErrParseNaN            = primitive.ErrParseNaN
	ErrParseInf            = primitive.ErrParseInf
	ErrParseNegInf         = primitive.ErrParseNegInf
)
View Source
var (
	CompareTimestamp             = primitive.CompareTimestamp
	NewDateTimeFromTime          = primitive.NewDateTimeFromTime
	NewDecimal128                = primitive.NewDecimal128
	ParseDecimal128              = primitive.ParseDecimal128
	ParseDecimal128FromBigInt    = primitive.ParseDecimal128FromBigInt
	NewObjectID                  = primitive.NewObjectID
	NewObjectIDFromTimestamp     = primitive.NewObjectIDFromTimestamp
	ObjectIDFromHex              = primitive.ObjectIDFromHex
	OptionAggregate              = options.Aggregate
	OptionAutoEncryption         = options.AutoEncryption
	OptionBulkWrite              = options.BulkWrite
	OptionChangeStream           = options.ChangeStream
	OptionClientEncryption       = options.ClientEncryption
	OptionClient                 = options.Client
	OptionCollection             = options.Collection
	OptionCount                  = options.Count
	OptionCreateCollection       = options.CreateCollection
	OptionCreateIndexes          = options.CreateIndexes
	OptionCreateView             = options.CreateView
	OptionDataKey                = options.DataKey
	OptionDatabase               = options.Database
	OptionDefaultIndex           = options.DefaultIndex
	OptionDelete                 = options.Delete
	OptionDistinct               = options.Distinct
	OptionDropIndexes            = options.DropIndexes
	OptionEncrypt                = options.Encrypt
	OptionEstimatedDocumentCount = options.EstimatedDocumentCount
	OptionFindOneAndDelete       = options.FindOneAndDelete
	OptionFindOneAndReplace      = options.FindOneAndReplace
	OptionFindOneAndUpdate       = options.FindOneAndUpdate
	OptionFindOne                = options.FindOne
	OptionFind                   = options.Find
	OptionGridFSFind             = options.GridFSFind
	OptionIndex                  = options.Index
	OptionInsertMany             = options.InsertMany
	OptionInsertOne              = options.InsertOne
	OptionListCollections        = options.ListCollections
	OptionListDatabases          = options.ListDatabases
	OptionListIndexes            = options.ListIndexes
	OptionReplace                = options.Replace
	OptionRunCmd                 = options.RunCmd
	OptionSession                = options.Session
	OptionTransaction            = options.Transaction
	OptionUpdate                 = options.Update
)
View Source
var (
	Default = StdConfig("default").Build()
)

Functions

func Client added in v1.0.0

func Client() *mongo.Client

func DB added in v1.0.0

func DB(name string, opts ...*options.DatabaseOptions) *mongo.Database

Types

type A

type A = primitive.A

type AggregateOptions added in v1.0.0

type AggregateOptions = options.AggregateOptions

type ArrayFilters added in v1.0.0

type ArrayFilters = options.ArrayFilters

type AutoEncryptionOptions added in v1.0.0

type AutoEncryptionOptions = options.AutoEncryptionOptions

type Binary added in v1.0.0

type Binary = primitive.Binary

type BucketOptions added in v1.0.0

type BucketOptions = options.BucketOptions

type BulkWriteOptions added in v1.0.0

type BulkWriteOptions = options.BulkWriteOptions

type ChangeStreamOptions added in v1.0.0

type ChangeStreamOptions = options.ChangeStreamOptions

type ClientEncryptionOptions added in v1.0.0

type ClientEncryptionOptions = options.ClientEncryptionOptions

type ClientOptions added in v1.0.0

type ClientOptions = options.ClientOptions

type Collation added in v1.0.0

type Collation = options.Collation

type Collection added in v1.0.0

type Collection = mongo.Collection

type CollectionOptions added in v1.0.0

type CollectionOptions = options.CollectionOptions

type Config added in v1.0.0

type Config struct {
	URI                  string `config:"uri" desc:"mongodb uri string."`
	EnableCommandMonitor bool   `config:"commandMonitor"`
	EnablePoolMonitor    bool   `config:"poolMonitor"`
	// contains filtered or unexported fields
}

func DefaultConfig added in v1.0.0

func DefaultConfig(key string) *Config

func StdConfig added in v1.0.0

func StdConfig(key string, optionFunc ...OptionFunc) *Config

func (*Config) Build added in v1.0.0

func (c *Config) Build() *Mongo

func (*Config) Path added in v1.0.0

func (c *Config) Path() string

type ContextDialer added in v1.0.0

type ContextDialer = options.ContextDialer

type CountOptions added in v1.0.0

type CountOptions = options.CountOptions

type CreateCollectionOptions added in v1.0.0

type CreateCollectionOptions = options.CreateCollectionOptions

type CreateIndexesOptions added in v1.0.0

type CreateIndexesOptions = options.CreateIndexesOptions

type CreateViewOptions added in v1.0.0

type CreateViewOptions = options.CreateViewOptions

type Credential added in v1.0.0

type Credential = options.Credential

type Cursor added in v1.0.0

type Cursor = mongo.Cursor

type CursorType added in v1.0.0

type CursorType = options.CursorType

type D

type D = primitive.D

type DataKeyOptions added in v1.0.0

type DataKeyOptions = options.DataKeyOptions

type Database added in v1.0.0

type Database = mongo.Database

type DatabaseOptions added in v1.0.0

type DatabaseOptions = options.DatabaseOptions

type DateTime added in v1.0.0

type DateTime = primitive.DateTime

type Decimal128 added in v1.0.0

type Decimal128 = primitive.Decimal128

type DefaultIndexOptions added in v1.0.0

type DefaultIndexOptions = options.DefaultIndexOptions

type DeleteOptions added in v1.0.0

type DeleteOptions = options.DeleteOptions

type DistinctOptions added in v1.0.0

type DistinctOptions = options.DistinctOptions

type DropIndexesOptions added in v1.0.0

type DropIndexesOptions = options.DropIndexesOptions

type E

type E = primitive.E

type EncryptOptions added in v1.0.0

type EncryptOptions = options.EncryptOptions

type EstimatedDocumentCountOptions added in v1.0.0

type EstimatedDocumentCountOptions = options.EstimatedDocumentCountOptions

type FindOneAndDeleteOptions added in v1.0.0

type FindOneAndDeleteOptions = options.FindOneAndDeleteOptions

type FindOneAndReplaceOptions added in v1.0.0

type FindOneAndReplaceOptions = options.FindOneAndReplaceOptions

type FindOneAndUpdateOptions added in v1.0.0

type FindOneAndUpdateOptions = options.FindOneAndUpdateOptions

type FindOneOptions added in v1.0.0

type FindOneOptions = options.FindOneOptions

type FindOptions added in v1.0.0

type FindOptions = options.FindOptions

type FullDocument added in v1.0.0

type FullDocument = options.FullDocument

type GridFSFindOptions added in v1.0.0

type GridFSFindOptions = options.GridFSFindOptions

type IndexOptions added in v1.0.0

type IndexOptions = options.IndexOptions

type InsertManyOptions added in v1.0.0

type InsertManyOptions = options.InsertManyOptions

type InsertOneOptions added in v1.0.0

type InsertOneOptions = options.InsertOneOptions

type JavaScript added in v1.0.0

type JavaScript = primitive.JavaScript

type ListCollectionsOptions added in v1.0.0

type ListCollectionsOptions = options.ListCollectionsOptions

type ListDatabasesOptions added in v1.0.0

type ListDatabasesOptions = options.ListDatabasesOptions

type ListIndexesOptions added in v1.0.0

type ListIndexesOptions = options.ListIndexesOptions

type M

type M = primitive.M

type MarshalError added in v1.0.0

type MarshalError = options.MarshalError

type MaxKey added in v1.0.0

type MaxKey = primitive.MaxKey

type MinKey added in v1.0.0

type MinKey = primitive.MinKey

type Mongo

type Mongo struct {
	// contains filtered or unexported fields
}

func (*Mongo) Client added in v1.0.0

func (mgo *Mongo) Client() *mongo.Client

func (*Mongo) DB added in v1.0.0

func (mgo *Mongo) DB(db string, opts ...*options.DatabaseOptions) *mongo.Database

func (*Mongo) Name

func (mgo *Mongo) Name() string

func (*Mongo) Serve

func (mgo *Mongo) Serve(ctx context.Context) error

func (*Mongo) Shutdown

func (mgo *Mongo) Shutdown(ctx context.Context) error

type Monitor

type Monitor interface {
	Setup(*mongo.Client)
	Serve()
	Shutdown()
	Started(context.Context, *event.CommandStartedEvent)
	Succeeded(context.Context, *event.CommandSucceededEvent)
	Failed(context.Context, *event.CommandFailedEvent)
	Event(*event.PoolEvent)
}

type NameOptions added in v1.0.0

type NameOptions = options.NameOptions

type Null added in v1.0.0

type Null = primitive.Null

type ObjectID added in v1.0.0

type ObjectID = primitive.ObjectID

type OptionFunc

type OptionFunc func(*Config)

func WithMonitor added in v1.0.0

func WithMonitor(monitor Monitor) OptionFunc

type Regex added in v1.0.0

type Regex = primitive.Regex

type ReplaceOptions added in v1.0.0

type ReplaceOptions = options.ReplaceOptions

type ReturnDocument added in v1.0.0

type ReturnDocument = options.ReturnDocument

type RunCmdOptions added in v1.0.0

type RunCmdOptions = options.RunCmdOptions

type SessionOptions added in v1.0.0

type SessionOptions = options.SessionOptions

type Symbol added in v1.0.0

type Symbol = primitive.Symbol

type Timestamp added in v1.0.0

type Timestamp = primitive.Timestamp

type TransactionOptions added in v1.0.0

type TransactionOptions = options.TransactionOptions

type Undefined added in v1.0.0

type Undefined = primitive.Undefined

type UpdateOptions added in v1.0.0

type UpdateOptions = options.UpdateOptions

type UploadOptions added in v1.0.0

type UploadOptions = options.UploadOptions

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL