Documentation
¶
Index ¶
- func Die(w io.Writer, data ...interface{})
- func JustDie()
- func JustStop()
- func NewResponseWriter(w http.ResponseWriter) http.ResponseWriter
- func StatusCode(w http.ResponseWriter) (code int)
- func Stop(w io.Writer, data ...interface{})
- func StopE(err interface{}, fn ...func())
- func Write(w io.Writer, data ...interface{}) (n int, err error)
- func WriteCount(w http.ResponseWriter) int64
- func WritePretty(w io.Writer, data ...interface{}) (n int, err error)
- type ResponseWriter
- func (this *ResponseWriter) ClearData()
- func (this *ResponseWriter) Data(k interface{}) interface{}
- func (this *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (this *ResponseWriter) SetData(k interface{}, v interface{})
- func (this *ResponseWriter) StatusCode() int
- func (this *ResponseWriter) Write(b []byte) (n int, err error)
- func (this *ResponseWriter) WriteCount() int64
- func (this *ResponseWriter) WriteHeader(status int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewResponseWriter ¶
func NewResponseWriter(w http.ResponseWriter) http.ResponseWriter
func StatusCode ¶
func StatusCode(w http.ResponseWriter) (code int)
func StopE ¶
func StopE(err interface{}, fn ...func())
StopE will exit controller method if error is not nil. First argument is an error. Secondary argument is fail function, it be called if error is not nil. Third argument is success function, it be called if error is nil.
func WriteCount ¶
func WriteCount(w http.ResponseWriter) int64
Types ¶
type ResponseWriter ¶
type ResponseWriter struct {
http.ResponseWriter
// contains filtered or unexported fields
}
func (*ResponseWriter) ClearData ¶
func (this *ResponseWriter) ClearData()
func (*ResponseWriter) Data ¶
func (this *ResponseWriter) Data(k interface{}) interface{}
func (*ResponseWriter) Hijack ¶
func (this *ResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error)
func (*ResponseWriter) SetData ¶
func (this *ResponseWriter) SetData(k interface{}, v interface{})
func (*ResponseWriter) StatusCode ¶
func (this *ResponseWriter) StatusCode() int
func (*ResponseWriter) WriteCount ¶
func (this *ResponseWriter) WriteCount() int64
WriteCount acquires outgoing bytes count by writer
func (*ResponseWriter) WriteHeader ¶
func (this *ResponseWriter) WriteHeader(status int)
Click to show internal directories.
Click to hide internal directories.