filter

package
v5.10.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: MIT, MIT, MIT, + 1 more Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// KeylessStatementErr statement is missing a key
	KeylessStatementErr = errors.New("filters must have the format KEY:VAL")

	// FilterNotFoundErr could not match a filter for the given key
	FilterNotFoundErr = errors.New("no filter could be matched with the given statement")
)

Functions

This section is empty.

Types

type BooleanMatcher

type BooleanMatcher func(v2.Resource, bool) bool

type FieldsFunc

type FieldsFunc func(resource v2.Resource) map[string]string

FieldsFunc represents the function to retrieve fields about a given resource

type Filter

type Filter func(string, FieldsFunc) (Matcher, error)

Filter configures a new Matcher given a statement and a fields func.

func Boolean

func Boolean(fn BooleanMatcher) Filter

func String

func String(fn StringMatcher) Filter

type Matcher

type Matcher func(v2.Resource) bool

Match a given resource

func Compile

func Compile(statements []string, filters map[string]Filter, fieldsFn FieldsFunc) (Matcher, error)

Compile matcher from given statements, filters and fields.

type StringMatcher

type StringMatcher func(v2.Resource, string) bool

Jump to

Keyboard shortcuts

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