matchers

package
v0.0.0-...-b6b578a Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FastRegexMatcher

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

func NewFastRegexMatcher

func NewFastRegexMatcher(v string) (*FastRegexMatcher, error)

func (*FastRegexMatcher) GetRegexString

func (m *FastRegexMatcher) GetRegexString() string

func (*FastRegexMatcher) MatchString

func (m *FastRegexMatcher) MatchString(s string) bool

type MatchType

type MatchType int

MatchType is an enum for label matching types.

const (
	MatchEqual MatchType = iota
	MatchNotEqual
	MatchRegexp
	MatchNotRegexp
)

Possible MatchTypes.

func (MatchType) String

func (m MatchType) String() string

type Matcher

type Matcher struct {
	Type  MatchType
	Name  string
	Value string
	// contains filtered or unexported fields
}

Matcher models the matching of a label.

func MustNewMatcher

func MustNewMatcher(mt MatchType, name, val string) *Matcher

MustNewMatcher panics on error - only for use in tests!

func NewMatcher

func NewMatcher(t MatchType, n, v string) (*Matcher, error)

NewMatcher returns a matcher object.

func (*Matcher) GetRegexString

func (m *Matcher) GetRegexString() string

GetRegexString returns the regex string.

func (*Matcher) Inverse

func (m *Matcher) Inverse() (*Matcher, error)

Inverse returns a matcher that matches the opposite.

func (*Matcher) Matches

func (m *Matcher) Matches(s string) bool

Matches returns whether the matcher matches the given string value.

func (*Matcher) String

func (m *Matcher) String() string

Jump to

Keyboard shortcuts

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