filter

package
v0.0.0-...-afecb3f Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Copyright (c) 2015-2020 InfluxData Inc. MIT License (MIT) https://github.com/influxdata/telegraf

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Match(string) bool
}

func Compile

func Compile(filters []string) (Filter, error)

Compile takes a list of string filters and returns a Filter interface for matching a given string against the filter list. The filter list supports glob matching too, ie:

f, _ := Compile([]string{"cpu", "mem", "net*"})
f.Match("cpu")     // true
f.Match("network") // true
f.Match("memory")  // false

func NewIncludeExcludeFilter

func NewIncludeExcludeFilter(
	include []string,
	exclude []string,
) (Filter, error)

func NewIncludeExcludeFilterDefaults

func NewIncludeExcludeFilterDefaults(
	include []string,
	exclude []string,
	includeDefault bool,
	excludeDefault bool,
) (Filter, error)

type IncludeExcludeFilter

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

func (*IncludeExcludeFilter) Match

func (f *IncludeExcludeFilter) Match(s string) bool

Jump to

Keyboard shortcuts

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