filter

package
v3.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package filter contains common filtering logic that can be used to filter datapoints or various resources within other agent components, such as monitors. Filter instances have a Matches function which takes an instance of the type that they filter and return whether that instance matches the filter.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StringFilter

type StringFilter interface {
	Matches(string) bool
}

StringFilter matches against simple strings

func NewStringFilter

func NewStringFilter(items []string) (StringFilter, error)

NewStringFilter returns a filter that can match against the provided items.

type StringMapFilter

type StringMapFilter interface {
	Matches(map[string]string) bool
}

StringMapFilter matches against the values of a map[string]string.

func NewStringMapFilter

func NewStringMapFilter(m map[string]string) (StringMapFilter, error)

NewStringMapFilter returns a filter that matches against the provided map. All key/value pairs must match the spec given in m for a map to be considered a match.

Jump to

Keyboard shortcuts

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