These are chat archives for gin-gonic/gin

May 2015
Joonathan Mägi
May 22 2015 12:22
what's the recommended way of making database connection accessible to packages as well. I'm looking into structuring the project into several packages/directories. Right now I just have an appContext I create within main() but with multiple packages/directories I don't think this would fly?
Manu MA
May 22 2015 15:09
have a db package, that is imported by each package. main creates a instance of the DB manager
when creating instances of each package you pass the db manager pointer as a initialisation parameter
DB := db.CreateWithStuff(....)
errorManager := myerrorpackage.New(DB, ...)
api := myapi.New(DB, ... )
that would be a way to do it
BTW, Gin v1.0rc1 released and merged in master:
Ryan Brooks
May 22 2015 15:12
'Zero allocation router’ - hawt
Manu MA
May 22 2015 15:14
yeah! it is even faster than HttpRouter
Joonathan Mägi
May 22 2015 17:02
nice, will get my stuff upgraded to v1.0rc1 to play with it
Manu MA
May 22 2015 17:25
I am drafting a migration document, work in progress