Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { User string `envconfig:"MONGODB_USER"` Pw string `envconfig:"MONGODB_PW"` Hosts string `envconfig:"MONGODB_HOSTS"` MasterHost string `envconfig:"MONGODB_MASTER_HOST_NAME"` AuthDB string `envconfig:"MONGODB_AUTH_DB_NAME"` DB string `envconfig:"MONGODB_DB_NAME"` Mode string `envconfig:"MONGODB_MODE"` Tags []bson.DocElem `envconfig:"MONGODB_TAGS"` }
Config holds the information required for connecting to a MongoDB replicaset.
func LoadConfigFromEnv ¶
func LoadConfigFromEnv() *Config
LoadConfigFromEnv will attempt to load a MongoCreds object from environment variables.
func (*Config) Must ¶
func (m *Config) Must() *mgo.Session
Must will attempt to initiate a new mgo.Session with the replicaset and will panic if it encounters any issues.
func (*Config) MustMaster ¶
func (m *Config) MustMaster() *mgo.Session
MustMaster will attempt to initiate a new mgo.Session with the Master host and will panic if it encounters any issues.
Click to show internal directories.
Click to hide internal directories.