mongodb

package module
v0.0.0-...-33ee0dc Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 76

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

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

func NewMongo

func NewMongo(name string, opts ...*options.ClientOptions) *Mongo

func (*Mongo) Client

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

func (*Mongo) Col

func (m *Mongo) Col(col bson.M) *mongo.Collection

func (*Mongo) Connect

func (m *Mongo) Connect(ctx context.Context)

func (*Mongo) ConnectDefault

func (m *Mongo) ConnectDefault(ctx context.Context)

func (*Mongo) Disconnect

func (m *Mongo) Disconnect(ctx context.Context)

func (*Mongo) InitCollection

func (m *Mongo) InitCollection(col bson.M)

func (*Mongo) M

func (m *Mongo) M() *Mongo

func (*Mongo) Ping

func (m *Mongo) Ping(ctx context.Context, rp *readpref.ReadPref)

type MongoChanPool

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

func NewMongoChanPool

func NewMongoChanPool(name string, maxPoolSize int, opts ...*options.ClientOptions) *MongoChanPool

func (*MongoChanPool) Disconnect

func (m *MongoChanPool) Disconnect(ctx context.Context)

func (*MongoChanPool) M

func (m *MongoChanPool) M() *Mongo

type MongoRingPool

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

func NewMongoRingPool

func NewMongoRingPool(name string, maxPoolSize int, opts ...*options.ClientOptions) *MongoRingPool

func (*MongoRingPool) Disconnect

func (m *MongoRingPool) Disconnect(ctx context.Context)

func (*MongoRingPool) M

func (m *MongoRingPool) M() *Mongo

type Mongoer

type Mongoer interface {
	M() *Mongo
	Disconnect(ctx context.Context)
}

func NewMongoPool

func NewMongoPool(poolType, name string, maxPoolSize int, opts ...*options.ClientOptions) (mr Mongoer)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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