querystring

package
v2.0.0-beta.2+incompat... Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 24, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package querystring contains a modifier to rewrite query strings in a request.

Index

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 NewFilter

func NewFilter(name, value string) *Filter

NewFilter builds a querystring.Filter that filters on name and optionally value.

func (*Filter) ModifyRequest

func (f *Filter) ModifyRequest(req *http.Request) error

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

func (f *Filter) ModifyResponse(res *http.Response) error

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

func (f *Filter) VerifyRequests() error

VerifyRequests returns an error containing all the verification errors returned by request verifiers.

func (*Filter) VerifyResponses

func (f *Filter) VerifyResponses() error

VerifyResponses returns an error containing all the verification errors returned by response verifiers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL