filter

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2025 License: Apache-2.0 Imports: 3 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package filter provides low-level functionality for metric filtering.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterChecker

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

FilterChecker is a small utility which allows us to check if a value matches a test pattern, using various methods.

func NewFilterChecker

func NewFilterChecker(filters []FilterEntry) (*FilterChecker, error)

func (*FilterChecker) Test

func (chk *FilterChecker) Test(value string) bool

type FilterEntry

type FilterEntry struct {
	Pattern string
	Match   FilterMatchType
}

type FilterMatchType

type FilterMatchType string
const (
	FilterMatchTypeExact    FilterMatchType = "exact"
	FilterMatchTypePrefix   FilterMatchType = "prefix"
	FilterMatchTypeSuffix   FilterMatchType = "suffix"
	FilterMatchTypeContains FilterMatchType = "contains"
	FilterMatchTypeRegex    FilterMatchType = "regex"
)

Jump to

Keyboard shortcuts

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