filter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

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