Documentation ¶
Overview ¶
Package filter provides a way to filter resources based on a set of criteria.
Index ¶
Constants ¶
const ( Empty Type = "" Exact Type = "exact" Glob Type = "glob" Regex Type = "regex" Contains Type = "contains" DateOlderThan Type = "dateOlderThan" Suffix Type = "suffix" Prefix Type = "prefix" NotIn Type = "NotIn" In Type = "In" And OpType = "and" Or OpType = "or" Global = "__global__" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct { // Group is the name of the group of filters, all filters in a group are ANDed together Group string `yaml:"group" json:"group"` // Type is the type of filter to apply Type Type `yaml:"type" json:"type"` // Property is the name of the property to filter on Property string `yaml:"property" json:"property"` // Value is the value to filter on Value string `yaml:"value" json:"value"` // Values allows for multiple values to be specified for a filter Values []string `yaml:"values" json:"values"` // Invert is a flag to invert the filter Invert bool `yaml:"invert" json:"invert"` }
Filter is a filter to apply to a resource
func NewExactFilter ¶
NewExactFilter creates a new filter that matches the exact value
func (*Filter) GetGroup ¶ added in v0.20.0
GetGroup returns the group name of the filter, if it is empty it returns "default"
func (*Filter) UnmarshalYAML ¶
UnmarshalYAML unmarshals a filter from YAML data
type Filters ¶
func (Filters) Append ¶ added in v0.10.0
Append appends the filters from f2 to f. This is primarily used to append filters from a preset to a set of filters that were defined on a resource type.
func (Filters) Get ¶ added in v0.10.0
Get returns the filters for a specific resource type or the global filters if they exist. If there are no filters it returns nil
func (Filters) GetByGroup ¶ added in v0.20.0
GetByGroup returns the filters grouped by the group name for a specific resource type. If there are no filters it returns nil
func (Filters) Match ¶ added in v0.20.0
Match checks if the filters match the given property which is actually a queue item that meats the property interface requirements