ignore

package
v0.6.16 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package ignore provides functionality for processing .thvignore files to filter bind mount contents using tmpfs overlays.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	LoadGlobal    bool // Whether to load global ignore patterns
	PrintOverlays bool // Whether to print resolved overlay paths for debugging
}

Config holds configuration for ignore processing

type OverlayMount

type OverlayMount struct {
	ContainerPath string // Path in the container to overlay
	HostPath      string // Host path (for bind mounts) or empty (for tmpfs)
	Type          string // "tmpfs" for directories, "bind" for files
}

OverlayMount represents a mount that should overlay an ignored path

type Processor

type Processor struct {
	GlobalPatterns []string
	LocalPatterns  []string
	Config         *Config
	// contains filtered or unexported fields
}

Processor handles loading and processing ignore patterns

func NewProcessor

func NewProcessor(config *Config) *Processor

NewProcessor creates a new Processor instance with the given configuration

func (*Processor) Cleanup

func (p *Processor) Cleanup() error

Cleanup removes all overlay artifacts (shared empty file and directories)

func (*Processor) GetOverlayMounts

func (p *Processor) GetOverlayMounts(bindMount, containerPath string) []OverlayMount

GetOverlayMounts returns mounts that should overlay ignored paths based on the loaded ignore patterns

func (*Processor) GetOverlayPaths

func (p *Processor) GetOverlayPaths(bindMount, containerPath string) []string

GetOverlayPaths returns container paths that should be overlaid based on the loaded ignore patterns (kept for backward compatibility)

func (*Processor) LoadGlobal

func (p *Processor) LoadGlobal() error

LoadGlobal loads global ignore patterns from ~/.config/toolhive/thvignore

func (*Processor) LoadLocal

func (p *Processor) LoadLocal(sourceDir string) error

LoadLocal loads local ignore patterns from the configured ignore file in the specified directory

func (*Processor) ShouldIgnore

func (p *Processor) ShouldIgnore(path string) bool

ShouldIgnore checks if a given path should be ignored based on loaded patterns

Jump to

Keyboard shortcuts

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