Macaron

Go的高生产力和模块化网络框架。(A high productive and modular web framework in Go.)

Github星跟蹤圖

Macaron 是一个具有高生产力和模块化设计的 Go Web 框架。框架秉承了 Martini 的基本思想,并在此基础上做出高级扩展。

Macaron 主要特性
  • 支持子路由的强大路由设计
  • 支持灵活多变的路由组合
  • 支持无限路由组的无限嵌套
  • 支持直接集成现有的服务
  • 支持运行时动态设置需要渲染的模板集
  • 支持使用内存文件作为静态资源和模板文件
  • 支持对模块的轻松接入与解除
  • 采用 inject 提供的便利的依赖注入
  • 采用更好的路由层和更少的反射来提升执行速度

概覽

名稱與所有者go-macaron/macaron
主編程語言Go
編程語言Go (語言數: 2)
平台
許可證Apache License 2.0
發布數31
最新版本名稱v1.5.0 (發布於 )
第一版名稱v1 (發布於 )
創建於2014-07-10 03:13:30
推送於2024-04-08 13:40:31
最后一次提交
星數3.5k
關注者數143
派生數286
提交數273
已啟用問題?
問題數166
打開的問題數6
拉請求數56
打開的拉請求數0
關閉的拉請求數17
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?

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

去到頂部