vfsmatch

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const UnlimitedDepth = math.MaxInt

UnlimitedDepth can be passed as the depth argument to indicate there is no depth limit.

Variables

This section is empty.

Functions

func IsImplicitGlob

func IsImplicitGlob(lastPathComponent string) bool

IsImplicitGlob checks if a path component is implicitly a glob. An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, and does not contain any glob characters itself.

func ReadDirectory

func ReadDirectory(host vfs.FS, currentDir string, path string, extensions []string, excludes []string, includes []string, depth int) []string

Types

type SpecMatcher

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

SpecMatcher wraps multiple glob patterns for matching paths.

func NewSpecMatcher

func NewSpecMatcher(specs []string, basePath string, usage Usage, useCaseSensitiveFileNames bool) *SpecMatcher

NewSpecMatcher creates a matcher for one or more glob specs. It returns a matcher that can test if paths match any of the patterns.

func (*SpecMatcher) MatchIndex

func (m *SpecMatcher) MatchIndex(path string) int

MatchIndex returns the index of the first matching pattern, or -1.

func (*SpecMatcher) MatchString

func (m *SpecMatcher) MatchString(path string) bool

MatchString returns true if any pattern matches the path.

type Usage

type Usage int8
const (
	UsageFiles Usage = iota
	UsageDirectories
	UsageExclude
)

func (Usage) String

func (i Usage) String() string

Jump to

Keyboard shortcuts

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