2016-02-09 11:43:00 -08:00
|
|
|
// +build !appengine
|
|
|
|
|
2016-01-28 23:46:11 -08:00
|
|
|
package fasthttp
|
|
|
|
|
|
|
|
import "github.com/valyala/fasthttp"
|
|
|
|
|
|
|
|
type (
|
|
|
|
RequestHeader struct {
|
2016-02-08 22:17:20 -08:00
|
|
|
header fasthttp.RequestHeader
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
ResponseHeader struct {
|
2016-02-08 22:17:20 -08:00
|
|
|
header fasthttp.ResponseHeader
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
|
|
|
func (h *RequestHeader) Add(key, val string) {
|
|
|
|
// h.RequestHeader.Add(key, val)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (h *RequestHeader) Del(key string) {
|
2016-02-08 22:17:20 -08:00
|
|
|
h.header.Del(key)
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (h *RequestHeader) Get(key string) string {
|
2016-02-10 16:51:43 -08:00
|
|
|
return string(h.header.Peek(key))
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (h *RequestHeader) Set(key, val string) {
|
2016-02-08 22:17:20 -08:00
|
|
|
h.header.Set(key, val)
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
|
|
|
|
2016-02-20 14:04:09 -08:00
|
|
|
func (h *RequestHeader) Object() interface{} {
|
|
|
|
return h.header
|
|
|
|
}
|
|
|
|
|
2016-02-21 19:58:19 -08:00
|
|
|
func (h *RequestHeader) reset(hdr fasthttp.RequestHeader) {
|
|
|
|
h.header = hdr
|
|
|
|
}
|
|
|
|
|
2016-01-28 23:46:11 -08:00
|
|
|
func (h *ResponseHeader) Add(key, val string) {
|
2016-02-08 22:17:20 -08:00
|
|
|
// h.header.Add(key, val)
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (h *ResponseHeader) Del(key string) {
|
2016-02-08 22:17:20 -08:00
|
|
|
h.header.Del(key)
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (h *ResponseHeader) Get(key string) string {
|
2016-02-10 16:51:43 -08:00
|
|
|
return string(h.header.Peek(key))
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
func (h *ResponseHeader) Set(key, val string) {
|
2016-02-08 22:17:20 -08:00
|
|
|
h.header.Set(key, val)
|
2016-01-28 23:46:11 -08:00
|
|
|
}
|
2016-02-20 14:04:09 -08:00
|
|
|
|
|
|
|
func (h *ResponseHeader) Object() interface{} {
|
|
|
|
return h.header
|
|
|
|
}
|
2016-02-21 19:58:19 -08:00
|
|
|
|
|
|
|
func (h *ResponseHeader) reset(hdr fasthttp.ResponseHeader) {
|
|
|
|
h.header = hdr
|
|
|
|
}
|