Micro & pluggable web framework for Go
public | ||
compress_test.go | ||
compress.go | ||
context_test.go | ||
context.go | ||
doc.go | ||
error.go | ||
group_test.go | ||
group.go | ||
LICENSE | ||
logger_test.go | ||
logger.go | ||
logo.png | ||
param_test.go | ||
param.go | ||
pool_test.go | ||
pool.go | ||
README.md | ||
recovery_test.go | ||
recovery.go | ||
request_test.go | ||
request.go | ||
response_test.go | ||
response.go | ||
return_test.go | ||
return.go | ||
router_test.go | ||
router.go | ||
static_test.go | ||
static.go | ||
tan_test.go | ||
tan.go |
Tango
Package tango is a micro & pluggable web framework for Go.
Current version: 0.1.0
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 {}
func (Action) Get() string {
return "Hello tango!"
}
func main() {
t := tango.Classic()
t.Get("/", new(Action))
t.Run()
}
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 embbed.
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
- logger - log the request
- 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 - Session manager
- xsrf - Generates and validates csrf tokens
- bind - Bind and validates forms
- render - Go template engine
- dispatch - Multiple Application support on one server
- tpongo2 - Pongo2 teamplte engine support
Getting Help
License
This project is under BSD License. See the LICENSE file for the full license text.