package main import ( "net/http" "rate-it-api/controllers" ) // Route struct defining Route type type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc } // Routes collection of Route type Routes []Route var routes = Routes{ Route{ "Index", "GET", "/", controllers.Index, }, Route{ "AuthToken", "POST", "/auth", controllers.AuthToken, }, Route{ "UserCreate", "POST", "/user", controllers.UserCreate, }, Route{ "UserValidate", "GET", "/user/validation/{uuid}", controllers.UserValidate, }, } // routesJwt routes protected by a JSON Web Token Authentification var routesJwt = Routes{ Route{ "TodoIndex", "GET", "/todos", controllers.TodoIndex, }, Route{ "TodoShow", "GET", "/todos/{todoId}", controllers.TodoShow, }, }