Documentation ¶
Index ¶
- Variables
- func Wrap(h HandlerFunc) httprouter.Handle
- type Context
- type Filter
- type Filters
- type HandlerFunc
- type Response
- type Router
- func (r *Router) Bind(endpoints ...*swagger.Endpoint) error
- func (r *Router) DELETE(path string, h HandlerFunc)
- func (r *Router) GET(path string, h HandlerFunc)
- func (r *Router) Group(prefix string, filters ...Filter) *Router
- func (r *Router) HEAD(path string, h HandlerFunc)
- func (r *Router) Handle(method, path string, h HandlerFunc)
- func (r *Router) OPTION(path string, h HandlerFunc)
- func (r *Router) POST(path string, h HandlerFunc)
- func (r *Router) PUT(path string, h HandlerFunc)
- func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (r *Router) Use(filters ...Filter)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Ok = Response{Status: http.StatusOK} NotFound = Response{Status: http.StatusNotFound} Forbidden = Response{Status: http.StatusForbidden} BadRequest = Response{Status: http.StatusBadRequest} )
Functions ¶
func Wrap ¶
func Wrap(h HandlerFunc) httprouter.Handle
Types ¶
type Context ¶
type Context interface { Response() http.ResponseWriter Request() *http.Request WithRequest(req *http.Request) Context RouteValue(name string) string RouteKey(name string) types.Key RouteID(name string) types.ID Query(name string) string FormValue(name string) string Set(k string, v interface{}) Get(k string) interface{} JSON(status int, in interface{}) error XMLBlob(status int, in []byte) error Text(status int, in string) error HTML(status int, in string) error Redirect(status int, location string) error }
type Filter ¶
type Filter func(h HandlerFunc) HandlerFunc
func (Filter) Apply ¶
func (f Filter) Apply(h HandlerFunc) HandlerFunc
type Filters ¶
type Filters []Filter
func (Filters) Apply ¶
func (f Filters) Apply(h HandlerFunc) HandlerFunc
type HandlerFunc ¶
func WrapHandler ¶
func WrapHandler(h http.Handler) HandlerFunc
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) DELETE ¶
func (r *Router) DELETE(path string, h HandlerFunc)
func (*Router) GET ¶
func (r *Router) GET(path string, h HandlerFunc)
func (*Router) HEAD ¶
func (r *Router) HEAD(path string, h HandlerFunc)
func (*Router) Handle ¶
func (r *Router) Handle(method, path string, h HandlerFunc)
func (*Router) OPTION ¶
func (r *Router) OPTION(path string, h HandlerFunc)
func (*Router) POST ¶
func (r *Router) POST(path string, h HandlerFunc)
func (*Router) PUT ¶
func (r *Router) PUT(path string, h HandlerFunc)
Click to show internal directories.
Click to hide internal directories.