Tango

    • [2016-2-1] 新增 session-ssdb,支持将ssdb作为session的后端存储
    • [2015-10-23] 更新renders插件,解决模板修改后需要刷新两次才能生效的问题

    简介

    安装Tango:

    然后在浏览器访问, 将会得到一个json返回

    这段代码因为拥有一个内嵌的,所以返回值会被自动的转成Json。具体返回可以参见以下文档。

    • 强大而灵活的路由设计
    • 兼容已有的
    • 模块化设计,可以很容易写出自己的中间件
    • 高性能的依赖注入方式

    中间件

    目前已有很多 ,可以帮助你快速完成工作:

    • compress - Gzip & Deflate compression
    • - Serves static files
    • logger - Log the request & inject Logger to action struct
    • - get the router parameters
    • return - Handle the returned value smartlly
    • - Inject context to action struct
    • session - Tango介绍 - 图2 Session manager
    • - Generates and validates csrf tokens
    • binding - Tango介绍 - 图6 Bind and validates forms
    • - Go template engine
    • dispatch - Tango介绍 - 图10 Multiple Application support on one server
    • - Pongo2 teamplte engine support
    • - Before and After
    • flash - Tango介绍 - 图18 Share data between requests
    • - show detail debug infomaton on log
    • basicauth - Tango介绍 - 图22 basicauth middleware

    案例