Created
November 15, 2013 15:16
-
-
Save oleiade/7485917 to your computer and use it in GitHub Desktop.
Routes mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package api | |
import ( | |
"github.com/codegangsta/martini" | |
) | |
type HandlersMap map[string]func(args...interface{})string | |
type RoutesMapping map[string]HandlersMap | |
var routes = &RoutesMap{ | |
"/jobs": &HandlersMap{ | |
"GET": JobsList, | |
"POST": JobsPost, | |
}, | |
"/jobs/:name/": &HandlersMap{ | |
"GET": JobsGet, | |
"PUT": JobsPut, | |
"DELETE": JobsDelete, | |
}, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment