Micro & pluggable web framework for Go
Go to file
2016-03-14 14:54:17 +08:00
public added more tests 2015-04-16 23:20:30 +08:00
compress_test.go license & small optimization 2015-04-28 15:42:01 +08:00
compress.go license & small optimization 2015-04-28 15:42:01 +08:00
context_test.go add utf8 on tests and codes 2015-08-22 18:02:40 +08:00
context.go improved README 2016-02-15 09:41:29 +08:00
cookie_test.go added IsAjax and RemoteAddr for context, gofmt 2015-10-26 12:01:01 +08:00
cookie.go added IsAjax and RemoteAddr for context, gofmt 2015-10-26 12:01:01 +08:00
doc.go license & small optimization 2015-04-28 15:42:01 +08:00
error_test.go license & small optimization 2015-04-28 15:42:01 +08:00
error.go license & small optimization 2015-04-28 15:42:01 +08:00
file_test.go license & small optimization 2015-04-28 15:42:01 +08:00
file.go license & small optimization 2015-04-28 15:42:01 +08:00
form_test.go added IsAjax and RemoteAddr for context, gofmt 2015-10-26 12:01:01 +08:00
form.go improved README 2016-02-15 09:41:29 +08:00
group_test.go license & small optimization 2015-04-28 15:42:01 +08:00
group.go add more forms support for group Route 2016-03-14 14:54:17 +08:00
LICENSE license & small optimization 2015-04-28 15:42:01 +08:00
logger_test.go license & small optimization 2015-04-28 15:42:01 +08:00
logger.go fixed ip show in debug log when running after reverse proxy 2015-11-20 17:49:51 +08:00
logo.png add logo 2014-12-25 13:21:52 +08:00
param_test.go added IsAjax and RemoteAddr for context, gofmt 2015-10-26 12:01:01 +08:00
param.go added IsAjax and RemoteAddr for context, gofmt 2015-10-26 12:01:01 +08:00
pool_test.go license & small optimization 2015-04-28 15:42:01 +08:00
pool.go added IsAjax and RemoteAddr for context, gofmt 2015-10-26 12:01:01 +08:00
prefix_test.go license & small optimization 2015-04-28 15:42:01 +08:00
prefix.go small optimization 2015-05-25 10:44:55 +08:00
README_CN.md improved README for documents' links 2016-02-17 23:33:04 +08:00
README.md improved README for documents' links 2016-02-17 23:33:04 +08:00
recovery_test.go license & small optimization 2015-04-28 15:42:01 +08:00
recovery.go license & small optimization 2015-04-28 15:42:01 +08:00
RELEASE.md docs 2015-03-21 17:42:25 +08:00
response.go some docs & small improvements 2015-05-04 10:51:09 +08:00
return_test.go added IsAjax and RemoteAddr for context, gofmt 2015-10-26 12:01:01 +08:00
return.go added IsAjax and RemoteAddr for context, gofmt 2015-10-26 12:01:01 +08:00
router_test.go added more test for routers 2015-10-22 15:34:53 +08:00
router.go less memory for init 2015-10-14 14:58:51 +08:00
static_test.go license & small optimization 2015-04-28 15:42:01 +08:00
static.go add utf8 on tests and codes 2015-08-22 18:02:40 +08:00
tan_test.go license & small optimization 2015-04-28 15:42:01 +08:00
tan.go add more forms support for group Route 2016-03-14 14:54:17 +08:00

Tango Build Status 简体中文

Join the chat at https://gitter.im/lunny/tango

Tango Logo

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

Current version: v0.4.6 Version History

Getting Started

To install Tango:

go get github.com/lunny/tango

A classic usage of Tango below:

package main

import (
    "errors"
    "github.com/lunny/tango"
)

type Action struct {
    tango.Json
}

func (Action) Get() interface{} {
    if true {
        return map[string]string{
            "say": "Hello tango!",
        }
    }
    return errors.New("something error")
}

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

Then visit http://localhost:8000 on your browser. You will get

{"say":"Hello tango!"}

If you change true after if to false, then you will get

{"err":"something error"}

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

Features

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

Middlewares

Middlewares allow you easily plugin features for your Tango applications.

There are already many middlewares to simplify your work:

Documentation

Discuss

Cases

License

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