1
1
mirror of https://github.com/go-gitea/gitea synced 2024-11-17 07:34:25 +00:00
gitea/vendor/gitea.com/macaron/macaron
techknowlogick c5d5d63c9c
Macaron 1.5 (#12596)
* update macaron to v1.5 of fork

* update macaron to v1.5 of fork

* test gzip PR

* add push method impl to context_tests

* use proper gzip commit

Co-authored-by: zeripath <art27@cantab.net>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2020-08-27 22:47:17 -04:00
..
.drone.yml Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
.gitignore Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
context.go Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
go.mod update gitea.com/macaron/macaron to 1.4.0 (#9608) 2020-01-05 15:27:25 +01:00
go.sum update gitea.com/macaron/macaron to 1.4.0 (#9608) 2020-01-05 15:27:25 +01:00
LICENSE Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
logger.go Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
macaron.go update gitea.com/macaron/macaron to 1.4.0 (#9608) 2020-01-05 15:27:25 +01:00
macaronlogo.png Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
README.md Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
recovery.go Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
render.go Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
response_writer.go Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
return_handler.go Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
router.go Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
static.go Macaron 1.5 (#12596) 2020-08-27 22:47:17 -04:00
tree.go Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
util_go17.go Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04:00
util_go18.go Use gitea forked macaron (#7933) 2019-08-23 12:40:29 -04: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.