matchers

package
v0.57.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 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 Matcher

type Matcher interface {
	Match(string) bool
}
var MatchEverything Matcher = MatcherFunc(func(s string) bool {
	return true
})

MatchEverything returns a matcher that matches everything.

func And

func And(matchers ...Matcher) Matcher

func Glob added in v0.7.0

func Glob(patterns ...string) (Matcher, error)

Glob returns a matcher that matches if all given glob patterns matches the given string. A pattern can be negated with a leading !.

func Not added in v0.7.0

func Not(matcher Matcher) Matcher

Not returns a matcher that matches if the given matcher does not match.

func Or added in v0.7.0

func Or(matchers ...Matcher) Matcher

Or returns a matcher that matches if any of the given matchers match.

type MatcherFunc added in v0.7.0

type MatcherFunc func(string) bool

func (MatcherFunc) Match added in v0.7.0

func (m MatcherFunc) Match(s string) bool

Jump to

Keyboard shortcuts

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