Documentation ¶
Index ¶
- type CacheMatcher
- func (this CacheMatcher) FlushCache() error
- func (this CacheMatcher) GetAllResponses() (v2.CacheView, error)
- func (this *CacheMatcher) GetCachedResponse(req *models.RequestDetails) (*models.CachedResponse, *errors.HoverflyError)
- func (this CacheMatcher) PreloadCache(simulation models.Simulation) error
- func (this *CacheMatcher) SaveRequestMatcherResponsePair(request models.RequestDetails, pair *models.RequestMatcherResponsePair, ...) error
- type FieldMatch
- func FieldMatcher(fields []models.RequestFieldMatchers, toMatch string) *FieldMatch
- func HeaderMatching(requestMatcher models.RequestMatcher, toMatch map[string][]string) *FieldMatch
- func QueryMatching(requestMatcher models.RequestMatcher, toMatch map[string][]string) *FieldMatch
- func StateMatcher(currentState *state.State, requiredState map[string]string) *FieldMatch
- type FirstMatchStrategy
- func (s *FirstMatchStrategy) Matching(fieldMatch *FieldMatch, field string)
- func (s *FirstMatchStrategy) PostMatching(req models.RequestDetails, requestMatcher models.RequestMatcher, ...) *MatchingResult
- func (s *FirstMatchStrategy) PreMatching()
- func (s *FirstMatchStrategy) Result() *MatchingResult
- type MatchingResult
- type MatchingStrategy
- type StrongestMatchStrategy
- func (s *StrongestMatchStrategy) Matching(fieldMatch *FieldMatch, field string)
- func (s *StrongestMatchStrategy) PostMatching(req models.RequestDetails, requestMatcher models.RequestMatcher, ...) *MatchingResult
- func (s *StrongestMatchStrategy) PreMatching()
- func (s *StrongestMatchStrategy) Result() *MatchingResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheMatcher ¶ added in v0.11.0
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
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 (s *StrongestMatchStrategy) PostMatching(req models.RequestDetails, requestMatcher models.RequestMatcher, matchingPair models.RequestMatcherResponsePair, state *state.State) *MatchingResult
func (*StrongestMatchStrategy) PreMatching ¶ added in v0.17.0
func (s *StrongestMatchStrategy) PreMatching()
func (*StrongestMatchStrategy) Result ¶ added in v0.17.0
func (s *StrongestMatchStrategy) Result() *MatchingResult
Source Files ¶
Click to show internal directories.
Click to hide internal directories.