2016-01-29 09:46:11 +02:00
|
|
|
package standard
|
|
|
|
|
|
|
|
import "net/url"
|
|
|
|
|
|
|
|
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
|
|
|
*url.URL
|
2016-01-29 09:46:11 +02:00
|
|
|
query url.Values
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
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 u.URL.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) {
|
|
|
|
u.URL.Path = path
|
|
|
|
}
|
|
|
|
|
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 {
|
|
|
|
if u.query == nil {
|
2016-03-10 22:05:33 +02:00
|
|
|
u.query = u.Query()
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
return u.query.Get(name)
|
|
|
|
}
|
2016-02-05 00:40:08 +02:00
|
|
|
|
|
|
|
func (u *URL) reset(url *url.URL) {
|
2016-03-10 22:05:33 +02:00
|
|
|
u.URL = url
|
2016-02-05 00:40:08 +02:00
|
|
|
}
|