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

README.md 3.9 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Macaron [![Build Status](https://travis-ci.org/go-macaron/macaron.svg?branch=v1)](https://travis-ci.org/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. - [authz](https://github.com/go-macaron/authz) - ACL/RBAC/ABAC authorization based on Casbin
  49. - [switcher](https://github.com/go-macaron/switcher) - Multiple-site support
  50. - [method](https://github.com/go-macaron/method) - HTTP method override
  51. - [permissions2](https://github.com/xyproto/permissions2) - Cookies, users and permissions
  52. - [renders](https://github.com/go-macaron/renders) - Beego-like render engine(Macaron has built-in template engine, this is another option)
  53. - [piwik](https://github.com/veecue/piwik-middleware) - Server-side piwik analytics
  54. ## Use Cases
  55. - [Gogs](https://gogs.io): A painless self-hosted Git Service
  56. - [Grafana](http://grafana.org/): The open platform for beautiful analytics and monitoring
  57. - [Peach](https://peachdocs.org): A modern web documentation server
  58. - [Go Walker](https://gowalker.org): Go online API documentation
  59. - [Switch](https://gopm.io): Gopm registry
  60. - [Critical Stack Intel](https://intel.criticalstack.com/): A 100% free intel marketplace from Critical Stack, Inc.
  61. ## Getting Help
  62. - [API Reference](https://gowalker.org/gopkg.in/macaron.v1)
  63. - [Documentation](https://go-macaron.com)
  64. - [FAQs](https://go-macaron.com/docs/faqs)
  65. ## Credits
  66. - Basic design of [Martini](https://github.com/go-martini/martini).
  67. - Logo is modified by [@insionng](https://github.com/insionng) based on [Tribal Dragon](http://xtremeyamazaki.deviantart.com/art/Tribal-Dragon-27005087).
  68. ## License
  69. This project is under the Apache License, Version 2.0. See the [LICENSE](LICENSE) file for the full license text.