Documentation
¶
Index ¶
- func NotFoundHandler(c *Context) (err error)
- type Context
- func (c *Context) AddHeader(key, value string)
- func (c *Context) Attachment(file, name string) error
- func (c *Context) Blob(code int, contentType string, b []byte) (err error)
- func (c *Context) Cookie(name string) (*http.Cookie, error)
- func (c *Context) Cookies() []*http.Cookie
- func (c *Context) Error(code int, msg string) (err error)
- func (c *Context) File(file string) (err error)
- func (c *Context) FormFile(name string) (*multipart.FileHeader, error)
- func (c *Context) FormParams() (url.Values, error)
- func (c *Context) FormValue(name string) string
- func (c *Context) Header(name string) string
- func (c *Context) Inline(file, name string) error
- func (c *Context) JSON(code int, i interface{}) error
- func (c *Context) JSONBlob(code int, b []byte) (err error)
- func (c *Context) JSONPretty(code int, i interface{}, indent string) (err error)
- func (c *Context) MultipartForm() (*multipart.Form, error)
- func (c *Context) Param(name string) string
- func (c *Context) QueryParam(name string) string
- func (c *Context) QueryParams() url.Values
- func (c *Context) QueryString() string
- func (c *Context) ReadJSON(res interface{}) (code int, err error)
- func (c *Context) Redirect(code int, url string) error
- func (c *Context) Request() *http.Request
- func (c *Context) Response() http.ResponseWriter
- func (c *Context) SetCookie(cookie *http.Cookie)
- func (c *Context) SetHeader(key, value string)
- func (c *Context) Stream(code int, contentType string, r io.Reader) (err error)
- func (c *Context) String(code int, s string) error
- type ContextHandlerFunc
- type HttpHelper
- func (hr *HttpHelper) CONNECT(path string, h func(c *Context)) error
- func (hr *HttpHelper) Connect(path string, h func(http.ResponseWriter, *http.Request)) error
- func (hr *HttpHelper) DELETE(path string, h func(c *Context)) error
- func (hr *HttpHelper) Delete(path string, h func(http.ResponseWriter, *http.Request)) error
- func (hr *HttpHelper) GET(pattern string, h func(c *Context)) error
- func (hr *HttpHelper) Get(pattern string, h func(http.ResponseWriter, *http.Request)) error
- func (hr *HttpHelper) HEAD(path string, h func(c *Context)) error
- func (hr *HttpHelper) Head(path string, h func(http.ResponseWriter, *http.Request)) error
- func (hr *HttpHelper) NotFoundHandler(h http.Handler)
- func (hr *HttpHelper) OPTIONS(path string, h func(c *Context)) error
- func (hr *HttpHelper) Options(path string, h func(http.ResponseWriter, *http.Request)) error
- func (hr *HttpHelper) PATCH(path string, h func(c *Context)) error
- func (hr *HttpHelper) POST(path string, h func(c *Context)) error
- func (hr *HttpHelper) PUT(path string, h func(c *Context)) error
- func (hr *HttpHelper) Patch(path string, h func(http.ResponseWriter, *http.Request)) error
- func (hr *HttpHelper) Post(path string, h func(http.ResponseWriter, *http.Request)) error
- func (hr *HttpHelper) Put(path string, h func(http.ResponseWriter, *http.Request)) error
- func (h *HttpHelper) Run(addr ...string)
- func (h *HttpHelper) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (hr *HttpHelper) TRACE(path string, h func(c *Context)) error
- func (hr *HttpHelper) Trace(path string, h func(http.ResponseWriter, *http.Request)) error
- func (h *HttpHelper) Use(handler negroni.Handler)
- func (h *HttpHelper) UseHandler(handler http.Handler)
- func (h *HttpHelper) UseHandlerFunc(handlerFunc http.HandlerFunc)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NotFoundHandler ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func NewHttpContext ¶
func NewHttpContext(w http.ResponseWriter, r *http.Request) *Context
func (*Context) Attachment ¶
func (*Context) JSONPretty ¶
func (*Context) QueryParam ¶
func (*Context) QueryParams ¶
func (*Context) QueryString ¶
func (*Context) Response ¶
func (c *Context) Response() http.ResponseWriter
type ContextHandlerFunc ¶
type ContextHandlerFunc func(c *Context)
type HttpHelper ¶
type HttpHelper struct {
// contains filtered or unexported fields
}
func NewHelper ¶
func NewHelper() *HttpHelper
func (*HttpHelper) Connect ¶
func (hr *HttpHelper) Connect(path string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) Delete ¶
func (hr *HttpHelper) Delete(path string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) Get ¶
func (hr *HttpHelper) Get(pattern string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) Head ¶
func (hr *HttpHelper) Head(path string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) NotFoundHandler ¶
func (hr *HttpHelper) NotFoundHandler(h http.Handler)
func (*HttpHelper) Options ¶
func (hr *HttpHelper) Options(path string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) Patch ¶
func (hr *HttpHelper) Patch(path string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) Post ¶
func (hr *HttpHelper) Post(path string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) Put ¶
func (hr *HttpHelper) Put(path string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) Run ¶
func (h *HttpHelper) Run(addr ...string)
func (*HttpHelper) ServeHTTP ¶
func (h *HttpHelper) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*HttpHelper) Trace ¶
func (hr *HttpHelper) Trace(path string, h func(http.ResponseWriter, *http.Request)) error
func (*HttpHelper) Use ¶
func (h *HttpHelper) Use(handler negroni.Handler)
func (*HttpHelper) UseHandler ¶
func (h *HttpHelper) UseHandler(handler http.Handler)
func (*HttpHelper) UseHandlerFunc ¶
func (h *HttpHelper) UseHandlerFunc(handlerFunc http.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.