amberignore

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package amberignore filters ingest trees through .amberignore files with gitignore semantics: patterns compose per directory down the tree and support negation, ** globs, dir-only (trailing /) and anchored (leading /) forms; the last matching pattern wins.

Index

Constants

View Source
const FileName = ".amberignore"

FileName is the per-directory ignore file honored during ingest.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

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

Matcher answers whether entries of one directory are ignored, carrying the patterns accumulated from the ingest root down to that directory. A nil *Matcher is valid and ignores nothing (used for --no-ignore). Matchers are immutable, so sibling subtrees can Descend and match concurrently.

func Root

func Root(rootDir string) (*Matcher, error)

Root returns the matcher for the ingest root, loading <rootDir>/.amberignore if present.

func (*Matcher) Descend

func (m *Matcher) Descend(absDir, name string) (*Matcher, error)

Descend returns the matcher for the subdirectory name of m's directory (absolute path absDir), loading its .amberignore if present.

func (*Matcher) Ignored

func (m *Matcher) Ignored(name string, isDir bool) bool

Ignored reports whether the entry name (of type isDir) inside m's directory is excluded. .amberignore files are never themselves excluded, so a restored tree re-ingests to the same root.

Jump to

Keyboard shortcuts

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