This repository has been archived on 2020-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
techknowlogick 67b69110d1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Delete '.github/workflows/go.yml'
2020-08-24 23:19:38 +00:00
fixtures Add AppendDirectories option to render 2016-03-12 13:37:30 -05:00
.drone.yml update to 1.13, and add GOPROXY env var (#12) 2020-01-05 03:07:58 +00:00
.gitignore Expose some objects 2016-07-16 00:38:19 +08:00
context_test.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
context.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
go.mod Remove the init panic (#1) 2020-01-05 02:31:42 +00:00
go.sum Remove the init panic (#1) 2020-01-05 02:31:42 +00:00
LICENSE MISC: update LICENSE identifying info and README 2017-10-17 14:59:10 -04:00
logger_test.go Use github.com/unknwon/com (#10) 2019-08-21 20:23:02 +00:00
logger.go logger: show request method for complete 2017-02-19 15:49:11 -05:00
macaron_test.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
macaron.go Remove the init panic (#1) 2020-01-05 02:31:42 +00:00
macaronlogo.png Logo 2014-10-13 05:01:04 -04:00
README.md ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
recovery_test.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
recovery.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
render_test.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
render.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
response_writer_test.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
response_writer.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
return_handler_test.go integration FastInvoke Handler (#91) 2017-01-28 14:26:31 -05:00
return_handler.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
router_test.go ci: migrate from Travis to GitHub Actions (#189) 2020-08-24 19:11:57 -04:00
router.go router: support autoHead for ComboRouter 2018-03-06 01:20:08 -05:00
static_test.go Convert int to string using fmt.Sprintf (#205) 2020-08-24 19:14:05 -04:00
static.go Convert int to string using fmt.Sprintf (#205) 2020-08-24 19:14:05 -04:00
tree_test.go router: handle URLs with escaped characters (#149) 2017-11-23 19:02:59 -05:00
tree.go Use github.com/unknwon/com (#10) 2019-08-21 20:23:02 +00:00
util_go17.go router: handle URLs with escaped characters (#149) 2017-11-23 19:02:59 -05:00
util_go18.go router: handle URLs with escaped characters (#149) 2017-11-23 19:02:59 -05:00

Macaron

GitHub Workflow Status codecov GoDoc Sourcegraph

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.