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 | 9 лет назад | |
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.