Documentation ¶
Index ¶
- type Header
- type RequestInterceptor
- func AddRequest(headerpairs ...string) *RequestInterceptor
- func DeleteRequest(headers ...string) *RequestInterceptor
- func InterceptRequest(f func(http.Header)) *RequestInterceptor
- func MapRequest(header string, mapper func(string) string) *RequestInterceptor
- func SetRequest(headerpairs ...string) *RequestInterceptor
- type ResponseHeaderWriter
- type ResponseInterceptFunc
- type ResponseInterceptor
- func AddResponse(headerpairs ...string) *ResponseInterceptor
- func DeleteResponse(headers ...string) *ResponseInterceptor
- func InterceptResponse(f ResponseInterceptFunc) *ResponseInterceptor
- func MapResponse(header string, mapper func(string) string) *ResponseInterceptor
- func SetResponse(headerpairs ...string) *ResponseInterceptor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestInterceptor ¶
RequestInterceptor intercepts request's headers
func AddRequest ¶
func AddRequest(headerpairs ...string) *RequestInterceptor
AddRequest creates new request interceptor for add headers
func DeleteRequest ¶
func DeleteRequest(headers ...string) *RequestInterceptor
DeleteRequest creates new request interceptor for delete headers
func InterceptRequest ¶
func InterceptRequest(f func(http.Header)) *RequestInterceptor
InterceptRequest creates new request interceptor
func MapRequest ¶
func MapRequest(header string, mapper func(string) string) *RequestInterceptor
MapRequest creates new request interceptor for map a header
func SetRequest ¶
func SetRequest(headerpairs ...string) *RequestInterceptor
SetRequest creates new request interceptor for set headers
func (RequestInterceptor) ServeHandler ¶
func (m RequestInterceptor) ServeHandler(h http.Handler) http.Handler
ServeHandler implements middleware interface
type ResponseHeaderWriter ¶ added in v0.7.0
type ResponseHeaderWriter interface { StatusCode() int Header() http.Header WriteHeader(statusCode int) }
ResponseHeaderWriter type
type ResponseInterceptFunc ¶ added in v0.7.0
type ResponseInterceptFunc func(w ResponseHeaderWriter)
ResponseInterceptFunc is the function for response's interceptor
type ResponseInterceptor ¶
type ResponseInterceptor struct {
Intercept ResponseInterceptFunc
}
ResponseInterceptor intercepts response's headers
func AddResponse ¶
func AddResponse(headerpairs ...string) *ResponseInterceptor
AddResponse creates new response interceptor for add headers
func DeleteResponse ¶
func DeleteResponse(headers ...string) *ResponseInterceptor
DeleteResponse creates new response interceptor for delete headers
func InterceptResponse ¶
func InterceptResponse(f ResponseInterceptFunc) *ResponseInterceptor
InterceptResponse creates new response interceptor
func MapResponse ¶
func MapResponse(header string, mapper func(string) string) *ResponseInterceptor
MapResponse creates new response interceptor for map a header
func SetResponse ¶
func SetResponse(headerpairs ...string) *ResponseInterceptor
SetResponse creates new response interceptor for set headers
func (ResponseInterceptor) ServeHandler ¶
func (m ResponseInterceptor) ServeHandler(h http.Handler) http.Handler
ServeHandler implements middleware interface