selector

package
v2.0.0-...-af00d2a Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataFilterSelector

type DataFilterSelector struct {
	JsonPathsSelector
	UsersSelector
}

func NewDataFilterSelector

func NewDataFilterSelector(sel v1alpha1.Selector) (DataFilterSelector, error)

func (DataFilterSelector) Matches

func (dfs DataFilterSelector) Matches(event events.Event) bool

Returns true if Incoming json matches the JsonPathsSelector User matches the UsersSelector

type JsonPathsSelector

type JsonPathsSelector []jp.Expr

func NewJsonPathsSelector

func NewJsonPathsSelector(jsonpaths []string) (JsonPathsSelector, error)

Parse string array of jsonpaths and return JsonPathsSelector for matching expressions Returns an error if a parse fails

func (JsonPathsSelector) Matches

func (js JsonPathsSelector) Matches(jsonString string) bool

Match json string against expressions in JsonPathsSelector Returns true if all jsonpath expressions produce a result (AND) Returns true if there are no expressions in the JsonPathsSelector Returns false if input does not parse as json

type JsonUser

type JsonUser struct {
	JsonString string
	UserString string
}

type Selector

type Selector interface {
	Matches(any) bool
}

type UsersSelector

type UsersSelector []string

func (UsersSelector) Matches

func (us UsersSelector) Matches(user string) bool

Return true if UsersSelector contains entry Return true if UsersSelector is empty

Jump to

Keyboard shortcuts

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