Beispiel #1
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)
}
Beispiel #2
0
func initializeTokenService(c *controller.Controller) {
	ts := jwt.InitializeJwt([]byte(conf.Auth.Key))

	c.SetTokenService(ts)
}