2016-01-29 09:46:11 +02:00
|
|
|
package fasthttp
|
|
|
|
|
|
|
|
import "io"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/labstack/echo/engine"
|
|
|
|
"github.com/valyala/fasthttp"
|
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
Request struct {
|
2016-02-09 02:48:03 +02:00
|
|
|
request *fasthttp.RequestCtx
|
2016-01-29 09:46:11 +02:00
|
|
|
url engine.URL
|
|
|
|
header engine.Header
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2016-02-09 02:48:03 +02:00
|
|
|
func (r *Request) Object() interface{} {
|
|
|
|
return r.request
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
|
2016-02-09 02:48:03 +02:00
|
|
|
func (r *Request) URI() string {
|
|
|
|
return string(r.request.RequestURI())
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
|
2016-02-09 02:48:03 +02:00
|
|
|
func (r *Request) URL() engine.URL {
|
|
|
|
return r.url
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
|
2016-02-09 02:48:03 +02:00
|
|
|
func (r *Request) Header() engine.Header {
|
|
|
|
return r.header
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
|
2016-02-09 02:48:03 +02:00
|
|
|
func (r *Request) RemoteAddress() string {
|
|
|
|
return r.request.RemoteAddr().String()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *Request) Method() string {
|
|
|
|
return string(r.request.Method())
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *Request) Body() io.ReadCloser {
|
|
|
|
// return r.context.PostBody()
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *Request) FormValue(name string) string {
|
|
|
|
return ""
|
|
|
|
}
|