You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
techknowlogick 26931529e8 update to 1.13, and add GOPROXY env var (#12)
update to 1.13, and add GOPROXY env var

Reviewed-by: John Olheiser <john.olheiser@gmail.com>
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
3 years ago
fixtures Add AppendDirectories option to render 7 years ago
.drone.yml update to 1.13, and add GOPROXY env var (#12) 3 years ago
.gitignore Expose some objects 7 years ago
LICENSE MISC: update LICENSE identifying info and README 6 years ago
README.md use gitea.com/macaron/inject (#4) 4 years ago
context.go Use github.com/unknwon/com (#10) 4 years ago
context_test.go Use github.com/unknwon/com (#10) 4 years ago
go.mod Remove the init panic (#1) 3 years ago
go.sum Remove the init panic (#1) 3 years ago
logger.go logger: show request method for complete 6 years ago
logger_test.go Use github.com/unknwon/com (#10) 4 years ago
macaron.go Remove the init panic (#1) 3 years ago
macaron_test.go new license and API 8 years ago
macaronlogo.png Logo 9 years ago
recovery.go use gitea.com/macaron/inject (#4) 4 years ago
recovery_test.go new license and API 8 years ago
render.go Use github.com/unknwon/com (#10) 4 years ago
render_test.go integration FastInvoke Handler (#91) 6 years ago
response_writer.go response_writer: fix writing body for HEAD method (#85) 5 years ago
response_writer_test.go response_writer: fix writing body for HEAD method (#85) 5 years ago
return_handler.go use gitea.com/macaron/inject (#4) 4 years ago
return_handler_test.go integration FastInvoke Handler (#91) 6 years ago
router.go router: support autoHead for ComboRouter 5 years ago
router_test.go response_writer: fix writing body for HEAD method (#85) 5 years ago
static.go Add ETag header to staticHandler (#114) 6 years ago
static_test.go Add ETag header to staticHandler (#114) 6 years ago
tree.go Use github.com/unknwon/com (#10) 4 years ago
tree_test.go router: handle URLs with escaped characters (#149) 5 years ago
util_go17.go router: handle URLs with escaped characters (#149) 5 years ago
util_go18.go router: handle URLs with escaped characters (#149) 5 years ago

README.md

Macaron Build Status

Macaron Logo

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

Getting Started

The minimum requirement of Go is 1.6.

To install Macaron:

go get gitea.com/macaron/macaron

The very basic usage of Macaron:

package main

import "gitea.com/macaron/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:

  • 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
  • authz - ACL/RBAC/ABAC authorization based on Casbin
  • 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)
  • piwik - Server-side piwik analytics

Use Cases

  • Gogs: A painless self-hosted Git Service
  • Grafana: The open platform for beautiful analytics and monitoring
  • Peach: A modern web documentation server
  • Go Walker: Go online API documentation
  • Switch: Gopm registry
  • Critical Stack Intel: A 100% free intel marketplace from Critical Stack, Inc.

Getting Help

Credits

License

This project is under the Apache License, Version 2.0. See the LICENSE file for the full license text.