Documentation
¶
Overview ¶
Package filtertest implements mock versions of the Filter, Spec and FilterContext interfaces used during tests.
Index ¶
- type Context
- func (fc *Context) BackendUrl() string
- func (fc *Context) MarkServed()
- func (fc *Context) Metrics() filters.Metrics
- func (fc *Context) OriginalRequest() *http.Request
- func (fc *Context) OriginalResponse() *http.Response
- func (fc *Context) OutgoingHost() string
- func (fc *Context) PathParam(key string) string
- func (fc *Context) Request() *http.Request
- func (fc *Context) Response() *http.Response
- func (fc *Context) ResponseWriter() http.ResponseWriter
- func (fc *Context) Serve(resp *http.Response)
- func (fc *Context) Served() bool
- func (fc *Context) SetOutgoingHost(h string)
- func (fc *Context) StateBag() map[string]interface{}
- func (fc *Context) Tracer() opentracing.Tracer
- type Filter
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { FResponseWriter http.ResponseWriter FRequest *http.Request FResponse *http.Response FServed bool FServedWithResponse bool FParams map[string]string FStateBag map[string]interface{} FBackendUrl string FOutgoingHost string FMetrics filters.Metrics FTracer opentracing.Tracer }
Simple FilterContext implementation.
func (*Context) BackendUrl ¶
func (*Context) MarkServed ¶
func (fc *Context) MarkServed()
func (*Context) OriginalRequest ¶
func (*Context) OriginalResponse ¶
func (*Context) OutgoingHost ¶
func (*Context) ResponseWriter ¶
func (fc *Context) ResponseWriter() http.ResponseWriter
func (*Context) SetOutgoingHost ¶
func (*Context) Tracer ¶ added in v0.9.89
func (fc *Context) Tracer() opentracing.Tracer
type Filter ¶
type Filter struct { FilterName string Args []interface{} }
Noop filter, used to verify the filter name and the args in the route. Implements both the Filter and the Spec interfaces.
func (*Filter) CreateFilter ¶
func (*Filter) Request ¶
func (f *Filter) Request(ctx filters.FilterContext)
func (*Filter) Response ¶
func (f *Filter) Response(ctx filters.FilterContext)
Click to show internal directories.
Click to hide internal directories.