filter

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CELFilter

type CELFilter struct {
	// contains filtered or unexported fields
}

func (*CELFilter) Filter

func (filter *CELFilter) Filter(event ce.Event) Result

func (*CELFilter) String

func (filter *CELFilter) String() string

type Filter

type Filter interface {
	// Filter compute the predicate on the provided event and returns the result of the matching
	Filter(ce.Event) Result
}

Filter is an interface representing an event filter of the trigger filter.

func GetFilter

func GetFilter(subscriptionFilters []*primitive.SubscriptionFilter) Filter

func NewAllFilter

func NewAllFilter(filters ...Filter) Filter

func NewAnyFilter

func NewAnyFilter(filters ...Filter) Filter

func NewCELFilter

func NewCELFilter(expression string) Filter

func NewCESQLFilter

func NewCESQLFilter(expression string) Filter

func NewExactFilter

func NewExactFilter(exact map[string]string) Filter

func NewNoFilter

func NewNoFilter() Filter

func NewNotFilter

func NewNotFilter(f Filter) Filter

func NewPrefixFilter

func NewPrefixFilter(prefix map[string]string) Filter

func NewSuffixFilter

func NewSuffixFilter(suffix map[string]string) Filter

type Result

type Result bool

Result has the result of the filtering operation.

const (
	PassFilter Result = true
	FailFilter Result = false
)

Filtering result conditions.

func Run

func Run(f Filter, event ce.Event) Result

Jump to

Keyboard shortcuts

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