2016-01-29 09:46:11 +02:00
|
|
|
package standard
|
|
|
|
|
|
|
|
import "net/http"
|
|
|
|
|
|
|
|
type (
|
2016-03-15 04:58:46 +02:00
|
|
|
// Header implements `engine.Header`.
|
2016-01-29 09:46:11 +02:00
|
|
|
Header struct {
|
2016-03-10 22:05:33 +02:00
|
|
|
http.Header
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2016-03-20 00:47:20 +02:00
|
|
|
// Add implements `engine.Header#Add` function.
|
2016-01-29 09:46:11 +02:00
|
|
|
func (h *Header) Add(key, val string) {
|
2016-03-10 22:05:33 +02:00
|
|
|
h.Header.Add(key, val)
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
|
2016-03-20 00:47:20 +02:00
|
|
|
// Del implements `engine.Header#Del` function.
|
2016-01-29 09:46:11 +02:00
|
|
|
func (h *Header) Del(key string) {
|
2016-03-10 22:05:33 +02:00
|
|
|
h.Header.Del(key)
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|
|
|
|
|
2016-03-20 00:47:20 +02:00
|
|
|
// Set implements `engine.Header#Set` function.
|
2016-01-29 09:46:11 +02:00
|
|
|
func (h *Header) Set(key, val string) {
|
2016-03-10 22:05:33 +02:00
|
|
|
h.Header.Set(key, val)
|
2016-02-21 00:04:09 +02:00
|
|
|
}
|
|
|
|
|
2016-03-20 00:47:20 +02:00
|
|
|
// Get implements `engine.Header#Get` function.
|
2016-03-15 04:58:46 +02:00
|
|
|
func (h *Header) Get(key string) string {
|
|
|
|
return h.Header.Get(key)
|
|
|
|
}
|
|
|
|
|
2016-03-20 00:47:20 +02:00
|
|
|
// Keys implements `engine.Header#Keys` function.
|
2016-03-17 01:27:31 +02:00
|
|
|
func (h *Header) Keys() (keys []string) {
|
|
|
|
keys = make([]string, len(h.Header))
|
|
|
|
i := 0
|
|
|
|
for k := range h.Header {
|
|
|
|
keys[i] = k
|
|
|
|
i++
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-02-05 00:40:08 +02:00
|
|
|
func (h *Header) reset(hdr http.Header) {
|
2016-03-10 22:05:33 +02:00
|
|
|
h.Header = hdr
|
2016-01-29 09:46:11 +02:00
|
|
|
}
|