1
0
mirror of https://github.com/labstack/echo.git synced 2024-11-24 08:22:21 +02:00
echo/engine/standard/url.go

38 lines
489 B
Go
Raw Normal View History

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)
}
func (u *URL) Object() interface{} {
return u.url
}
func (u *URL) reset(url *url.URL) {
u.url = url
}