Documentation ¶
Index ¶
- Constants
- func ReadJSON(req *http.Request, v interface{}) error
- func ReadXML(req *http.Request, v interface{}) error
- func ServeFormatted(w http.ResponseWriter, req *http.Request, v interface{})
- func ServeJSON(w http.ResponseWriter, v interface{})
- func ServeXML(w http.ResponseWriter, v interface{})
- type Router
- func (r *Router) AddRoute(method string, pattern string, handler http.HandlerFunc)
- func (r *Router) Del(pattern string, handler http.HandlerFunc)
- func (r *Router) Filter(filter http.HandlerFunc)
- func (r *Router) FilterParam(param string, filter http.HandlerFunc)
- func (r *Router) Get(pattern string, handler http.HandlerFunc)
- func (r *Router) Patch(pattern string, handler http.HandlerFunc)
- func (r *Router) Post(pattern string, handler http.HandlerFunc)
- func (r *Router) Put(pattern string, handler http.HandlerFunc)
- func (r *Router) ServeHTTP(rw http.ResponseWriter, req *http.Request)
- func (r *Router) Static(pattern string, dir string)
Constants ¶
View Source
const ( CONNECT = "CONNECT" DELETE = "DELETE" GET = "GET" HEAD = "HEAD" OPTIONS = "OPTIONS" PATCH = "PATCH" POST = "POST" PUT = "PUT" TRACE = "TRACE" )
HTTP 1.1 Methods
Variables ¶
This section is empty.
Functions ¶
func ReadJSON ¶
ReadJSON parses JSON in the http.Request pointer stores the result in the value pointed to by v
func ServeFormatted ¶
func ServeFormatted(w http.ResponseWriter, req *http.Request, v interface{})
ServeFormatted parses req and serves as format specified in the Accept header
func ServeJSON ¶
func ServeJSON(w http.ResponseWriter, v interface{})
func ServeXML ¶
func ServeXML(w http.ResponseWriter, v interface{})
ServeXML serves req with XML repr of v
Types ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) AddRoute ¶
func (r *Router) AddRoute(method string, pattern string, handler http.HandlerFunc)
func (*Router) Filter ¶
func (r *Router) Filter(filter http.HandlerFunc)
func (*Router) FilterParam ¶
func (r *Router) FilterParam(param string, filter http.HandlerFunc)
func (*Router) Get ¶
func (r *Router) Get(pattern string, handler http.HandlerFunc)
Request-URI method implementations
Click to show internal directories.
Click to hide internal directories.