1
0
mirror of https://github.com/labstack/echo.git synced 2025-03-31 22:05:06 +02:00

Object method to Header and URL

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana 2016-02-20 14:04:09 -08:00
parent c8725ae244
commit 979d64941f
5 changed files with 22 additions and 0 deletions

View File

@ -48,6 +48,7 @@ type (
Del(string)
Get(string) string
Set(string, string)
Object() interface{}
}
URL interface {
@ -56,6 +57,7 @@ type (
Path() string
Host() string
QueryValue(string) string
Object() interface{}
}
Config struct {

View File

@ -30,6 +30,10 @@ func (h *RequestHeader) Set(key, val string) {
h.header.Set(key, val)
}
func (h *RequestHeader) Object() interface{} {
return h.header
}
func (h *ResponseHeader) Add(key, val string) {
// h.header.Add(key, val)
}
@ -45,3 +49,7 @@ func (h *ResponseHeader) Get(key string) string {
func (h *ResponseHeader) Set(key, val string) {
h.header.Set(key, val)
}
func (h *ResponseHeader) Object() interface{} {
return h.header
}

View File

@ -29,3 +29,7 @@ func (u *URL) Path() string {
func (u *URL) QueryValue(name string) string {
return ""
}
func (u *URL) Object() interface{} {
return u.url
}

View File

@ -24,6 +24,10 @@ func (h *Header) Set(key, val string) {
h.header.Set(key, val)
}
func (h *Header) Object() interface{} {
return h.header
}
func (h *Header) reset(hdr http.Header) {
h.header = hdr
}

View File

@ -36,6 +36,10 @@ func (u *URL) QueryValue(name string) string {
return u.query.Get(name)
}
func (u *URL) Object() interface{} {
return u.url
}
func (u *URL) reset(url *url.URL) {
u.url = url
}