matching

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheMatcher added in v0.11.0

type CacheMatcher struct {
	Webserver    bool
	RequestCache cache.FastCache
}

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, *errors.HoverflyError)

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) (*models.CachedResponse, 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
	Score   int
}

func BodyMatching added in v1.5.0

func BodyMatching(fields []models.RequestFieldMatchers, req models.RequestDetails) *FieldMatch

func FieldMatcher added in v0.11.0

func FieldMatcher(fields []models.RequestFieldMatchers, toMatch string) *FieldMatch

func HeaderMatching added in v0.17.0

func HeaderMatching(requestMatcher models.RequestMatcher, toMatch map[string][]string) *FieldMatch

func QueryMatching added in v0.17.0

func QueryMatching(requestMatcher models.RequestMatcher, toMatch map[string][]string) *FieldMatch

func StateMatcher added in v0.17.0

func StateMatcher(copyState map[string]string, requiredState map[string]string) *FieldMatch

type FirstMatchStrategy added in v0.17.0

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

func (*FirstMatchStrategy) Matching added in v0.17.0

func (s *FirstMatchStrategy) Matching(fieldMatch *FieldMatch, field string)

func (*FirstMatchStrategy) PostMatching added in v0.17.0

func (s *FirstMatchStrategy) PostMatching(req models.RequestDetails, requestMatcher models.RequestMatcher, matchingPair models.RequestMatcherResponsePair, state map[string]string) *MatchingResult

func (*FirstMatchStrategy) PreMatching added in v0.17.0

func (s *FirstMatchStrategy) PreMatching()

func (*FirstMatchStrategy) Result added in v0.17.0

func (s *FirstMatchStrategy) Result() *MatchingResult

type MatchingResult added in v0.17.0

type MatchingResult struct {
	Pair      *models.RequestMatcherResponsePair
	Error     *models.MatchError
	Cacheable bool
}

func Match added in v0.17.0

func Match(strongestMatch string, req models.RequestDetails, webserver bool, simulation *models.Simulation, state *state.State) *MatchingResult

func MatchingStrategyRunner added in v0.17.0

func MatchingStrategyRunner(req models.RequestDetails, webserver bool, simulation *models.Simulation, state *state.State, strategy MatchingStrategy) *MatchingResult

type MatchingStrategy added in v0.17.0

type MatchingStrategy interface {
	PreMatching()
	Matching(*FieldMatch, string)
	PostMatching(models.RequestDetails, models.RequestMatcher, models.RequestMatcherResponsePair, map[string]string) *MatchingResult
	Result() *MatchingResult
}

type StrongestMatchStrategy added in v0.17.0

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

func (*StrongestMatchStrategy) Matching added in v0.17.0

func (s *StrongestMatchStrategy) Matching(fieldMatch *FieldMatch, field string)

func (*StrongestMatchStrategy) PostMatching added in v0.17.0

func (s *StrongestMatchStrategy) PostMatching(req models.RequestDetails, requestMatcher models.RequestMatcher, matchingPair models.RequestMatcherResponsePair, state map[string]string) *MatchingResult

func (*StrongestMatchStrategy) PreMatching added in v0.17.0

func (s *StrongestMatchStrategy) PreMatching()

func (*StrongestMatchStrategy) Result added in v0.17.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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