filter

package module
v0.103.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 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 deprecated

type CombinedFilter combinedFilter

Deprecated: [v0.103.0] This type will be removed in the future.

type Config

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

Config configures the matching behavior of a Filter.

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 out of a set of Config configuration objects.

Jump to

Keyboard shortcuts

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