go-martini / martini

Classy web framework for Go

Home Page:martini.codegangsta.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can i use two redis Client in one handdler?

melonwool opened this issue · comments

commented

How to do it? The Map() function just map one *redis.Client

   app.Group("/detail", func(r martini.Router) {

        r.Get("", binding.Form(controllers.DetailForm{}), controllers.Detail)

    })

No, you can't, but you can make something like:

type RedisClients struct {
       Foo *redis.Client
       Bar *redis.Client
}

and then map an instance of that type instead

commented

Thank you, is't useful!