filter

package
v0.0.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockEventFilter

type BlockEventFilter interface {
	EventMatches(EventData) (bool, error)
	IncludeMatch() bool
	Valid() (bool, error)
}

func NewDefaultBlockEventTypeAndAttributeValueFilter

func NewDefaultBlockEventTypeAndAttributeValueFilter(eventType string, attributeKey string, attributeValue string, inclusive bool) BlockEventFilter

func NewDefaultBlockEventTypeFilter

func NewDefaultBlockEventTypeFilter(eventType string, inclusive bool) BlockEventFilter

func NewRegexBlockEventFilter

func NewRegexBlockEventFilter(eventTypeRegex string, inclusive bool) (BlockEventFilter, error)

type DefaultBlockEventTypeAndAttributeValueFilter

type DefaultBlockEventTypeAndAttributeValueFilter struct {
	EventType      string `json:"event_type"`
	AttributeKey   string `json:"attribute_key"`
	AttributeValue string `json:"attribute_value"`
	Inclusive      bool   `json:"inclusive"`
}

func (DefaultBlockEventTypeAndAttributeValueFilter) EventMatches

func (DefaultBlockEventTypeAndAttributeValueFilter) IncludeMatch

func (DefaultBlockEventTypeAndAttributeValueFilter) Valid

type DefaultBlockEventTypeFilter

type DefaultBlockEventTypeFilter struct {
	EventType string `json:"event_type"`
	Inclusive bool   `json:"inclusive"`
}

func (DefaultBlockEventTypeFilter) EventMatches

func (f DefaultBlockEventTypeFilter) EventMatches(eventData EventData) (bool, error)

func (DefaultBlockEventTypeFilter) IncludeMatch

func (f DefaultBlockEventTypeFilter) IncludeMatch() bool

func (DefaultBlockEventTypeFilter) Valid

func (f DefaultBlockEventTypeFilter) Valid() (bool, error)

type DefaultMessageTypeFilter

type DefaultMessageTypeFilter struct {
	MessageType string `json:"message_type"`
}

func (DefaultMessageTypeFilter) MessageTypeMatches

func (f DefaultMessageTypeFilter) MessageTypeMatches(messageTypeData MessageTypeData) (bool, error)

func (DefaultMessageTypeFilter) Valid

func (f DefaultMessageTypeFilter) Valid() (bool, error)

type DefaultRollingWindowBlockEventFilter

type DefaultRollingWindowBlockEventFilter struct {
	EventPatterns []BlockEventFilter
	// contains filtered or unexported fields
}

func (DefaultRollingWindowBlockEventFilter) EventsMatch

func (f DefaultRollingWindowBlockEventFilter) EventsMatch(eventData []EventData) (bool, error)

func (DefaultRollingWindowBlockEventFilter) IncludeMatches

func (f DefaultRollingWindowBlockEventFilter) IncludeMatches() bool

func (DefaultRollingWindowBlockEventFilter) RollingWindowLength

func (f DefaultRollingWindowBlockEventFilter) RollingWindowLength() int

func (DefaultRollingWindowBlockEventFilter) Valid

type EventData

type EventData struct {
	Event      models.BlockEvent
	Attributes []models.BlockEventAttribute
}

type MessageTypeData

type MessageTypeData struct {
	MessageType string
}

type MessageTypeFilter

type MessageTypeFilter interface {
	MessageTypeMatches(MessageTypeData) (bool, error)
	Valid() (bool, error)
}

type MessageTypeRegexFilter

type MessageTypeRegexFilter struct {
	MessageTypeRegexPattern string `json:"message_type_regex"`
	// contains filtered or unexported fields
}

func NewRegexMessageTypeFilter

func NewRegexMessageTypeFilter(messageTypeRegexPattern string) (MessageTypeRegexFilter, error)

func (MessageTypeRegexFilter) MessageTypeMatches

func (f MessageTypeRegexFilter) MessageTypeMatches(messageTypeData MessageTypeData) (bool, error)

func (MessageTypeRegexFilter) Valid

func (f MessageTypeRegexFilter) Valid() (bool, error)

type RegexBlockEventTypeFilter

type RegexBlockEventTypeFilter struct {
	EventTypeRegexPattern string `json:"event_type_regex"`

	Inclusive bool `json:"inclusive"`
	// contains filtered or unexported fields
}

func (RegexBlockEventTypeFilter) EventMatches

func (f RegexBlockEventTypeFilter) EventMatches(eventData EventData) (bool, error)

func (RegexBlockEventTypeFilter) IncludeMatch

func (f RegexBlockEventTypeFilter) IncludeMatch() bool

func (RegexBlockEventTypeFilter) Valid

func (f RegexBlockEventTypeFilter) Valid() (bool, error)

type RollingWindowBlockEventFilter

type RollingWindowBlockEventFilter interface {
	EventsMatch([]EventData) (bool, error)
	RollingWindowLength() int
	IncludeMatches() bool
	Valid() (bool, error)
}

func NewDefaultRollingWindowBlockEventFilter

func NewDefaultRollingWindowBlockEventFilter(eventPatterns []BlockEventFilter, includeMatches bool) RollingWindowBlockEventFilter

type StaticBlockEventFilterRegistry

type StaticBlockEventFilterRegistry struct {
	BlockEventFilters         []BlockEventFilter
	RollingWindowEventFilters []RollingWindowBlockEventFilter
}

func (*StaticBlockEventFilterRegistry) NumFilters

func (r *StaticBlockEventFilterRegistry) NumFilters() int

func (*StaticBlockEventFilterRegistry) RegisterBlockEventFilter

func (r *StaticBlockEventFilterRegistry) RegisterBlockEventFilter(filter BlockEventFilter)

func (*StaticBlockEventFilterRegistry) RegisterRollingWindowBlockEventFilter

func (r *StaticBlockEventFilterRegistry) RegisterRollingWindowBlockEventFilter(filter RollingWindowBlockEventFilter)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL