2016-02-09 21:43:00 +02:00
|
|
|
// +build !appengine
|
|
|
|
|
2016-01-29 09:46:11 +02:00
|
|
|
package fasthttp
|
|
|
|
|
|
|
|
import "github.com/valyala/fasthttp"
|
|
|
|
|
|
|
|
type (
|
2016-03-15 04:58:46 +02:00
|
|
|
// URL implements `engine.URL`.
|
2016-01-29 09:46:11 +02:00
|
|
|
URL struct {
|
2016-03-10 22:05:33 +02:00
|
|
|
*fasthttp.URI
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2016-03-15 08:33:16 +02:00
|
|
|
// Path implements `engine.URL#Path` method.
|
2016-01-29 09:46:11 +02:00
|
|
|
func (u *URL) Path() string {
|
2016-03-10 22:05:33 +02:00
|
|
|
return string(u.URI.Path())
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
|
2016-03-15 08:33:16 +02:00
|
|
|
// SetPath implements `engine.URL#SetPath` method.
|
2016-03-15 04:58:46 +02:00
|
|
|
func (u *URL) SetPath(path string) {
|
2016-03-15 08:33:16 +02:00
|
|
|
u.URI.SetPath(path)
|
2016-03-15 04:58:46 +02:00
|
|
|
}
|
|
|
|
|
2016-03-15 08:33:16 +02:00
|
|
|
// QueryValue implements `engine.URL#QueryValue` method.
|
2016-01-29 09:46:11 +02:00
|
|
|
func (u *URL) QueryValue(name string) string {
|
2016-03-15 08:33:16 +02:00
|
|
|
return string(u.QueryArgs().Peek(name))
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
2016-02-21 00:04:09 +02:00
|
|
|
|
2016-03-10 22:05:33 +02:00
|
|
|
func (u *URL) reset(uri *fasthttp.URI) {
|
|
|
|
u.URI = uri
|
2016-02-22 05:58:19 +02:00
|
|
|
}
|