Ocean/CustomerDB/Init.go

23 lines
878 B
Go
Raw Normal View History

package CustomerDB
import (
"github.com/SommerEngineering/Ocean/ConfigurationDB"
"github.com/SommerEngineering/Ocean/Log"
LM "github.com/SommerEngineering/Ocean/Log/Meta"
)
2015-06-17 15:44:52 +00:00
// The init function for this package.
func init() {
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameDATABASE, `Init the customer database.`)
2015-06-17 15:44:52 +00:00
// Read the configuration values:
databaseHost := ConfigurationDB.Read(`CustomerDBHost`)
databaseDB = ConfigurationDB.Read(`CustomerDBDatabase`)
databaseUsername = ConfigurationDB.Read(`CustomerDBUsername`)
databasePassword = ConfigurationDB.Read(`CustomerDBPassword`)
// Try to connect to the database:
connectDatabase(databaseHost, databaseUsername, databasePassword, databaseDB)
Log.LogShort(senderName, LM.CategorySYSTEM, LM.LevelINFO, LM.MessageNameDATABASE, `Customer database is now ready.`)
}