filter

package module
v0.124.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2025 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 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