mirror of
https://github.com/labstack/echo.git
synced 2025-07-09 01:15:54 +02:00
Object method to Header and URL
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
@ -48,6 +48,7 @@ type (
|
|||||||
Del(string)
|
Del(string)
|
||||||
Get(string) string
|
Get(string) string
|
||||||
Set(string, string)
|
Set(string, string)
|
||||||
|
Object() interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
URL interface {
|
URL interface {
|
||||||
@ -56,6 +57,7 @@ type (
|
|||||||
Path() string
|
Path() string
|
||||||
Host() string
|
Host() string
|
||||||
QueryValue(string) string
|
QueryValue(string) string
|
||||||
|
Object() interface{}
|
||||||
}
|
}
|
||||||
|
|
||||||
Config struct {
|
Config struct {
|
||||||
|
@ -30,6 +30,10 @@ func (h *RequestHeader) Set(key, val string) {
|
|||||||
h.header.Set(key, val)
|
h.header.Set(key, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *RequestHeader) Object() interface{} {
|
||||||
|
return h.header
|
||||||
|
}
|
||||||
|
|
||||||
func (h *ResponseHeader) Add(key, val string) {
|
func (h *ResponseHeader) Add(key, val string) {
|
||||||
// h.header.Add(key, val)
|
// h.header.Add(key, val)
|
||||||
}
|
}
|
||||||
@ -45,3 +49,7 @@ func (h *ResponseHeader) Get(key string) string {
|
|||||||
func (h *ResponseHeader) Set(key, val string) {
|
func (h *ResponseHeader) Set(key, val string) {
|
||||||
h.header.Set(key, val)
|
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 {
|
func (u *URL) QueryValue(name string) string {
|
||||||
return ""
|
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)
|
h.header.Set(key, val)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h *Header) Object() interface{} {
|
||||||
|
return h.header
|
||||||
|
}
|
||||||
|
|
||||||
func (h *Header) reset(hdr http.Header) {
|
func (h *Header) reset(hdr http.Header) {
|
||||||
h.header = hdr
|
h.header = hdr
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,10 @@ func (u *URL) QueryValue(name string) string {
|
|||||||
return u.query.Get(name)
|
return u.query.Get(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (u *URL) Object() interface{} {
|
||||||
|
return u.url
|
||||||
|
}
|
||||||
|
|
||||||
func (u *URL) reset(url *url.URL) {
|
func (u *URL) reset(url *url.URL) {
|
||||||
u.url = url
|
u.url = url
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user