tango

Micro & pluggable web framework for Go

Github星跟蹤圖

Tango 简体中文

CircleCI codecov

Join the chat at https://img.shields.io/discord/323705316027924491.svg

Tango Logo

Package tango is a micro & pluggable web framework for Go.

Current version: v0.5.0 Version History

Getting Started

To install Tango:

go get github.com/lunny/tango

A classic usage of Tango below:

package main

import (
    "errors"
    "github.com/lunny/tango"
)

type Action struct {
    tango.JSON
}

func (Action) Get() interface{} {
    if true {
        return map[string]string{
            "say": "Hello tango!",
        }
    }
    return errors.New("something error")
}

func main() {
    t := tango.Classic()
    t.Get("/", new(Action))
    t.Run()
}

Then visit http://localhost:8000 on your browser. You will get

{"say":"Hello tango!"}

If you change true after if to false, then you will get

{"err":"something error"}

This code will automatically convert returned map or error to a json because we has an embedded struct tango.JSON.

Features

  • Powerful routing & Flexible routes combinations.
  • Directly integrate with existing services.
  • Easy to plugin features with modular design.
  • High performance dependency injection embedded.

Middlewares

Middlewares allow you easily plugin features for your Tango applications.

There are already many middlewares to simplify your work:

Documentation

Discuss

Cases

License

This project is under BSD License. See the LICENSE file for the full license text.

主要指標

概覽
名稱與所有者lunny/tango
主編程語言Go
編程語言HTML (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2014-12-17 03:07:09
推送於2019-05-17 03:31:14
最后一次提交2019-05-17 11:31:10
發布數16
最新版本名稱v0.5.6 (發布於 )
第一版名稱v0.1 (發布於 )
用户参与
星數827
關注者數72
派生數109
提交數237
已啟用問題?
問題數38
打開的問題數8
拉請求數13
打開的拉請求數1
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?