mirror of
https://github.com/labstack/echo.git
synced 2025-12-07 23:12:43 +02:00
40
engine/fasthttp/response.go
Normal file
40
engine/fasthttp/response.go
Normal file
@@ -0,0 +1,40 @@
|
||||
package fasthttp
|
||||
|
||||
import (
|
||||
"github.com/labstack/echo/engine"
|
||||
"github.com/valyala/fasthttp"
|
||||
)
|
||||
|
||||
type (
|
||||
Response struct {
|
||||
context *fasthttp.RequestCtx
|
||||
header engine.Header
|
||||
status int
|
||||
size int64
|
||||
committed bool
|
||||
}
|
||||
)
|
||||
|
||||
func (r *Response) Header() engine.Header {
|
||||
return r.header
|
||||
}
|
||||
|
||||
func (r *Response) WriteHeader(code int) {
|
||||
r.context.SetStatusCode(code)
|
||||
}
|
||||
|
||||
func (r *Response) Write(b []byte) (int, error) {
|
||||
return r.context.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
|
||||
}
|
||||
Reference in New Issue
Block a user