matcher

package
v14.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Match

func Match(
	matchConfigs []Matcher, name string, tags []string,
) bool

Types

type Matcher

type Matcher struct {
	Name NameMatcher  `yaml:"name"`
	Tags []TagMatcher `yaml:"tags"`
}

type NameMatcher

type NameMatcher struct {
	Kind string `yaml:"kind"`

	Value string `yaml:"value"`
	// contains filtered or unexported fields
}

func CreateNameMatcher

func CreateNameMatcher(config *NameMatcherConfig) NameMatcher

func (*NameMatcher) UnmarshalYAML

func (matcher *NameMatcher) UnmarshalYAML(
	unmarshal func(interface{}) error,
) error

UnmarshalYAML unmarshals and validates the yaml config for matching the name of a metric.

type NameMatcherConfig

type NameMatcherConfig struct {
	Kind  string `yaml:"kind"`
	Value string `yaml:"value"`
}

type TagMatcher

type TagMatcher struct {
	Kind string `yaml:"kind"`

	Unset bool   `yaml:"unset"`
	Value string `yaml:"value"`
	// contains filtered or unexported fields
}

func CreateTagMatcher

func CreateTagMatcher(config *TagMatcherConfig) TagMatcher

func (*TagMatcher) Match

func (matcher *TagMatcher) Match(tag string) bool

func (*TagMatcher) UnmarshalYAML

func (matcher *TagMatcher) UnmarshalYAML(
	unmarshal func(interface{}) error,
) error

UnmarshalYAML unmarshals and validates the yaml config for matching tags within a metric.

type TagMatcherConfig

type TagMatcherConfig struct {
	Kind  string `yaml:"kind"`
	Unset bool   `yaml:"unset"`
	Value string `yaml:"value"`
}

Jump to

Keyboard shortcuts

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