mongodb

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MongoClient

func MongoClient(config Config) (*mongo.Client, error)

func MongoDatabase

func MongoDatabase(config Config) (*mongo.Database, error)

Types

type Config

type Config struct {
	Uri         string   //完整uri
	User        string   //用户名
	Password    string   //密码
	Hosts       []string //host地址
	Port        int      //端口
	Database    string   //数据库名
	Params      string   //其他相关认证
	MaxPoolSize uint64   //连接池最大数
}

func (*Config) GetApplyURI

func (t *Config) GetApplyURI() []*options.ClientOptions

func (*Config) GetUri

func (t *Config) GetUri() string

Jump to

Keyboard shortcuts

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