fileindex

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildIndexInput

type BuildIndexInput struct {
	BaseDirs         []string
	ExcludePaths     []string
	Patterns         []Pattern
	MaxDepth         int // 0 = unlimited
	FollowSymlinks   bool
	NumWorkers       int // fastwalk workers; 0 = library default
	ProgressCallback func(processed int64)
}

type FileIndex

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

FileIndex holds matched file paths grouped by pattern name.

func BuildIndex

func BuildIndex(ctx context.Context, input BuildIndexInput) (*FileIndex, error)

func NewFileIndex

func NewFileIndex() *FileIndex

func (*FileIndex) Add

func (fi *FileIndex) Add(patternName, filePath string)

func (*FileIndex) Get

func (fi *FileIndex) Get(patternName string) []string

func (*FileIndex) GetAll

func (fi *FileIndex) GetAll() map[string][]string

func (*FileIndex) TotalFiles

func (fi *FileIndex) TotalFiles() int

type Pattern

type Pattern struct {
	Name     string
	Patterns []string
	Type     PatternType
}

type PatternType

type PatternType string
const (
	PatternTypeGlob  PatternType = "glob"
	PatternTypeExact PatternType = "exact"
	PatternTypeRegex PatternType = "regex"
)

Jump to

Keyboard shortcuts

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