Documentation ¶
Index ¶
- func Contexter() macaron.Handler
- type Context
- func (c *Context) HTML(status int, name string)
- func (c *Context) Handle(status int, title string, err error)
- func (c *Context) HandleText(status int, title string)
- func (c *Context) JSONSuccess(data interface{})
- func (c *Context) NotFound()
- func (c *Context) NotFoundOrServerError(title string, errck func(error) bool, err error)
- func (c *Context) RawRedirect(location string, status ...int)
- func (c *Context) Redirect(location string, status ...int)
- func (c *Context) ServeEmbeddedContent(name string, contentType string, r io.ReadSeeker)
- func (c *Context) ServerError(title string, err error)
- func (c *Context) Success(name string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
func (*Context) HandleText ¶
func (*Context) JSONSuccess ¶
func (c *Context) JSONSuccess(data interface{})
JSONSuccess responses JSON with status http.StatusOK.
func (*Context) NotFoundOrServerError ¶
NotFoundOrServerError use error check function to determine if the error is about not found. It responses with 404 status code for not found error, or error context description for logging purpose of 500 server error.
func (*Context) RawRedirect ¶
RawRedirect simply calls underlying Redirect method with no escape.
func (*Context) Redirect ¶
Redirect responses redirection wtih given location and status. It escapes special characters in the location string.
func (*Context) ServeEmbeddedContent ¶
func (c *Context) ServeEmbeddedContent(name string, contentType string, r io.ReadSeeker)
func (*Context) ServerError ¶
ServerError renders the 500 page.
Click to show internal directories.
Click to hide internal directories.