mongodb

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	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
)

Functions

This section is empty.

Types

type A

type A bson.A

type D

type D bson.D

type E

type E bson.E

type M

type M bson.M

type Mongo

type Mongo struct {
	dummybox.DummyBox
	// contains filtered or unexported fields
}

func New

func New(optionFunc ...OptionFunc) (*Mongo, error)

func (*Mongo) Database

func (mgo *Mongo) Database(name 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

func (*Mongo) StartSession

func (mgo *Mongo) StartSession(opts ...*options.SessionOptions) (mongo.Session, error)

func (*Mongo) UseSession

func (mgo *Mongo) UseSession(ctx context.Context, fn func(mongo.SessionContext) error) error

func (*Mongo) UseSessionWithOptions

func (mgo *Mongo) UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, fn func(mongo.SessionContext) error) error

type Monitor

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

func (*Monitor) CommandMonitor

func (mon *Monitor) CommandMonitor() *event.CommandMonitor

func (*Monitor) PoolEventMonitor

func (mon *Monitor) PoolEventMonitor() *event.PoolMonitor

type OptionFunc

type OptionFunc func(*Options)

func WithConfigurator

func WithConfigurator(cfg config.SubConfigurator) OptionFunc

func WithEnableMonitor

func WithEnableMonitor(enable bool) OptionFunc

func WithName

func WithName(name string) OptionFunc

type Options

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

Jump to

Keyboard shortcuts

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