Documentation ¶
Index ¶
- func MakeDynamicValuesCallback(input map[string][]string, iterateAllValues bool, ...)
- type ExtractFunc
- type MatchFunc
- type Operators
- func (operators *Operators) Compile() error
- func (operators *Operators) Execute(data map[string]interface{}, match MatchFunc, extract ExtractFunc, ...) (*Result, bool)
- func (operators *Operators) ExecuteInternalExtractors(data map[string]interface{}, extract ExtractFunc) map[string]interface{}
- func (operators *Operators) GetMatchersCondition() matchers.ConditionType
- func (operators *Operators) IsEmpty() bool
- func (operators *Operators) Len() int
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MakeDynamicValuesCallback ¶
func MakeDynamicValuesCallback(input map[string][]string, iterateAllValues bool, callback func(map[string]interface{}) bool)
MakeDynamicValuesCallback takes an input dynamic values map and calls the callback function with all variations of the data in input in form of map[string]string (interface{}).
Types ¶
type ExtractFunc ¶
type ExtractFunc func(data map[string]interface{}, matcher *extractors.Extractor) map[string]struct{}
ExtractFunc performs extracting operation for an extractor on model and returns true or false.
type MatchFunc ¶
MatchFunc performs matching operation for a matcher on model and returns true or false.
type Operators ¶
type Operators struct { // description: | // Matchers contains the detection mechanism for the request to identify // whether the request was successful by doing pattern matching // on request/responses. // // Multiple matchers can be combined with `matcher-condition` flag // which accepts either `and` or `or` as argument. Matchers []*matchers.Matcher `` /* 203-byte string literal not displayed */ // description: | // Extractors contains the extraction mechanism for the request to identify // and extract parts of the response. Extractors []*extractors.Extractor `` /* 223-byte string literal not displayed */ // description: | // MatchersCondition is the condition between the matchers. Default is OR. // values: // - "and" // - "or" MatchersCondition string `` /* 182-byte string literal not displayed */ // TemplateID is the ID of the template for matcher TemplateID string `json:"-" yaml:"-" jsonschema:"-"` // ExcludeMatchers is a list of excludeMatchers items ExcludeMatchers *excludematchers.ExcludeMatchers `json:"-" yaml:"-" jsonschema:"-"` // contains filtered or unexported fields }
Operators contains the operators that can be applied on protocols
func (*Operators) Compile ¶
Compile compiles the operators as well as their corresponding matchers and extractors
func (*Operators) Execute ¶
func (operators *Operators) Execute(data map[string]interface{}, match MatchFunc, extract ExtractFunc, isDebug bool) (*Result, bool)
Execute executes the operators on data and returns a result structure
func (*Operators) ExecuteInternalExtractors ¶
func (operators *Operators) ExecuteInternalExtractors(data map[string]interface{}, extract ExtractFunc) map[string]interface{}
ExecuteInternalExtractors executes internal dynamic extractors
func (*Operators) GetMatchersCondition ¶
func (operators *Operators) GetMatchersCondition() matchers.ConditionType
GetMatchersCondition returns the condition for the matchers
type Result ¶
type Result struct { // Matched is true if any matchers matched Matched bool // Extracted is true if any result type values were extracted Extracted bool // Matches is a map of matcher names that we matched Matches map[string][]string // Extracts contains all the data extracted from inputs Extracts map[string][]string // OutputExtracts is the list of extracts to be displayed on screen. OutputExtracts []string // DynamicValues contains any dynamic values to be templated DynamicValues map[string][]string // PayloadValues contains payload values provided by user. (Optional) PayloadValues map[string]interface{} // Optional lineCounts for file protocol LineCount string // contains filtered or unexported fields }
Result is a result structure created from operators running on data.
func (*Result) HasExtract ¶
Directories ¶
Path | Synopsis |
---|---|
common
|
|
Package extractors implements extractors for http response data retrieval.
|
Package extractors implements extractors for http response data retrieval. |
Package matchers implements matchers for http response matching with templates.
|
Package matchers implements matchers for http response matching with templates. |