Documentation ¶
Index ¶
- Constants
- type Request
- type Response
- func (r *Response) ClearBuffer()
- func (r *Response) Output()
- func (r *Response) Write(content ...interface{})
- func (r *Response) WriteStatus(status int, content ...interface{})
- func (r *Response) WriteStatusExit(status int, content ...interface{})
- func (r *Response) WriteXml(content interface{}, rootTag ...string) error
- type ResponseData
- type ResponseWriter
- func (w *ResponseWriter) Flush()
- func (w *ResponseWriter) Header() http.Header
- func (w *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w *ResponseWriter) RawWriter() http.ResponseWriter
- func (w *ResponseWriter) Write(data []byte) (int, error)
- func (w *ResponseWriter) WriteHeader(status int)
Constants ¶
const (
EXCEPTION_EXIT = "exit"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
Request struct
type Response ¶
type Response struct { *ResponseWriter Writer *ResponseWriter }
Response
func (*Response) ClearBuffer ¶
func (r *Response) ClearBuffer()
ClearBuffer clears the response buffer.
func (*Response) Output ¶
func (r *Response) Output()
Output outputs the buffer content to the client and clears the buffer.
func (*Response) Write ¶
func (r *Response) Write(content ...interface{})
Write writes <content> to the response buffer.
func (*Response) WriteStatus ¶
Note that do not set Content-Type header here.
func (*Response) WriteStatusExit ¶
type ResponseData ¶
ResponseData 针对微信接口返回json格式数据设置,errcode errmsg
func (*ResponseData) HaveError ¶
func (r *ResponseData) HaveError() bool
Ok 当返回errcode=0, errmsg="ok" 时为true errcode != 0 时为false
type ResponseWriter ¶
type ResponseWriter struct { Status int // HTTP status. // contains filtered or unexported fields }
ResponseWriter is the custom writer for http response.
func (*ResponseWriter) Flush ¶
func (w *ResponseWriter) Flush()
OutputBuffer outputs the buffer to client and clears the buffer.
func (*ResponseWriter) Header ¶
func (w *ResponseWriter) Header() http.Header
Header implements the interface function of http.ResponseWriter.Header.
func (*ResponseWriter) Hijack ¶
func (w *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack implements the interface function of http.Hijacker.Hijack.
func (*ResponseWriter) RawWriter ¶
func (w *ResponseWriter) RawWriter() http.ResponseWriter
RawWriter returns the underlying ResponseWriter.
func (*ResponseWriter) Write ¶
func (w *ResponseWriter) Write(data []byte) (int, error)
Write implements the interface function of http.ResponseWriter.Write.
func (*ResponseWriter) WriteHeader ¶
func (w *ResponseWriter) WriteHeader(status int)
WriteHeader implements the interface of http.ResponseWriter.WriteHeader.