2016-01-29 09:46:11 +02:00
|
|
|
package standard
|
|
|
|
|
|
|
|
import "net/url"
|
|
|
|
|
|
|
|
type (
|
|
|
|
URL struct {
|
|
|
|
url *url.URL
|
|
|
|
query url.Values
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func (u *URL) URL() *url.URL {
|
|
|
|
return u.url
|
|
|
|
}
|
|
|
|
|
|
|
|
func (u *URL) SetPath(path string) {
|
|
|
|
u.url.Path = path
|
|
|
|
}
|
|
|
|
|
|
|
|
func (u *URL) Path() string {
|
|
|
|
return u.url.Path
|
|
|
|
}
|
|
|
|
|
|
|
|
func (u *URL) QueryValue(name string) string {
|
|
|
|
if u.query == nil {
|
|
|
|
u.query = u.url.Query()
|
|
|
|
}
|
|
|
|
return u.query.Get(name)
|
|
|
|
}
|
2016-02-05 00:40:08 +02:00
|
|
|
|
2016-02-21 00:04:09 +02:00
|
|
|
func (u *URL) Object() interface{} {
|
|
|
|
return u.url
|
|
|
|
}
|
|
|
|
|
2016-02-05 00:40:08 +02:00
|
|
|
func (u *URL) reset(url *url.URL) {
|
|
|
|
u.url = url
|
|
|
|
}
|