mirror of https://github.com/gogits/gogs.git
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.
Unknwon
c37d3f6486
|
8 years ago | |
---|---|---|
.. | ||
LICENSE | 8 years ago | |
README.md | 8 years ago | |
context.go | 8 years ago | |
logger.go | 8 years ago | |
macaron.go | 8 years ago | |
macaron.sublime-project | 8 years ago | |
macaronlogo.png | 8 years ago | |
recovery.go | 8 years ago | |
render.go | 8 years ago | |
response_writer.go | 8 years ago | |
return_handler.go | 8 years ago | |
router.go | 8 years ago | |
static.go | 8 years ago | |
tree.go | 8 years ago |
README.md
Macaron
Package macaron is a high productive and modular web framework in Go.
Getting Started
The minimum requirement of Go is 1.3.
To install Macaron:
go get gopkg.in/macaron.v1
The very basic usage of Macaron:
package main
import "gopkg.in/macaron.v1"
func main() {
m := macaron.Classic()
m.Get("/", func() string {
return "Hello world!"
})
m.Run()
}
Features
- Powerful routing with suburl.
- Flexible routes combinations.
- Unlimited nested group routers.
- Directly integrate with existing services.
- Dynamically change template files at runtime.
- Allow to use in-memory template and static files.
- Easy to plugin/unplugin features with modular design.
- Handy dependency injection powered by inject.
- Better router layer and less reflection make faster speed.
Middlewares
Middlewares allow you easily plugin/unplugin features for your Macaron applications.
There are already many middlewares to simplify your work:
- render - Go template engine
- static - Serves static files
- gzip - Gzip compression to all responses
- binding - Request data binding and validation
- i18n - Internationalization and Localization
- cache - Cache manager
- session - Session manager
- csrf - Generates and validates csrf tokens
- captcha - Captcha service
- pongo2 - Pongo2 template engine support
- sockets - WebSockets channels binding
- bindata - Embed binary data as static and template files
- toolbox - Health check, pprof, profile and statistic services
- oauth2 - OAuth 2.0 backend
- switcher - Multiple-site support
- method - HTTP method override
- permissions2 - Cookies, users and permissions
- renders - Beego-like render engine(Macaron has built-in template engine, this is another option)
Use Cases
- Gogs: A painless self-hosted Git Service
- Peach: A modern web documentation server
- Go Walker: Go online API documentation
- Switch: Gopm registry
- YouGam: Online Forum
- Critical Stack Intel: A 100% free intel marketplace from Critical Stack, Inc.
Getting Help
Credits
- Basic design of Martini.
- Logo is modified by @insionng based on Tribal Dragon.
License
This project is under the Apache License, Version 2.0. See the LICENSE file for the full license text.