path_matcher

package
v2.77.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FalsePathMatcher

type FalsePathMatcher struct{}

FalsePathMatcher always returns false when matching paths

func (FalsePathMatcher) ID

func (m FalsePathMatcher) ID() string

func (FalsePathMatcher) IsDirOrSubmodulePathMatched

func (m FalsePathMatcher) IsDirOrSubmodulePathMatched(_ string) bool

func (FalsePathMatcher) IsPathMatched

func (m FalsePathMatcher) IsPathMatched(_ string) bool

func (FalsePathMatcher) ShouldGoThrough

func (m FalsePathMatcher) ShouldGoThrough(_ string) bool

func (FalsePathMatcher) String

func (m FalsePathMatcher) String() string

type MultiPathMatcher

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

func (MultiPathMatcher) ID

func (m MultiPathMatcher) ID() string

func (MultiPathMatcher) IsDirOrSubmodulePathMatched

func (m MultiPathMatcher) IsDirOrSubmodulePathMatched(path string) bool

func (MultiPathMatcher) IsPathMatched

func (m MultiPathMatcher) IsPathMatched(path string) bool

func (MultiPathMatcher) ShouldGoThrough

func (m MultiPathMatcher) ShouldGoThrough(path string) bool

ShouldGoThrough returns true if the ShouldGoThrough method of at least one matcher returns true and the path partially or completely matched by others (IsDirOrSubmodulePathMatched returns true)

func (MultiPathMatcher) String

func (m MultiPathMatcher) String() string

type PathMatcher

type PathMatcher interface {
	// IsPathMatched checks for a complete matching of the path
	IsPathMatched(string) bool

	// ShouldGoThrough indicates that the directory or submodule path is not completely matched but may include matching files among the child files.
	// The method returns false if the path is completely matched.
	ShouldGoThrough(string) bool

	// IsDirOrSubmodulePathMatched returns true if IsPathMatched or ShouldGoThrough.
	// The method returns true if there is a possibility of containing the matching files among the child files.
	IsDirOrSubmodulePathMatched(string) bool

	// ID returns string that unambiguously defines the path matcher
	ID() string

	String() string
}

func NewFalsePathMatcher

func NewFalsePathMatcher() PathMatcher

func NewMultiPathMatcher

func NewMultiPathMatcher(matchers ...PathMatcher) PathMatcher

func NewPathMatcher

func NewPathMatcher(options PathMatcherOptions) PathMatcher

func NewTruePathMatcher

func NewTruePathMatcher() PathMatcher

type PathMatcherOptions

type PathMatcherOptions struct {
	BasePath             string
	IncludeGlobs         []string
	ExcludeGlobs         []string
	DockerignorePatterns []string
	Matchers             []PathMatcher
}

type TruePathMatcher

type TruePathMatcher struct{}

TruePathMatcher always returns true when matching paths

func (TruePathMatcher) ID

func (m TruePathMatcher) ID() string

func (TruePathMatcher) IsDirOrSubmodulePathMatched

func (m TruePathMatcher) IsDirOrSubmodulePathMatched(_ string) bool

func (TruePathMatcher) IsPathMatched

func (m TruePathMatcher) IsPathMatched(_ string) bool

func (TruePathMatcher) ShouldGoThrough

func (m TruePathMatcher) ShouldGoThrough(_ string) bool

func (TruePathMatcher) String

func (m TruePathMatcher) String() string

Jump to

Keyboard shortcuts

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