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:
parent
c8725ae244
commit
979d64941f
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user