matching

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2018 License: Apache-2.0 Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExactMatch added in v0.11.0

func ExactMatch(matchingString string, toMatch string) bool

func FirstMatchRequestMatcher added in v0.12.0

func FirstMatchRequestMatcher(req models.RequestDetails, webserver bool, simulation *models.Simulation, currentState map[string]string) (*models.RequestMatcherResponsePair, *models.MatchError, bool)

func GlobMatch added in v0.11.0

func GlobMatch(matchingString string, toMatch string) bool

func JsonMatch added in v0.11.0

func JsonMatch(matchingString string, toMatch string) bool

func JsonPathMatch added in v0.11.0

func JsonPathMatch(matchingString string, toMatch string) bool

func RegexMatch added in v0.11.0

func RegexMatch(matchingString string, toMatch string) bool

func StrongestMatchRequestMatcher added in v0.12.0

func StrongestMatchRequestMatcher(req models.RequestDetails, webserver bool, simulation *models.Simulation, state map[string]string) (requestMatch *models.RequestMatcherResponsePair, err *models.MatchError, cachable bool)

func XmlMatch added in v0.11.0

func XmlMatch(matchingString string, toMatch string) bool

func XpathMatch added in v0.11.0

func XpathMatch(matchingString string, toMatch string) bool

Types

type CacheMatcher added in v0.11.0

type CacheMatcher struct {
	RequestCache cache.Cache
	Webserver    bool
}

func (CacheMatcher) FlushCache added in v0.11.0

func (this CacheMatcher) FlushCache() error

func (CacheMatcher) GetAllResponses added in v0.11.0

func (this CacheMatcher) GetAllResponses() (v2.CacheView, error)

func (*CacheMatcher) GetCachedResponse added in v0.11.0

func (this *CacheMatcher) GetCachedResponse(req *models.RequestDetails) (*models.CachedResponse, *MatchingError)

getResponse returns stored response from cache

func (CacheMatcher) PreloadCache added in v0.11.0

func (this CacheMatcher) PreloadCache(simulation models.Simulation) error

func (*CacheMatcher) SaveRequestMatcherResponsePair added in v0.11.0

func (this *CacheMatcher) SaveRequestMatcherResponsePair(request models.RequestDetails, pair *models.RequestMatcherResponsePair, matchError *models.MatchError) error

TODO: This would be easier to reason about if we had two methods, "CacheHit" and "CacheHit" in order to reduce bloating

type FieldMatch added in v0.12.0

type FieldMatch struct {
	Matched    bool
	MatchScore int
}

func CountingHeaderMatcher added in v0.12.0

func CountingHeaderMatcher(requestMatcherHeaders, toMatch map[string][]string) *FieldMatch

func CountlessHeaderMatcher added in v0.12.0

func CountlessHeaderMatcher(requestMatcherHeaders, toMatch map[string][]string) *FieldMatch

func FieldMatchWithNoScore added in v0.12.0

func FieldMatchWithNoScore(matched bool) *FieldMatch

func ScoredFieldMatcher added in v0.12.0

func ScoredFieldMatcher(field *models.RequestFieldMatchers, toMatch string) *FieldMatch

func ScoredStateMatcher added in v0.14.0

func ScoredStateMatcher(currentState, requiredState map[string]string) *FieldMatch

func UnscoredFieldMatcher added in v0.12.0

func UnscoredFieldMatcher(field *models.RequestFieldMatchers, toMatch string) *FieldMatch

func UnscoredStateMatcher added in v0.14.0

func UnscoredStateMatcher(currentState, requiredState map[string]string) *FieldMatch

type MatchingError

type MatchingError struct {
	StatusCode  int
	Description string
}

func MissedError added in v0.12.0

func MissedError(miss *models.ClosestMiss) *MatchingError

func (MatchingError) Error

func (this MatchingError) Error() string

Jump to

Keyboard shortcuts

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