Documentation ¶
Index ¶
- Variables
- type A
- type D
- type E
- type M
- type Mongo
- func (mgo *Mongo) Database(name string, opts ...*options.DatabaseOptions) *mongo.Database
- func (mgo *Mongo) Name() string
- func (mgo *Mongo) Serve(ctx context.Context) error
- func (mgo *Mongo) Shutdown(ctx context.Context) error
- func (mgo *Mongo) StartSession(opts ...*options.SessionOptions) (mongo.Session, error)
- func (mgo *Mongo) UseSession(ctx context.Context, fn func(mongo.SessionContext) error) error
- func (mgo *Mongo) UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, ...) error
- type Monitor
- type OptionFunc
- type Options
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 Mongo ¶
func New ¶
func New(optionFunc ...OptionFunc) (*Mongo, error)
func (*Mongo) StartSession ¶
func (*Mongo) UseSession ¶
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
Click to show internal directories.
Click to hide internal directories.