apm: go.elastic.co/apm/internal/wildcard Index | Files

package wildcard

import "go.elastic.co/apm/internal/wildcard"

Package wildcard provides a fast, zero-allocation wildcard matcher.


Package Files

doc.go matcher.go matchers.go

type CaseSensitivity Uses

type CaseSensitivity bool

CaseSensitivity controls the case sensitivity of matching.

const (
    CaseSensitive   CaseSensitivity = true
    CaseInsensitive CaseSensitivity = false

CaseSensitivity values.

type Matcher Uses

type Matcher struct {
    // contains filtered or unexported fields

Matcher matches strings against a wildcard pattern with configurable case sensitivity.

func NewMatcher Uses

func NewMatcher(p string, caseSensitive CaseSensitivity) *Matcher

NewMatcher constructs a new wildcard matcher for the given pattern.

If p is the empty string, it will match only the empty string. If p is not a valid UTF-8 string, matching behaviour is undefined.

func (*Matcher) Match Uses

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

Match reports whether s matches m's wildcard pattern.

type Matchers Uses

type Matchers []*Matcher

Matchers is a slice of Matcher, matching any of the contained matchers.

func (Matchers) MatchAny Uses

func (m Matchers) MatchAny(s string) bool

MatchAny returns true iff any of the matchers returns true.

Package wildcard imports 3 packages (graph) and is imported by 5 packages. Updated 2019-02-19. Refresh now. Tools for package owners.