A query param auto mapping middleware for tango
This repository has been archived on 2019-03-21. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
cnphpbb 7595072dc5 Update README.md 2015-05-20 11:48:58 +08:00
bind_test.go add test and readme 2014-12-25 10:58:12 +08:00
bind.go updated 2015-04-05 21:12:45 +08:00
README.md Update README.md 2015-05-20 11:48:58 +08:00

Bind Build Status

** HEAVILLY DEVELOPMENT ** Bind is a query param auto mapping middleware for Tango. Please use binding

Installation

go get github.com/tango-contrib/bind

Simple Example

package main

import (
    "github.com/lunny/tango"
    "github.com/tango-contrib/bind"
)

type BindExample struct {
    Id   int64
    Name string
}

func (a *BindExample) Get() string {
    return fmt.Sprintf("%d-%s", a.Id, a.Name)
}

func main() {
    o := tango.Classic()
    o.Use(bind.Default())
    o.Get("/", new(BindExample))
}

Getting Help