mirror of
https://github.com/labstack/echo.git
synced 2025-01-26 03:20:08 +02:00
f405794a7c
Signed-off-by: Vishal Rana <vr@labstack.com>
42 lines
543 B
Go
42 lines
543 B
Go
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) Scheme() string {
|
|
return u.url.Scheme
|
|
}
|
|
|
|
func (u *URL) Host() string {
|
|
return u.url.Host
|
|
}
|
|
|
|
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)
|
|
}
|
|
|
|
func (u *URL) reset(url *url.URL) {
|
|
u.url = url
|
|
}
|