书栈网 · BookStack 本次搜索耗时 0.008 秒,为您找到 54 个相关结果.
  • Gzip

    Gzip 中間件由 NYTimes/gziphandler 提供。 import ( "github.com/clevergo/clevergo" "github.com/NYTimes/gziphandler" ) router . Use ( clevergo . WrapHH ( gziphandler...
  • CORS

    CORS middleware is powered by rs/cors . import ( "github.com/clevergo/clevergo" "github.com/rs/cors" ) m := cors . Default (). Handler router . Use ( cl...
  • CORS

    CORS 中间件由 rs/cors 提供。 import ( "github.com/clevergo/clevergo" "github.com/rs/cors" ) m := cors . Default (). Handler router . Use ( clevergo . WrapHH (...
  • Recovery

    CleverGo 提供了一个内置的 recovery 中间件。 rm := clevergo . Recovery ( true ) // 开启调试模式,其会打印 stack 信息到日志。 // rm := clevergo.RecoveryLogger(true, log.New(out, prefix, flag)) // 指定 Logg...
  • Minify

    Minify 中间件由 tdewolff/minify 提供。 import ( "github.com/clevergo/clevergo" "github.com/tdewolff/minify/v2" "github.com/tdewolff/minify/v2/css" "github...
  • 概念

    Handle Context Handle Handle 是一个请求处理器,其接收一个 context 实例,然后返回响应给客户端: func home ( ctx * clevergo . Context ) error { return ctx . String ( http . StatusOK , "hell...
  • 生成 URL

    命名路由 匹配路由 命名路由 命名路由用於反向路由生成。 router . Get ( "/login" , login , clevergo . RouteName ( "login" )) router . Get ( "/posts/:year/:month/:day/:slug" , queryPost , clevergo ...
  • 视图

    Jet 路由器为模板引擎定义了一个 Renderer 接口。 func render ( ctx * clevergo . Context ) error { return ctx . Render ( http . StatusOK , "index.tmpl" , map [ string ] interface {}...
  • 概念

    Handle Context Handle Handle 是一個請求處理器,其接收一個 context 實例,然後返回響應給客戶端: func home ( ctx * clevergo . Context ) error { return ctx . String ( http . StatusOK , "hell...
  • Request

    Method Assertion Shortcuts ctx.Request equals to *http.Request . Method Assertion func handler ( ctx * clevergo . Context ) error { // equals to ctx.IsMethod(ht...