mongodb

package
v0.0.0-...-a2093d6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: LGPL-2.1 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoDBConfig

type MongoDBConfig struct {
	Host     string
	Port     int
	Username string
	Password string
}

func NewMongoDBConfig

func NewMongoDBConfig(host string, port int, Username, password string) *MongoDBConfig

func (*MongoDBConfig) DSN

func (c *MongoDBConfig) DSN() interface{}

func (*MongoDBConfig) SetPassword

func (c *MongoDBConfig) SetPassword(value string) *MongoDBConfig

func (*MongoDBConfig) SetUsername

func (c *MongoDBConfig) SetUsername(value string) *MongoDBConfig

type MongoDBConnPool

type MongoDBConnPool struct{}

MongoDBConnPool mongodb连接池管理

type MongoDBDriver

type MongoDBDriver struct {
	Client *mongo.Client
	// contains filtered or unexported fields
}

func NewMongoDBDriver

func NewMongoDBDriver(config *MongoDBConfig) (*MongoDBDriver, error)

func (*MongoDBDriver) Close

func (d *MongoDBDriver) Close() error

Close 关闭连接 做连接管理等

func (*MongoDBDriver) Connection

func (d *MongoDBDriver) Connection() interface{}

从连接池中获取连接

func (*MongoDBDriver) Initalial

func (d *MongoDBDriver) Initalial() error

func (*MongoDBDriver) Ping

func (d *MongoDBDriver) Ping() bool

Jump to

Keyboard shortcuts

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