Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_MONGODB_MIN_OPEN = 3 DEFAULT_MONGODB_MAX_OPEN = 10 DEFAULT_MONGODB_MIN_OPEN_LIMIT = DEFAULT_MONGODB_MIN_OPEN DEFAULT_MONGODB_MAX_OPEN_LIMIT = DEFAULT_MONGODB_MAX_OPEN )
Variables ¶
View Source
var DB *mongo.Client
Functions ¶
func InitMongoDB ¶
Types ¶
type Config ¶
type Config struct { StartupRetryPeriod time.Duration `json:"startup_retry_period" toml:"-" mapstructure:"-"` StartupRetryTimes int `json:"startup_retry_times" toml:"-" mapstructure:"-"` ConnectTimeout time.Duration `json:"connect_timeout" toml:"-" mapstructure:"-"` DSN string `json:"dsn" toml:"dsn" mapstructure:"dsn"` MinOpen uint64 `json:"min_open" toml:"min_open" mapstructure:"min_open"` MaxOpen uint64 `json:"max_open" toml:"max_open" mapstructure:"max_open"` MaxLifetime time.Duration `json:"max_lifetime" toml:"-" mapstructure:"-"` }
func (*Config) VerifyConfig ¶
Click to show internal directories.
Click to hide internal directories.