config

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigFile = "mongodb.conf.toml"
View Source
const (
	KeyDefaultDBName = "mongodb.default_db_name"
)

Variables

View Source
var (
	CommonConfig = &Config{Mongodb: DefaultMongodbConfig()}
)

Functions

This section is empty.

Types

type Config added in v0.0.3

type Config struct {
	Mongodb *MongodbConfig
}

func ReadConfigFile added in v0.0.3

func ReadConfigFile(files ...string) *Config

type MongodbConfig added in v0.0.3

type MongodbConfig struct {
	URI               string `value:"${mongodb.uri:=mongodb://localhost}"`
	MinPoolSize       int    `value:"${mongodb.min_pool_size:=3}"`
	MaxPoolSize       int    `value:"${mongodb.max_pool_size:=10}"`
	Timeout           int    `value:"${mongodb.timeout:=10}"` //单位秒
	EnableTransaction bool   `value:"${mongodb.enable_transaction:=false}"`
	DefaultDBName     string `value:"${mongodb.default_db_name:=test}"`
}

支持 go-spring 属性绑定

func DefaultMongodbConfig added in v0.0.3

func DefaultMongodbConfig() *MongodbConfig

Jump to

Keyboard shortcuts

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