filter

package module
v0.99.0 Latest Latest
Warning

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

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

Documentation

Overview

Package filter provides an interface for matching strings against a set of string filters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CombinedFilter

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

func (*CombinedFilter) Matches

func (cf *CombinedFilter) Matches(toMatch any) bool

type Config

type Config struct {
	Strict string `mapstructure:"strict"`
	Regex  string `mapstructure:"regexp"`
}

Config configures the matching behavior of a FilterSet.

func (Config) Validate

func (c Config) Validate() error

type Filter

type Filter interface {
	// Matches returns true if the given value matches at least one
	// of the filters encapsulated by the Filter.
	Matches(any) bool
}

Filter is an interface for matching values against a set of filters.

func CreateFilter

func CreateFilter(configs []Config) Filter

CreateFilter creates a Filter from yaml config.

Jump to

Keyboard shortcuts

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