Skip to content
❗️❗️❗️ [deprecated] Moved to https://github.com/go-macaron/macaron
Go
Branch: master
Clone or download
Pull request Compare This branch is 155 commits ahead, 222 commits behind go-macaron:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
fixtures
inject
.gitignore !!!m.Group API Broken!!! Oct 24, 2014
LICENSE
README.md
context.go
context_test.go
gzip.go
gzip_test.go
logger.go
logger_test.go
macaron.go
macaron_test.go
macaronlogo.png
recovery.go
recovery_test.go
render.go
render_test.go
response_writer.go
response_writer_test.go
return_handler.go
return_handler_test.go
router.go
router_test.go
static.go
static_test.go
tree.go fix hidden bug Jul 20, 2015
tree_test.go

README.md

Macaron Build Status

Macaron Logo

Package macaron is a high productive and modular web framework in Go.

Current version: 0.6.8

Getting Started

The minimum requirement of Go is 1.3.

To install Macaron:

go get github.com/Unknwon/macaron

The very basic usage of Macaron:

package main

import "github.com/Unknwon/macaron"

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:

  • gzip - Gzip compression to all requests
  • render - Go template engine
  • static - Serves static files
  • 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

Getting Help

Credits

License

This project is under Apache v2 License. See the LICENSE file for the full license text.

You can’t perform that action at this time.