// Store is a middleware function that initializes the Datastore and attaches to // the context of every http.Request. func Store(cli *cli.Context) gin.HandlerFunc { v := setupStore(cli) return func(c *gin.Context) { store.ToContext(c, v) c.Next() } }
func SetStore(s store.Store) gin.HandlerFunc { return func(c *gin.Context) { store.ToContext(c, s) c.Next() } }