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 4.3 kB

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