⚡ Rux is an simple and fast web framework. support route group, param route binding, middleware, compatible http.Handler interface. 简单且快速的 Go api/web 框架,支持路由分组,路由参数绑定,中间件,兼容 http.Handler 接口
I want to save some data to Context from middleware like below Middleware.go func CheckAuth(c *rux.Context) { c.SaveDataForMainController(map[string]string{ "name": "xxxxxxxx", }) c.Next() }
In main controller i want to access data like this Controller.go func profile(c *rux.Context) { data := c.getSavedData() }
Is there any way to do like this or can you add features like this
An HTTP cache system would be great in rux to avoid the execution of unchanged response.
I can implement Souin as the HTTP cache middleware. With that it will support the CDN validation/invalidation too, set default cache-control header, store in a distributed system using olric or in memory with badger.
It's already available as Træfik/Tyk plugin, skipper/gin/echo middleware, and is used in the official caddy cache-handler.