Help us shape the future of Go! Take the 2026 Go Developer Survey

filesystem

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentWalker added in v1.1.0

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

ConcurrentWalker handles concurrent file system traversal

type FileItem

type FileItem struct {
	Path  string
	IsDir bool
	Level int
	Size  int64
}

FileItem represents a file or directory found when walking the filesystem.

func WalkDirectory

func WalkDirectory(root string, gitIgnore *GitIgnoreManager, filter *FilterManager, useGitIgnore, showHidden bool, maxFileSize int64) ([]FileItem, error)

WalkDirectory traverses the root directory taking into account gitignore, hidden files, and max file size.

type FilterManager

type FilterManager struct {
	Patterns []string
}

func NewFilterManager

func NewFilterManager() *FilterManager

func (*FilterManager) AddGlobPattern

func (f *FilterManager) AddGlobPattern(pattern string)

func (*FilterManager) ShouldInclude

func (f *FilterManager) ShouldInclude(path string) bool

type GitIgnoreManager

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

GitIgnoreManager manages gitignore patterns for a repository.

func NewGitIgnoreManager

func NewGitIgnoreManager(root string) (*GitIgnoreManager, error)

NewGitIgnoreManager reads the .gitignore file (if present) and returns a manager.

func (*GitIgnoreManager) IsIgnored

func (g *GitIgnoreManager) IsIgnored(path string) bool

IsIgnored returns true if the provided path is ignored.

Jump to

Keyboard shortcuts

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