Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockSortedTagIterator ¶
func NewMockSortedTagIterator(tags []byte) id.SortedTagIterator
NewMockSortedTagIterator creates a mock SortedTagIterator based on given ID.
Types ¶
type Filter ¶
type Filter interface { Clone() Filter // contains filtered or unexported methods }
Filter matches a string against certain conditions.
func NewFilter ¶
NewFilter supports startsWith, endsWith, contains and a single wildcard along with negation and glob matching support. NOTE: Currently only supports ASCII matching and has zero compatibility with UTF8 so you should make sure all matches are done against ASCII only.
func NewFilterFromFilterValue ¶
func NewFilterFromFilterValue(fv FilterValue) (Filter, error)
NewFilterFromFilterValue creates a filter from the given filter value.
func NewMultiFilter ¶
NewMultiFilter returns a filter that chains multiple filters together using a LogicalOp.
func NewTagsFilter ¶
func NewTagsFilter( filters TagFilterValueMap, op LogicalOp, opts TagsFilterOptions, ) (Filter, error)
NewTagsFilter creates a new tags filter.
type FilterValue ¶
FilterValue contains the filter pattern and a boolean flag indicating whether the filter should be negated.
type TagFilterValueMap ¶
type TagFilterValueMap map[string]FilterValue
TagFilterValueMap is a map containing mappings from tag names to filter values.
func ParseTagFilterValueMap ¶
func ParseTagFilterValueMap(str string) (TagFilterValueMap, error)
ParseTagFilterValueMap parses the input string and creates a tag filter value map.
func ValidateTagsFilter ¶
func ValidateTagsFilter(str string) (TagFilterValueMap, error)
ValidateTagsFilter validates whether a given string is a valid tags filter, returning the filter values if the string is a valid tags filter expression, and the error otherwise.
type TagsFilterOptions ¶
type TagsFilterOptions struct { // Name of the name tag. NameTagKey []byte // Function to extract name and tags from an id. NameAndTagsFn id.NameAndTagsFn // Function to create a new sorted tag iterator from id tags. SortedTagIteratorFn id.SortedTagIteratorFn }
TagsFilterOptions provide a set of tag filter options.