Documentation ¶
Index ¶
- Constants
- type Context
- func (c *Context) Bind(out interface{}) error
- func (c *Context) Bytes(raw []byte, contentType string, code ...int)
- func (c *Context) Context() context.Context
- func (c *Context) Download(r *http.Request, path string, name string) error
- func (c *Context) Error(message string, code ...int)
- func (c *Context) File(r *http.Request, path string) error
- func (c *Context) HTML(html string, code ...int)
- func (c *Context) HeaderSet(key, value string)
- func (c *Context) JSON(i interface{}, code ...int)
- func (c *Context) JSONIndent(i interface{}, prefix string, indent string, code ...int)
- func (c *Context) JSONP(callback string, i interface{}, code ...int)
- func (c *Context) NoContent()
- func (c *Context) Output(out interface{})
- func (c *Context) Plain(s string, code ...int)
- func (c *Context) Request() *http.Request
- func (c *Context) String(raw string, contentType string, code ...int)
- func (c *Context) Writer() http.ResponseWriter
- func (c *Context) XML(i interface{}, code ...int)
- func (c *Context) XMLIndent(i interface{}, prefix string, indent string, code ...int)
- func (c *Context) YAML(i interface{}, code ...int)
- type HandlerFunc
- type Mux
Constants ¶
View Source
const ( HeaderContentDisposition = "Content-Disposition" HeaderContentType = "Content-Type" CharsetUTF8 = "charset=utf-8" // CharsetUTF8 utf8 character set ApplicationJSON = "application/json" ApplicationJSONCharsetUTF8 = ApplicationJSON + "; " + CharsetUTF8 ApplicationJavaScript = "application/javascript" ApplicationJavaScriptCharsetUTF8 = ApplicationJavaScript + "; " + CharsetUTF8 ApplicationXML = "application/xml" ApplicationXMLCharsetUTF8 = ApplicationXML + "; " + CharsetUTF8 ApplicationYAML = "application/yaml" ApplicationYAMLCharsetUTF8 = ApplicationYAML + "; " + CharsetUTF8 TextHTML = "text/html" TextHTMLCharsetUTF8 = TextHTML + "; " + CharsetUTF8 TextPlain = "text/plain" TextPlainCharsetUTF8 = TextPlain + "; " + CharsetUTF8 TextYAML = "text/yaml" TextYAMLCharsetUTF8 = TextYAML + "; " + CharsetUTF8 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) Download ¶
Download the client is prompted to save the file with provided `name`, name can be empty, in that case name of the file is used.
func (*Context) JSONIndent ¶
JSONIndent sends a JSON response with status code, but it applies prefix and indent to format the output.
func (*Context) JSONP ¶
JSONP sends a JSONP response with status code. It uses `callback` to construct the JSONP payload.
func (*Context) NoContent ¶
func (c *Context) NoContent()
NoContent sends a response with no body and a status code.
func (*Context) Writer ¶
func (c *Context) Writer() http.ResponseWriter
type HandlerFunc ¶
type HandlerFunc = func(ctx *Context)
Click to show internal directories.
Click to hide internal directories.