Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Operator ¶
type Operator struct {
// contains filtered or unexported fields
}
Operator is en enum over types of StringMatcher
func (Operator) MarshalJSON ¶
MarshalJSON implements json.Marshaler interface
func (*Operator) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler interface
type StringMatcher ¶
type StringMatcher struct { Operator Operator `json:"operator"` Value string `json:"value"` // contains filtered or unexported fields }
StringMatcher matches a string based on an operator and a value
func Contains ¶
func Contains(value string) *StringMatcher
Contains constructs a new StringMatcher that matches using the Contains operator
func Full ¶
func Full(value string) *StringMatcher
Full constructs a new StringMatcher that matches using the Full operator
func Prefix ¶
func Prefix(value string) *StringMatcher
Prefix constructs a new StringMatcher that matches using the Prefix operator
func Regex ¶
func Regex(value string) *StringMatcher
Regex constructs a new StringMatcher that matches using the Regex operator
func Suffix ¶
func Suffix(value string) *StringMatcher
Suffix constructs a new StringMatcher that matches using the Suffix operator
func (*StringMatcher) Match ¶
func (m *StringMatcher) Match(value string) error
Match attempts to match a string based on the StringMatcher
func (*StringMatcher) UnmarshalJSON ¶
func (m *StringMatcher) UnmarshalJSON(b []byte) error
Unmarshal implements json.Unmarshaler