mongox

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

func Get(name string) *mongo.Client

Get ...

func Range

func Range(fn func(name string, db *mongo.Client) bool)

Range 遍历所有实例

Types

type Config

type Config struct {
	Name string
	// DSN地址
	DSN string `json:"dsn" toml:"dsn"`
	// 创建连接的超时时间
	SocketTimeout time.Duration `json:"socketTimeout" toml:"socketTimeout"`
	// 连接池大小(最大连接数)
	PoolLimit int `json:"poolLimit" toml:"poolLimit"`
}

Config ...

func DefaultConfig

func DefaultConfig() Config

DefaultConfig 默认配置

func RawConfig

func RawConfig(key string) Config

RawConfig 裸配置 example: minerva.mongodb.demo

func StdConfig

func StdConfig(name string) Config

StdConfig 返回标准配置

func (Config) Build

func (config Config) Build() *mongo.Client

Jump to

Keyboard shortcuts

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