Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionFunc ¶
type ActionFunc func( session sessionModel.Session, ) ( responseObject interface{}, responseError error, )
ActionFunc defines the action function to be called for route processing logic
type MiddlewareFunc ¶
type MiddlewareFunc mux.MiddlewareFunc
MiddlewareFunc warps around mux.MiddlewareFunc, which receives an http.Handler and returns another http.Handler. Typically, the returned handler is a closure which does something with the http.ResponseWriter and http.Request passed to it, and then calls the handler passed as parameter to the MiddlewareFunc.
type ParameterType ¶
type ParameterType string
ParameterType defines the type specification of a route parameter
const ( ParameterTypeAnything ParameterType = `.*` ParameterTypeString ParameterType = `\w+` ParameterTypeInteger ParameterType = `\d+` ParameterTypeUUID ParameterType = `[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}` ParameterTypeDate ParameterType = `\d{4}-\d{2}-\d{2}` ParameterTypeTime ParameterType = `\d{2}:\d{2}:\d{2}(?:\.\d+)?` ParameterTypeDateTime ParameterType = ParameterTypeDate + `T` + ParameterTypeTime + `(?:Z|[+-]\d{2}:\d{2})` ParameterTypeBoolean ParameterType = `(?i)(?:true|false)` ParameterTypeFloat ParameterType = `\d+(?:\.\d+)?` )
These are constants for parameter types and their corresponding replacement RegExp statements
type Route ¶
type Route struct { Endpoint string Method string Path string Parameters map[string]ParameterType Queries map[string]ParameterType ActionFunc ActionFunc }
Route holds the registration information of a dynamic route hosting
Click to show internal directories.
Click to hide internal directories.