Example #1
0
func initializeRepo() model.Repository {
	url := c.Database.URL + c.Database.Test

	manager, err := postgres.NewPgManager(url)
	if err != nil {
		log.Error("Unable to initialize PgManager")
		os.Exit(1)
	}

	return postgres.NewPgRepository(manager)
}
Example #2
0
func initializeRepo(c *controller.Controller) {
	manager, err := postgres.NewPgManager(conf.Database.Url)
	if err != nil {
		fmt.Printf("Unable to intialize repo: %v\n", err)
		os.Exit(1)
	}

	repo := postgres.NewPgRepository(manager)

	c.SetRepository(repo)
}