Micro & pluggable web framework for Go
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
Lunny Xiao af459469e0 Add more tests about any (#64) pirms 1 mēnesi
public fix static compitable when prefix is / pirms 2 gadiem
.drone.yml new format drone (#60) pirms 3 mēnešiem
.gitignore Safe parse form and remove unnecessary parse on query (#63) pirms 2 mēnešiem
LICENSE license & small optimization pirms 4 gadiem
README.md fix README (#59) pirms 5 mēnešiem
README_CN.md remove unused file and correct README pirms 3 mēnešiem
RELEASE.md docs pirms 4 gadiem
compress.go lint fixed pirms 2 gadiem
compress_test.go license & small optimization pirms 4 gadiem
context.go add SetRequest for Context (#53) pirms 7 mēnešiem
context_test.go new format drone (#60) pirms 3 mēnešiem
cookie.go update cookie (#44) pirms 2 gadiem
cookie_test.go lint fixed pirms 2 gadiem
doc.go update README (#56) pirms 6 mēnešiem
error.go Add query functions and upgrade circleci to 2 (#51) pirms 10 mēnešiem
error_test.go license & small optimization pirms 4 gadiem
file.go Add Content to serve a file from http.FileSystem (#62) pirms 3 mēnešiem
file_test.go Add Content to serve a file from http.FileSystem (#62) pirms 3 mēnešiem
form.go Safe parse form and remove unnecessary parse on query (#63) pirms 2 mēnešiem
form_test.go Add FormTrimmed (#61) pirms 3 mēnešiem
go.mod use new package name (#55) pirms 6 mēnešiem
go.sum change log location pirms 8 mēnešiem
group.go add handlers support on group method (#54) pirms 6 mēnešiem
group_test.go add handlers support on group method (#54) pirms 6 mēnešiem
handler_test.go bug fixed for second group pirms 1 gada
logger.go change log location pirms 8 mēnešiem
logger_test.go change log location pirms 8 mēnešiem
logo.png add logo pirms 5 gadiem
param.go lint fixed pirms 2 gadiem
param_test.go added IsAjax and RemoteAddr for context, gofmt pirms 4 gadiem
pool.go pool size support disabled when is zero pirms 1 gada
pool_test.go license & small optimization pirms 4 gadiem
prefix.go lint fixed pirms 2 gadiem
prefix_test.go license & small optimization pirms 4 gadiem
query.go Safe parse form and remove unnecessary parse on query (#63) pirms 2 mēnešiem
query_test.go Add query functions and upgrade circleci to 2 (#51) pirms 10 mēnešiem
recovery.go lint fixed pirms 2 gadiem
recovery_test.go license & small optimization pirms 4 gadiem
response.go some docs & small improvements pirms 4 gadiem
return.go add errorwithcode interface pirms 2 gadiem
return_test.go add more tests (#58) pirms 6 mēnešiem
router.go lint fixed pirms 2 gadiem
router_test.go Add more tests about any (#64) pirms 1 mēnesi
static.go fix bug pirms 1 gada
static_test.go fix static compitable when prefix is / pirms 2 gadiem
tan.go Merge branch 'master' of https://github.com/lunny/tango pirms 1 gada
tan_test.go license & small optimization pirms 4 gadiem

README.md

Tango 简体中文

Build Status

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 gitea.com/lunny/tango

A classic usage of Tango below:

package main

import (
    "errors"

    "gitea.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.