doc.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright 2014 lunny. All rights reserved.
  2. // Use of this source code is governed by a BSD
  3. // license that can be found in the LICENSE file.
  4. /*
  5. Tango is a micro & pluggable web framework for Go language.
  6. package main
  7. import "github.com/lunny/tango"
  8. type Action struct {
  9. }
  10. func (Action) Get() string {
  11. return "Hello tango!"
  12. }
  13. func main() {
  14. t := tango.Classic()
  15. t.Get("/", new(Action))
  16. t.Run()
  17. }
  18. Middlewares allow you easily plugin/unplugin features for your Tango applications.
  19. There are already many [middlewares](https://github.com/tango-contrib) to simplify your work:
  20. - compress - Gzip & Deflate compression
  21. - static - Serves static files
  22. - logger - Log the request & inject Logger to action struct
  23. - return - Handle the returned value smartlly
  24. - request - Inject request to action struct
  25. - response - Inject response to action struct
  26. - [session](https://github.com/tango-contrib/session) - Session manager
  27. - [xsrf](https://github.com/tango-contrib/xsrf) - Generates and validates csrf tokens
  28. - [bind](https://github.com/tango-contrib/bind) - Bind and validates forms
  29. - [renders](https://github.com/tango-contrib/renders) - Go template engine
  30. - [dispatch](https://github.com/tango-contrib/dispatch) - Multiple Application support on one server
  31. - [pongo2](https://github.com/tango-contrib/pongo2) - Pongo2 teamplte engine support
  32. - [captcha](https://github.com/tango-contrib/captcha) - Captcha
  33. */
  34. package tango