macaron

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

Subscribe to updates I use macaron


Statistics on macaron

Number of watchers on Github 2263
Number of open issues 17
Average time to close an issue 27 days
Main language Go
Average time to merge a PR 4 days
Open pull requests 4+
Closed pull requests 8+
Last commit 7 months ago
Repo Created about 4 years ago
Repo Last Updated 6 months ago
Size 404 KB
Homepage https://go-macaro...
Organization / Authorgo-macaron
Contributors7
Page Updated
Do you use macaron? Leave a review!
View open issues (17)
View macaron activity
View on github
Latest Open Source Launches
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating macaron for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

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.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
  • 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.

macaron open issues Ask a question     (View All Issues)
  • almost 2 years Value not found for type *context.Context
  • about 2 years 平滑升级需求
  • about 2 years No Content-Length in ctx.ServeFile method
  • over 2 years 这两个模板引擎速度更快,无闻你看看能不能搞成中间件~
  • over 2 years PANIC: reflect: call of reflect.Value.Interface on zero Value
  • over 2 years Implement HTTP HEAD method correctly
  • over 2 years 能否增加支持兼容其它路由处理机制的功能
  • almost 3 years jwt contrib add
  • about 3 years 类似sessionauth的东西
  • about 3 years 能否增加SSE支持
  • over 3 years Hope for Swagger support
  • over 3 years Generators
  • almost 4 years Able to register routes with a route table(file)
  • almost 4 years 建议增加一个支付宝或财付通或者神马微信支付的中间件
macaron open pull requests (View All Pulls)
  • integration FastInvoke Handler
  • Add Content-Length in ServeFile when Content-Encoding is not null
  • Add ETag header to staticHandler
  • https support
macaron list of languages used
Other projects in Go