Documentation ¶
Index ¶
- Variables
- type ConditionType
- type Matcher
- type MatcherType
- type MatcherTypeHolder
- func (holder MatcherTypeHolder) JSONSchemaType() *jsonschema.Type
- func (holder MatcherTypeHolder) MarshalJSON() ([]byte, error)
- func (holder MatcherTypeHolder) MarshalYAML() (interface{}, error)
- func (t MatcherTypeHolder) String() string
- func (holder *MatcherTypeHolder) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ConditionTypes = map[string]ConditionType{ "and": ANDCondition, "or": ORCondition, }
View Source
var MatcherTypes = map[MatcherType]string{ StatusMatcher: "status", SizeMatcher: "size", WordsMatcher: "word", RegexMatcher: "regex", BinaryMatcher: "binary", DSLMatcher: "dsl", }
MatcherTypes is a table for conversion of matcher type from string.
Functions ¶
This section is empty.
Types ¶
type ConditionType ¶
type ConditionType int
ConditionType is the type of condition for matcher
const ( // ANDCondition matches responses with AND condition in arguments. ANDCondition ConditionType = iota + 1 // ORCondition matches responses with AND condition in arguments. ORCondition )
type Matcher ¶
type Matcher struct { Name string `json:"name,omitempty"` Type MatcherTypeHolder `yaml:"type" json:"type"` Words []string `yaml:"words" json:"words,omitempty"` Part string `yaml:"part" json:"part,omitempty"` Regex []string `yaml:"regex" json:"regex,omitempty"` Encoding string `yaml:"encoding" json:"encoding,omitempty"` MatchAll bool `yaml:"matchAll" json:"match_all,omitempty"` Condition string `yaml:"condition" json:"condition,omitempty"` Group int `yaml:"group"` // description: | // Status are the acceptable status codes for the response. // examples: // - value: > // []int{200, 302} Status []int `` /* 127-byte string literal not displayed */ HasExtra bool // contains filtered or unexported fields }
func (*Matcher) CompileMatchers ¶
CompileMatchers performs the initial setup operation on a matcher
func (*Matcher) GetType ¶
func (matcher *Matcher) GetType() MatcherType
GetType returns the type of the matcher
func (*Matcher) MatchRegex ¶
MatchRegex matches a regex check against a corpus
func (*Matcher) MatchStatusCode ¶
MatchStatusCode matches a status code check against a corpus
type MatcherType ¶
type MatcherType int
MatcherType is the type of the matcher specified
const ( // name:word WordsMatcher MatcherType = iota + 1 // name:regex RegexMatcher // name:binary BinaryMatcher // name:status StatusMatcher // name:size SizeMatcher // name:dsl DSLMatcher )
name:MatcherType
func GetSupportedMatcherTypes ¶
func GetSupportedMatcherTypes() []MatcherType
GetSupportedMatcherTypes returns list of supported types
func (MatcherType) String ¶
func (t MatcherType) String() string
type MatcherTypeHolder ¶
type MatcherTypeHolder struct {
MatcherType MatcherType `mapping:"true"`
}
MatcherTypeHolder is used to hold internal type of the matcher
func (MatcherTypeHolder) JSONSchemaType ¶
func (holder MatcherTypeHolder) JSONSchemaType() *jsonschema.Type
func (MatcherTypeHolder) MarshalJSON ¶
func (holder MatcherTypeHolder) MarshalJSON() ([]byte, error)
func (MatcherTypeHolder) MarshalYAML ¶
func (holder MatcherTypeHolder) MarshalYAML() (interface{}, error)
func (MatcherTypeHolder) String ¶
func (t MatcherTypeHolder) String() string
func (*MatcherTypeHolder) UnmarshalYAML ¶
func (holder *MatcherTypeHolder) UnmarshalYAML(unmarshal func(interface{}) error) error
Click to show internal directories.
Click to hide internal directories.