Documentation ¶
Index ¶
- Variables
- func CORS(h http.HandlerFunc, params ...interface{}) http.HandlerFunc
- type CorsParams
- type HandlerStruct
- func (h *HandlerStruct) Cookie(name string, description string) *HandlerStruct
- func (h *HandlerStruct) Doc(name string, description string) *HandlerStruct
- func (h *HandlerStruct) HandlerFunc(handlerFunc http.HandlerFunc) *HandlerStruct
- func (h *HandlerStruct) Header(name string, description string) *HandlerStruct
- func (h *HandlerStruct) Param(name string, paramType string, description string) *HandlerStruct
- func (h *HandlerStruct) Use(mfn middlewareFn, params ...interface{}) *HandlerStruct
- type MethodStruct
- type ParamStruct
- type RouteStruct
- type Router
- func (r *Router) Documentation(name string, description string) []byte
- func (*Router) Handler(handlerFunc ...http.HandlerFunc) *HandlerStruct
- func (*Router) Method(methodName string, handlerOrParam ...interface{}) *MethodStruct
- func (r *Router) Namespace(namespace string) *Router
- func (r *Router) Param(handlerOrParamName ...interface{}) *ParamStruct
- func (r *Router) Route(path string, handlerOrMethod ...interface{}) *RouteStruct
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) Use(mfn middlewareFn, params ...interface{}) *Router
Constants ¶
This section is empty.
Variables ¶
View Source
var Middlewares = struct { Logger middlewareFn BasicAuth middlewareFn CORS middlewareFn }{ Logger: logger, BasicAuth: basicAuth, CORS: CORS, }
Default Middlewares
Functions ¶
func CORS ¶
func CORS(h http.HandlerFunc, params ...interface{}) http.HandlerFunc
Types ¶
type CorsParams ¶
type HandlerStruct ¶
type HandlerStruct struct {
// contains filtered or unexported fields
}
func Handler ¶
func Handler(handlerFunc ...http.HandlerFunc) *HandlerStruct
func (*HandlerStruct) Cookie ¶
func (h *HandlerStruct) Cookie(name string, description string) *HandlerStruct
func (*HandlerStruct) Doc ¶
func (h *HandlerStruct) Doc(name string, description string) *HandlerStruct
func (*HandlerStruct) HandlerFunc ¶
func (h *HandlerStruct) HandlerFunc(handlerFunc http.HandlerFunc) *HandlerStruct
func (*HandlerStruct) Header ¶
func (h *HandlerStruct) Header(name string, description string) *HandlerStruct
func (*HandlerStruct) Param ¶
func (h *HandlerStruct) Param(name string, paramType string, description string) *HandlerStruct
func (*HandlerStruct) Use ¶
func (h *HandlerStruct) Use(mfn middlewareFn, params ...interface{}) *HandlerStruct
type MethodStruct ¶
type MethodStruct struct { MethodStruct string *HandlerStruct // contains filtered or unexported fields }
func (*MethodStruct) Use ¶
func (me *MethodStruct) Use(mfn middlewareFn, params ...interface{}) *MethodStruct
type ParamStruct ¶
type ParamStruct struct { *HandlerStruct // contains filtered or unexported fields }
func (*ParamStruct) Use ¶
func (p *ParamStruct) Use(mfn middlewareFn, params ...interface{}) *ParamStruct
type RouteStruct ¶
type RouteStruct struct { *HandlerStruct // contains filtered or unexported fields }
func (*RouteStruct) Use ¶
func (ro *RouteStruct) Use(mfn middlewareFn, params ...interface{}) *RouteStruct
type Router ¶
type Router struct { DefaultHandler http.HandlerFunc // default HandlerStruct CaseSensitive bool // contains filtered or unexported fields }
Router ...
func (*Router) Documentation ¶
func (*Router) Handler ¶
func (*Router) Handler(handlerFunc ...http.HandlerFunc) *HandlerStruct
func (*Router) Method ¶
func (*Router) Method(methodName string, handlerOrParam ...interface{}) *MethodStruct
func (*Router) Param ¶
func (r *Router) Param(handlerOrParamName ...interface{}) *ParamStruct
func (*Router) Route ¶
func (r *Router) Route(path string, handlerOrMethod ...interface{}) *RouteStruct
Add RouteStruct.
Click to show internal directories.
Click to hide internal directories.