filter

package
v0.0.0-...-9bbf3ee Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MultiValuedFilterAttributes

func MultiValuedFilterAttributes(attr schema.CoreAttribute) schema.Attributes

MultiValuedFilterAttributes returns the attributes of the given attribute on which can be filtered. In the case of a complex attribute, the sub-attributes get returned. Otherwise if the given attribute is not complex, a "value" sub- attribute gets created to filter against.

Types

type PathValidator

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

PathValidator represents a path validator.

func NewPathValidator

func NewPathValidator(pathFilter string, s schema.Schema, exts ...schema.Schema) (PathValidator, error)

NewPathValidator constructs a new path validator.

func (PathValidator) Path

func (v PathValidator) Path() filter.Path

func (PathValidator) Validate

func (v PathValidator) Validate() error

Validate checks whether the path is a valid path within the given reference schemas.

type Validator

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

Validator represents a filter validator.

func NewFilterValidator

func NewFilterValidator(exp filter.Expression, s schema.Schema, exts ...schema.Schema) Validator

NewFilterValidator constructs a new filter validator.

func NewValidator

func NewValidator(exp string, s schema.Schema, exts ...schema.Schema) (Validator, error)

NewValidator constructs a new filter validator.

func (Validator) GetFilter

func (v Validator) GetFilter() filter.Expression

GetFilter returns the filter contained within the validator.

func (Validator) PassesFilter

func (v Validator) PassesFilter(resource map[string]interface{}) error

PassesFilter checks whether given resources passes the filter.

func (Validator) Validate

func (v Validator) Validate() error

Validate checks whether the expression is a valid path within the given reference schemas.

Jump to

Keyboard shortcuts

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