Documentation ¶
Overview ¶
Package mgoutil provides utilities for working with mgo library.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Addrs []string `envconfig:"MONGODB_ADDRS" default:"mongodb:27017"` Database string `envconfig:"MONGODB_DATABASE" default:"goway"` Username string `envconfig:"MONGODB_USERNAME"` Password string `envconfig:"MONGODB_PASSWORD"` Timeout time.Duration `envconfig:"MONGODB_TIMEOUT" default:"10s"` Mode mgo.Mode `envconfig:"MONGODB_MODE" default:"1"` Refresh bool `envconfig:"MONGODB_REFRESH" default:"true"` }
Config hold MongoDB common configuration.
func ReadConfigFromEnv ¶ added in v0.1.0
func ReadConfigFromEnv(opts ...config.ReadOption) *Config
ReadConfigFromEnv returns a Config object populated from environment variables.
Click to show internal directories.
Click to hide internal directories.