querystring

package
v3.0.0-...-e766414 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 8 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 {
	*filter.Filter
}

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.

type Matcher

type Matcher struct {
	// contains filtered or unexported fields
}

Matcher is a conditonal evalutor of query string parameters to be used in structs that take conditions.

func NewMatcher

func NewMatcher(name, value string) *Matcher

NewMatcher builds a new querystring matcher

func (*Matcher) MatchRequest

func (m *Matcher) MatchRequest(req *http.Request) bool

MatchRequest evaluates a request and returns whether or not the request contains a querystring param that matches the provided name and value.

func (*Matcher) MatchResponse

func (m *Matcher) MatchResponse(res *http.Response) bool

MatchResponse evaluates a response and returns whether or not the request that resulted in that response contains a querystring param that matches the provided name and value.

Jump to

Keyboard shortcuts

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