Documentation ¶
Index ¶
- Variables
- func MatcherTypeSliceContains(enums []MatcherType, sunEnums ...MatcherType) bool
- func MatcherTypeSliceContainsAny(enums []MatcherType, sunEnums ...MatcherType) bool
- func ModeTypeSliceContains(enums []ModeType, sunEnums ...ModeType) bool
- func ModeTypeSliceContainsAny(enums []ModeType, sunEnums ...ModeType) bool
- type Config
- type Filter
- type Matcher
- type MatcherType
- func (i MatcherType) MarshalBinary() (data []byte, err error)
- func (i MatcherType) MarshalJSON() ([]byte, error)
- func (i MatcherType) MarshalText() ([]byte, error)
- func (i MatcherType) MarshalYAML() (interface{}, error)
- func (i MatcherType) New() *MatcherType
- func (i MatcherType) Registered() bool
- func (i MatcherType) String() string
- func (i *MatcherType) UnmarshalBinary(data []byte) error
- func (i *MatcherType) UnmarshalJSON(data []byte) error
- func (i *MatcherType) UnmarshalText(text []byte) error
- func (i *MatcherType) UnmarshalYAML(unmarshal func(interface{}) error) error
- type ModeType
- func (i ModeType) MarshalBinary() (data []byte, err error)
- func (i ModeType) MarshalJSON() ([]byte, error)
- func (i ModeType) MarshalText() ([]byte, error)
- func (i ModeType) MarshalYAML() (interface{}, error)
- func (i ModeType) New() *ModeType
- func (i ModeType) Registered() bool
- func (i ModeType) String() string
- func (i *ModeType) UnmarshalBinary(data []byte) error
- func (i *ModeType) UnmarshalJSON(data []byte) error
- func (i *ModeType) UnmarshalText(text []byte) error
- func (i *ModeType) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = Config{ Mode: ModeAllow, Matcher: MatcherRegex, Pattern: `^.*$`, ExactArrayMatch: pointer.Bool(true), }
Functions ¶
func MatcherTypeSliceContains ¶
func MatcherTypeSliceContains(enums []MatcherType, sunEnums ...MatcherType) bool
MatcherTypeSliceContains reports whether sunEnums is within enums.
func MatcherTypeSliceContainsAny ¶
func MatcherTypeSliceContainsAny(enums []MatcherType, sunEnums ...MatcherType) bool
MatcherTypeSliceContainsAny reports whether any sunEnum is within enums.
func ModeTypeSliceContains ¶
ModeTypeSliceContains reports whether sunEnums is within enums.
func ModeTypeSliceContainsAny ¶
ModeTypeSliceContainsAny reports whether any sunEnum is within enums.
Types ¶
type Config ¶
type Config struct { Mode ModeType `json:"mode,omitempty"` Matcher MatcherType `json:"matcher,omitempty"` Pattern interface{} `json:"pattern,omitempty"` Patterns []interface{} `json:"patterns,omitempty"` PatternsLogic string `json:"patternsLogic,omitempty"` // AND, OR Path string `json:"path,omitempty"` // path to match pattern against, if omitted uses payload as default ExactArrayMatch *bool `json:"exactArrayMatch,omitempty"` Comparison *comparison.Comparison `json:"comparison,omitempty"` }
Config can be passed into NewFilter() in order to configure the behavior of the sender.
func (Config) WithDefaults ¶
type MatcherType ¶
type MatcherType int
const ( MatcherUnknown MatcherType = iota // unknown MatcherRegex // regex MatcherPattern // pattern MatcherPatternRegex // patternregex MatcherComparison // comparison )
func MatcherTypeValues ¶
func MatcherTypeValues() []MatcherType
MatcherTypeValues returns all values of the enum
func ParseMatcherTypeString ¶
func ParseMatcherTypeString(s string) (MatcherType, error)
ParseMatcherTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (MatcherType) MarshalBinary ¶
func (i MatcherType) MarshalBinary() (data []byte, err error)
MarshalBinary implements the encoding.BinaryMarshaler interface for MatcherType
func (MatcherType) MarshalJSON ¶
func (i MatcherType) MarshalJSON() ([]byte, error)
MarshalJSON implements the json.Marshaler interface for MatcherType
func (MatcherType) MarshalText ¶
func (i MatcherType) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface for MatcherType
func (MatcherType) MarshalYAML ¶
func (i MatcherType) MarshalYAML() (interface{}, error)
MarshalYAML implements a YAML Marshaler for MatcherType
func (MatcherType) New ¶
func (i MatcherType) New() *MatcherType
New returns a pointer to a new addr filled with the MatcherType value passed in.
func (MatcherType) Registered ¶
func (i MatcherType) Registered() bool
IsAMatcherType returns "true" if the value is listed in the enum definition. "false" otherwise
func (MatcherType) String ¶
func (i MatcherType) String() string
func (*MatcherType) UnmarshalBinary ¶
func (i *MatcherType) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for MatcherType
func (*MatcherType) UnmarshalJSON ¶
func (i *MatcherType) UnmarshalJSON(data []byte) error
UnmarshalJSON implements the json.Unmarshaler interface for MatcherType
func (*MatcherType) UnmarshalText ¶
func (i *MatcherType) UnmarshalText(text []byte) error
UnmarshalText implements the encoding.TextUnmarshaler interface for MatcherType
func (*MatcherType) UnmarshalYAML ¶
func (i *MatcherType) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements a YAML Unmarshaler for MatcherType
type ModeType ¶
type ModeType int
func ModeTypeValues ¶
func ModeTypeValues() []ModeType
ModeTypeValues returns all values of the enum
func ParseModeTypeString ¶
ParseModeTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (ModeType) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface for ModeType
func (ModeType) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface for ModeType
func (ModeType) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for ModeType
func (ModeType) MarshalYAML ¶
MarshalYAML implements a YAML Marshaler for ModeType
func (ModeType) Registered ¶
IsAModeType returns "true" if the value is listed in the enum definition. "false" otherwise
func (*ModeType) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface for ModeType
func (*ModeType) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface for ModeType
func (*ModeType) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for ModeType
func (*ModeType) UnmarshalYAML ¶
UnmarshalYAML implements a YAML Unmarshaler for ModeType