You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
3.9 KiB

  1. Macaron [![Build Status](https://travis-ci.org/go-macaron/macaron.svg?branch=v1)](https://travis-ci.org/go-macaron/macaron) [![](http://gocover.io/_badge/github.com/go-macaron/macaron)](http://gocover.io/github.com/go-macaron/macaron)
  2. =======================
  3. ![Macaron Logo](https://raw.githubusercontent.com/go-macaron/macaron/v1/macaronlogo.png)
  4. Package macaron is a high productive and modular web framework in Go.
  5. ## Getting Started
  6. The minimum requirement of Go is **1.3**.
  7. To install Macaron:
  8. go get gopkg.in/macaron.v1
  9. The very basic usage of Macaron:
  10. ```go
  11. package main
  12. import "gopkg.in/macaron.v1"
  13. func main() {
  14. m := macaron.Classic()
  15. m.Get("/", func() string {
  16. return "Hello world!"
  17. })
  18. m.Run()
  19. }
  20. ```
  21. ## Features
  22. - Powerful routing with suburl.
  23. - Flexible routes combinations.
  24. - Unlimited nested group routers.
  25. - Directly integrate with existing services.
  26. - Dynamically change template files at runtime.
  27. - Allow to use in-memory template and static files.
  28. - Easy to plugin/unplugin features with modular design.
  29. - Handy dependency injection powered by [inject](https://github.com/codegangsta/inject).
  30. - Better router layer and less reflection make faster speed.
  31. ## Middlewares
  32. Middlewares allow you easily plugin/unplugin features for your Macaron applications.
  33. There are already many [middlewares](https://github.com/go-macaron) to simplify your work:
  34. - render - Go template engine
  35. - static - Serves static files
  36. - [gzip](https://github.com/go-macaron/gzip) - Gzip compression to all responses
  37. - [binding](https://github.com/go-macaron/binding) - Request data binding and validation
  38. - [i18n](https://github.com/go-macaron/i18n) - Internationalization and Localization
  39. - [cache](https://github.com/go-macaron/cache) - Cache manager
  40. - [session](https://github.com/go-macaron/session) - Session manager
  41. - [csrf](https://github.com/go-macaron/csrf) - Generates and validates csrf tokens
  42. - [captcha](https://github.com/go-macaron/captcha) - Captcha service
  43. - [pongo2](https://github.com/go-macaron/pongo2) - Pongo2 template engine support
  44. - [sockets](https://github.com/go-macaron/sockets) - WebSockets channels binding
  45. - [bindata](https://github.com/go-macaron/bindata) - Embed binary data as static and template files
  46. - [toolbox](https://github.com/go-macaron/toolbox) - Health check, pprof, profile and statistic services
  47. - [oauth2](https://github.com/go-macaron/oauth2) - OAuth 2.0 backend
  48. - [switcher](https://github.com/go-macaron/switcher) - Multiple-site support
  49. - [method](https://github.com/go-macaron/method) - HTTP method override
  50. - [permissions2](https://github.com/xyproto/permissions2) - Cookies, users and permissions
  51. - [renders](https://github.com/go-macaron/renders) - Beego-like render engine(Macaron has built-in template engine, this is another option)
  52. ## Use Cases
  53. - [Gogs](https://gogs.io): A painless self-hosted Git Service
  54. - [Peach](https://peachdocs.org): A modern web documentation server
  55. - [Go Walker](https://gowalker.org): Go online API documentation
  56. - [Switch](https://gopm.io): Gopm registry
  57. - [YouGam](http://yougam.com): Online Forum
  58. - [Critical Stack Intel](https://intel.criticalstack.com/): A 100% free intel marketplace from Critical Stack, Inc.
  59. ## Getting Help
  60. - [API Reference](https://gowalker.org/gopkg.in/macaron.v1)
  61. - [Documentation](https://go-macaron.com)
  62. - [FAQs](https://go-macaron.com/docs/faqs)
  63. - [![Join the chat at https://gitter.im/Unknwon/macaron](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/go-macaron/macaron?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
  64. ## Credits
  65. - Basic design of [Martini](https://github.com/go-martini/martini).
  66. - Logo is modified by [@insionng](https://github.com/insionng) based on [Tribal Dragon](http://xtremeyamazaki.deviantart.com/art/Tribal-Dragon-27005087).
  67. ## License
  68. This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text.