Micro & pluggable web framework for Go
Go to file
2015-03-02 13:43:14 +08:00
public more tests 2014-12-25 16:31:35 +08:00
compress_test.go more tests & bug fixed 2014-12-26 11:32:14 +08:00
compress.go use short name handlers 2015-01-05 18:09:06 +08:00
context_test.go use http.Redirect 2015-01-04 18:03:47 +08:00
context.go bug fixed 2015-02-26 13:39:38 +08:00
cookie_test.go remove unimported 2015-01-03 15:13:42 +08:00
cookie.go add cookie support 2015-01-03 15:06:51 +08:00
doc.go remove unused codes 2015-01-06 13:45:03 +08:00
error_test.go add custom error handler test 2015-01-12 14:26:12 +08:00
error.go more tests 2015-01-12 11:20:26 +08:00
group_test.go remove unused codes 2015-01-06 13:45:03 +08:00
group.go remove unused codes 2015-01-06 13:45:03 +08:00
LICENSE add some tests 2014-12-25 12:46:07 +08:00
logger_test.go use short name handlers 2015-01-05 18:09:06 +08:00
logger.go small improvements 2015-02-15 13:34:05 +08:00
logo.png add logo 2014-12-25 13:21:52 +08:00
param_test.go add some tests 2014-12-25 12:46:07 +08:00
param.go use short name handlers 2015-01-05 18:09:06 +08:00
pool_test.go more tests 2014-12-25 16:27:12 +08:00
pool.go more tests 2014-12-25 16:27:12 +08:00
README_CN.md add debug middlewares 2015-02-15 19:41:43 +08:00
README.md add debug middlewares 2015-02-15 19:41:43 +08:00
recovery_test.go add default errorhandler and the way to custom errorhandler 2015-01-12 10:49:38 +08:00
recovery.go add default errorhandler and the way to custom errorhandler 2015-01-12 10:49:38 +08:00
request_test.go add some tests 2014-12-25 12:46:07 +08:00
request.go use short name handlers 2015-01-05 18:09:06 +08:00
response_test.go add some tests 2014-12-25 12:46:07 +08:00
response.go remove unused codes 2015-01-06 13:45:03 +08:00
return_test.go more tests 2015-01-12 11:20:26 +08:00
return.go add custom error handler test 2015-01-12 14:26:12 +08:00
router_test.go add custom method 2015-01-29 11:12:00 +08:00
router.go bug fixed 2015-02-20 12:49:58 +08:00
static_test.go add staticoptions 2015-01-13 18:03:48 +08:00
static.go more features for static 2015-01-20 09:36:46 +08:00
tan_test.go more tests 2015-01-12 11:20:26 +08:00
tan.go bug fixed 2015-03-02 13:43:14 +08:00

Tango Build Status 简体中文

Tango Logo

Package tango is a micro-kernel & pluggable web framework for Go.

Current version: 0.2.8

Getting Started

To install Tango:

go get github.com/lunny/tango

The very basic usage of Tango:

package main

import "github.com/lunny/tango"

func main() {
    t := tango.Classic()
    t.Get("/", func() string {
        return "Hello tango!"
    })
    t.Run()
}

Then visit http://localhost:8000 on your browser. Of course, tango support struct form also.

package main

import "github.com/lunny/tango"

type Action struct {
    tango.Json
}

func (Action) Get() map[string]string {
    return map[string]string{
        "say": "Hello tango!",
    }
}

func main() {
    t := tango.Classic()
    t.Get("/", new(Action))
    t.Run()
}

This code will automatically convert returned map to a json because we has an embedded struct tango.Json.

More document, please see godoc and Wiki

Features

  • Powerful routing & Flexible routes combinations.
  • Directly integrate with existing services.
  • Easy to plugin/unplugin features with modular design.
  • High performance dependency injection embedded.

Middlewares

Middlewares allow you easily plugin/unplugin features for your Tango applications.

There are already many middlewares to simplify your work:

  • recovery - recover after panic
  • compress - Gzip & Deflate compression
  • static - Serves static files
  • logger - Log the request & inject Logger to action struct
  • param - get the router parameters
  • return - Handle the returned value smartlly
  • request - Inject request to action struct
  • response - Inject response to action struct
  • session - Build Status Session manager
  • xsrf - Build Status Generates and validates csrf tokens
  • binding - Build Status Bind and validates forms
  • renders - Build Status Go template engine
  • dispatch - Build Status Multiple Application support on one server
  • tpongo2 - Build Status Pongo2 teamplte engine support
  • captcha - Build Status Captcha
  • events - Build Status Before and After
  • flash - Build Status Share data between requests
  • debug - Build Status show detail debug infomaton on log

Getting Help

Cases

License

This project is under BSD License. See the LICENSE file for the full license text.