matching

package
v0.17.6 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

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 {
	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, *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) 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 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(currentState *state.State, 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 *state.State) *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
	Cachable 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, *state.State) *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 (*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