Micro-kernel & pluggable web framework for Go
Lunny Xiao 227eca782a readme added log history | 9 年之前 | |
---|---|---|
public | 10 年之前 | |
LICENSE | 10 年之前 | |
README.md | 9 年之前 | |
README_CN.md | 9 年之前 | |
compress.go | 10 年之前 | |
compress_test.go | 10 年之前 | |
context.go | 9 年之前 | |
context_test.go | 10 年之前 | |
cookie.go | 10 年之前 | |
cookie_test.go | 10 年之前 | |
doc.go | 10 年之前 | |
error.go | 10 年之前 | |
error_test.go | 10 年之前 | |
group.go | 10 年之前 | |
group_test.go | 10 年之前 | |
logger.go | 9 年之前 | |
logger_test.go | 10 年之前 | |
logo.png | 10 年之前 | |
param.go | 10 年之前 | |
param_test.go | 10 年之前 | |
pool.go | 10 年之前 | |
pool_test.go | 10 年之前 | |
recovery.go | 10 年之前 | |
recovery_test.go | 10 年之前 | |
request.go | 10 年之前 | |
request_test.go | 10 年之前 | |
response.go | 10 年之前 | |
response_test.go | 10 年之前 | |
return.go | 10 年之前 | |
return_test.go | 10 年之前 | |
router.go | 9 年之前 | |
router_test.go | 9 年之前 | |
static.go | 10 年之前 | |
static_test.go | 10 年之前 | |
tan.go | 9 年之前 | |
tan_test.go | 10 年之前 |
Package tango is a micro-kernel & pluggable web framework for Go.
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
Middlewares allow you easily plugin/unplugin features for your Tango applications.
There are already many middlewares to simplify your work:
This project is under BSD License. See the LICENSE file for the full license text.