Documentation
¶
Index ¶
- func SetURLVars(r *http.Request, vars map[string]string) *http.Request
- func Vars(r *http.Request) map[string]string
- type ReqRoute
- func (t *ReqRoute) GetHandler() http.Handler
- func (t *ReqRoute) GetMethods() *[]string
- func (t *ReqRoute) GetPath() string
- func (t *ReqRoute) GetPathVarsCount() int
- func (t *ReqRoute) GetPrefix() string
- func (t *ReqRoute) GetVarNames() *[]string
- func (t *ReqRoute) Handler(handler http.Handler) Route
- func (t *ReqRoute) HandlerFunc(f func(http.ResponseWriter, *http.Request)) Route
- func (t *ReqRoute) IsActive() bool
- func (t *ReqRoute) IsMethodAllowed(m string) bool
- func (t *ReqRoute) IsPathVarsUsed() bool
- func (t *ReqRoute) Methods(ms ...string) Route
- func (t *ReqRoute) New() Route
- func (t *ReqRoute) Path(p string) Route
- func (t *ReqRoute) PathPrefix(px string) Route
- type ReqRouter
- func (t *ReqRouter) CORSAllowCredentials()
- func (t *ReqRouter) EnableCORS()
- func (t *ReqRouter) Handle(path string, handler http.Handler) Route
- func (t *ReqRouter) HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) Route
- func (t *ReqRouter) NewRoute() Route
- func (t *ReqRouter) PathPrefix(px string) Route
- func (t *ReqRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (t *ReqRouter) SetCorsAllowedHeaders(hdr string)
- func (t *ReqRouter) SetCorsAllowedMethods(mths string)
- func (t *ReqRouter) SetCorsAllowedOrigins(org string)
- type Route
- type Router
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetURLVars ¶ added in v0.0.7
SetURLVars SetURLVars
Types ¶
type ReqRoute ¶
type ReqRoute struct {
// contains filtered or unexported fields
}
ReqRoute ReqRoute
func (*ReqRoute) GetPathVarsCount ¶
GetPathVarsCount GetPathVarsCount
func (*ReqRoute) HandlerFunc ¶
HandlerFunc HandlerFunc
func (*ReqRoute) IsMethodAllowed ¶
IsMethodAllowed IsMethodAllowed
func (*ReqRoute) IsPathVarsUsed ¶
IsPathVarsUsed IsPathVarsUsed
type ReqRouter ¶
type ReqRouter struct {
// contains filtered or unexported fields
}
ReqRouter RequestRouter
func (*ReqRouter) CORSAllowCredentials ¶ added in v0.0.6
func (t *ReqRouter) CORSAllowCredentials()
CORSAllowCredentials CORSAllowCredentials
func (*ReqRouter) HandleFunc ¶
HandleFunc HandleFunc
func (*ReqRouter) PathPrefix ¶
PathPrefix PathPrefix
func (*ReqRouter) ServeHTTP ¶
func (t *ReqRouter) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP ServeHTTP dispatches the handler registered in the matched route.
func (*ReqRouter) SetCorsAllowedHeaders ¶ added in v0.0.2
SetCorsAllowedHeaders SetAllowedHeaders
func (*ReqRouter) SetCorsAllowedMethods ¶ added in v0.0.2
SetCorsAllowedMethods AllowedMethods
func (*ReqRouter) SetCorsAllowedOrigins ¶ added in v0.0.2
SetCorsAllowedOrigins AllowedOrigins
type Route ¶
type Route interface {
Handler(handler http.Handler) Route
HandlerFunc(f func(http.ResponseWriter, *http.Request)) Route
Path(p string) Route
PathPrefix(p string) Route
GetHandler() http.Handler
GetPath() string
GetPrefix() string
GetVarNames() *[]string
IsActive() bool
Methods(ms ...string) Route
GetMethods() *[]string
IsMethodAllowed(m string) bool
IsPathVarsUsed() bool
GetPathVarsCount() int
}
Route Route
type Router ¶
type Router interface {
ServeHTTP(w http.ResponseWriter, r *http.Request)
Handle(path string, handler http.Handler) Route
HandleFunc(path string, f func(http.ResponseWriter, *http.Request)) Route
PathPrefix(path string) Route
NewRoute() Route
//CORS methods
EnableCORS()
CORSAllowCredentials()
SetCorsAllowedHeaders(headers string)
SetCorsAllowedOrigins(origins string)
SetCorsAllowedMethods(methods string)
}
Router Router
Click to show internal directories.
Click to hide internal directories.