Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

建议添加一些常用的快捷输出方法. #26

Closed
beikege opened this issue Apr 2, 2020 · 1 comment · Fixed by #27
Closed

建议添加一些常用的快捷输出方法. #26

beikege opened this issue Apr 2, 2020 · 1 comment · Fixed by #27
Assignees

Comments

@beikege
Copy link
Contributor

beikege commented Apr 2, 2020

类似echo框架

JSON(code int, i interface{}) error
HTML(code int, html string) error
String(code int, s string) error
Render(code int, name string, data interface{}) error
Cookies() []*http.Cookie
Cookie(name string) (*http.Cookie, error)
SetCookie(cookie *http.Cookie)
...

框架很好用👍感谢作者,有没有电报交流群?

@razonyang razonyang added this to the v1.9 milestone Apr 2, 2020
@razonyang razonyang self-assigned this Apr 2, 2020
@razonyang razonyang linked a pull request Apr 2, 2020 that will close this issue
14 tasks
@razonyang
Copy link
Member

razonyang commented Apr 2, 2020

OK,已经加到 v1.9 TODO LIST #27。至于交流群,暂时还没有。

随便说下,WrapHH(v1.8.1) 可以适配第三方中间件func(http.Handler) http.Handler,可以方便地在全局、路由组或路由中使用:

router.Use(
    clevergo.WrapHH(gziphandler.GzipHandler), // https://github.com/nytimes/gziphandler
    clevergo.WrapHH(cors.Default().Handler), // https://github.com/rs/cors
    // ...
)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants