Esempio n. 1
0
func initDB() {

	dbMgr = mongodb.NewDBManager()

	err := dbMgr.InitSession("mongodb://amsAppUser:[email protected],localhost/AMS") //TODO: Externalize the URL

	if err != nil {
		fmt.Println("DBManager init failed", err)
	} else {
		fmt.Println("DBManager Initialized")
	}
}
Esempio n. 2
0
func initDB() (err error) {

	dbMgr = mongodb.NewDBManager()

	err = dbMgr.InitSession(MONGODB_URL) //TODO: Externalize the URL

	if err != nil {
		err = errors.New("Unable to Conenct to the Database :" + err.Error())
	}

	return err
}
Esempio n. 3
0
func initDB() {

	dbMgr = mongodb.NewDBManager()

	err := dbMgr.InitSession("mongodb://localhost,localhost/test")

	if err != nil {
		fmt.Println("DBManager init failed", err)
	} else {
		fmt.Println("DBManager Initialized")
	}
}