Documentation ¶
Overview ¶
Package querystring contains a modifier to rewrite query strings in a request.
Index ¶
- func NewModifier(key, value string) martian.RequestModifier
- func NewVerifier(key, value string) (verify.RequestVerifier, error)
- type Filter
- func (f *Filter) ModifyRequest(req *http.Request) error
- func (f *Filter) ModifyResponse(res *http.Response) error
- func (f *Filter) ResetRequestVerifications()
- func (f *Filter) ResetResponseVerifications()
- func (f *Filter) SetRequestModifier(reqmod martian.RequestModifier)
- func (f *Filter) SetResponseModifier(resmod martian.ResponseModifier)
- func (f *Filter) VerifyRequests() error
- func (f *Filter) VerifyResponses() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewModifier ¶
func NewModifier(key, value string) martian.RequestModifier
NewModifier returns a request modifier that will set the query string at key with the given value. If the query string key already exists all values will be overwritten.
func NewVerifier ¶
func NewVerifier(key, value string) (verify.RequestVerifier, error)
NewVerifier returns a new param verifier.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter runs modifiers iff the request query parameter for name matches value.
func (*Filter) ModifyRequest ¶
ModifyRequest applies the request modifier if the filter name and values match the request query parameters. In the case of an empty value, the modifier is applied whenever any parameter matches name, regardless of its value.
func (*Filter) ModifyResponse ¶
ModifyResponse applies the response modifier if the filter name and values match the request query parameters. In the case of an empty value, the modifier is applied whenever any parameter matches name, regardless of its value.
func (*Filter) ResetRequestVerifications ¶
func (f *Filter) ResetRequestVerifications()
ResetRequestVerifications resets the state of the contained request verifiers.
func (*Filter) ResetResponseVerifications ¶
func (f *Filter) ResetResponseVerifications()
ResetResponseVerifications resets the state of the contained response verifiers.
func (*Filter) SetRequestModifier ¶
func (f *Filter) SetRequestModifier(reqmod martian.RequestModifier)
SetRequestModifier sets the request modifier for filter.
func (*Filter) SetResponseModifier ¶
func (f *Filter) SetResponseModifier(resmod martian.ResponseModifier)
SetResponseModifier sets the response modifier for filter.
func (*Filter) VerifyRequests ¶
VerifyRequests returns an error containing all the verification errors returned by request verifiers.
func (*Filter) VerifyResponses ¶
VerifyResponses returns an error containing all the verification errors returned by response verifiers.