Beispiel #1
0
func initDB() {

	dbMgr = mongodb.NewDBManager()

	err := dbMgr.InitSession("mongodb://*****:*****@localhost,localhost/AMS") //TODO: Externalize the URL

	if err != nil {
		fmt.Println("DBManager init failed", err)
	} else {
		fmt.Println("DBManager Initialized")
	}
}
Beispiel #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
}
Beispiel #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")
	}
}