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") } }
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 }
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") } }