1
0
mirror of https://github.com/labstack/echo.git synced 2025-01-10 00:28:23 +02:00
echo/engine/fasthttp/response.go
Vishal Rana 0731959a98 Object method to get real object
Signed-off-by: Vishal Rana <vr@labstack.com>
2016-02-08 16:48:03 -08:00

56 lines
841 B
Go

package fasthttp
import (
"io"
"github.com/labstack/echo/engine"
"github.com/valyala/fasthttp"
)
type (
Response struct {
response *fasthttp.RequestCtx
header engine.Header
status int
size int64
committed bool
writer io.Writer
}
)
func (r *Response) Object() interface{} {
return r.response
}
func (r *Response) Header() engine.Header {
return r.header
}
func (r *Response) WriteHeader(code int) {
r.response.SetStatusCode(code)
}
func (r *Response) Write(b []byte) (int, error) {
return r.response.Write(b)
}
func (r *Response) Status() int {
return r.status
}
func (r *Response) Size() int64 {
return r.size
}
func (r *Response) Committed() bool {
return r.committed
}
func (r *Response) SetWriter(w io.Writer) {
r.writer = w
}
func (r *Response) Writer() io.Writer {
return r.writer
}