Documentation ¶
Index ¶
Constants ¶
View Source
const ( VERSION = "v1" TASKS_PREFIX = "/" + VERSION + "/tasks" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EndpointsInfo ¶
type EndpointsInfo struct {
Endpoints []HandlerInfo
}
var Routes *EndpointsInfo = &EndpointsInfo{ Endpoints: []HandlerInfo{ { Regexp: regexp.MustCompile("^" + TASKS_PREFIX + "$"), NeedJSONHandler: true, Handlers: MethodHandlers{ "GET": handlers.ListTasksHandler, "POST": handlers.CreateTaskHandler, }, }, { Regexp: regexp.MustCompile("^/ping$"), NeedJSONHandler: false, Handlers: MethodHandlers{ "GET": handlers.PingHandler, }, }, { Regexp: regexp.MustCompile("^/"), NeedJSONHandler: false, Handlers: MethodHandlers{ "GET": handlers.EmptyHandler, }, }, }, }
type HandlerInfo ¶
type HandlerInfo struct { Regexp *regexp.Regexp Handlers MethodHandlers NeedJSONHandler bool }
type MethodHandlers ¶
Click to show internal directories.
Click to hide internal directories.