Documentation ¶
Index ¶
- type Context
- func (p *Context) AddHeader(name, value string)
- func (p *Context) DelHeader(name string)
- func (p *Context) Error(code int)
- func (p *Context) Form() url.Values
- func (p *Context) FormFile(key string) (multipart.File, *multipart.FileHeader, error)
- func (p *Context) FormValue(name string) string
- func (p *Context) GetBody() ([]byte, error)
- func (p *Context) GetHeader(name string) string
- func (p *Context) NotFound()
- func (p *Context) PostForm() url.Values
- func (p *Context) Query() url.Values
- func (p *Context) ReadForm(data interface{}) error
- func (p *Context) ReadHTML() (string, error)
- func (p *Context) ReadJSON(v interface{}) error
- func (p *Context) ReadQuery(data interface{}) error
- func (p *Context) ReadText() (string, error)
- func (p *Context) ReadXML(v interface{}) error
- func (p *Context) ServeFile(name string)
- func (p *Context) SetHeader(name, value string)
- func (p *Context) UnmarshalBody(v interface{}, unmarshaler UnmarshalerFunc) error
- func (p *Context) UploadFile(key string, createFile func(string) io.WriteCloser) error
- func (p *Context) Write(data []byte) (n int, err error)
- func (p *Context) WriteDataJSON(data []byte) error
- func (p *Context) WriteDataXML(data []byte) error
- func (p *Context) WriteHTML(data string) error
- func (p *Context) WriteHeader(statusCode int, h http.Header)
- func (p *Context) WriteJSON(v interface{}) error
- func (p *Context) WriteString(str string) error
- func (p *Context) WriteText(data string) error
- func (p *Context) WriteXML(v interface{}) error
- type UnmarshalerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { W http.ResponseWriter R *http.Request MaxMem int64 //upload file memory size }
func NewContext ¶
func NewContext(w http.ResponseWriter, r *http.Request) *Context
func (*Context) Error ¶ added in v0.2.0
code should be status code in http package, example: http.StatusContinue
func (*Context) ReadForm ¶ added in v0.1.1
ReadForm binds the formObject with the form data it supports any kind of type, including custom structs. It will return nothing if request data are empty. The struct field tag is "form".
func (*Context) ReadQuery ¶
ReadQuery binds the "ptr" with the url query string. The struct field tag is "url".
func (*Context) UnmarshalBody ¶ added in v0.1.3
func (p *Context) UnmarshalBody(v interface{}, unmarshaler UnmarshalerFunc) error
func (*Context) UploadFile ¶ added in v0.3.0
func (*Context) WriteDataJSON ¶ added in v0.1.4
func (*Context) WriteDataXML ¶ added in v0.1.4
func (*Context) WriteHeader ¶
h may be nil
func (*Context) WriteString ¶
type UnmarshalerFunc ¶ added in v0.1.3
Click to show internal directories.
Click to hide internal directories.