Documentation
¶
Overview ¶
Package sourceignore builds Flux artifact-exclusion policy from in-tree .sourceignore files and caller-supplied spec.ignore patterns.
Index ¶
- func WalkPolicy(input fs.FS, read func(string) error) error
- type Matcher
- func (m *Matcher) Admit(kept map[string]bool, name string, directory bool)
- func (m *Matcher) Evidence() []struct{ ... }
- func (m *Matcher) Match(rel string, isDir bool) bool
- func (m *Matcher) ReadPolicy(name string) (string, bool)
- func (m *Matcher) UsesDefaults() bool
- func (m *Matcher) WithExtra(extra string) *Matcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher reports whether a path within a source tree is excluded from the artifact and retains the parsed ignore-file content. It is safe for concurrent reads.
func NewFS ¶
NewFS builds Flux policy from a slash-named immutable filesystem. Nil files walks the input; a supplied list MUST contain every relative ignore file. Parent rules MUST precede nested rules, independent of filesystem listing order. Defaults apply only without parsed user patterns; extra patterns have final priority.
func NewRoot ¶ added in v0.8.1
NewRoot builds bucket policy from its root ignore object and declared extensions.
func (*Matcher) Admit ¶ added in v0.8.1
Admit records one selected entry and the parents needed to reach it.
func (*Matcher) Evidence ¶
Evidence returns the ordered ignore-file paths and exact content parsed by NewFS.
func (*Matcher) Match ¶
Match reports whether rel (a path relative to the matcher's root, using the slash separator) is excluded. isDir distinguishes directory-only patterns.
func (*Matcher) ReadPolicy ¶ added in v0.8.1
ReadPolicy returns the bytes already read for an ignore file.
func (*Matcher) UsesDefaults ¶ added in v0.8.1
UsesDefaults reports whether the policy has no custom patterns.