directoryocclusion

package
v0.0.0-...-5b8470e Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

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

Checker is a very limited filesystem hierarchy checker.

This forms a tree, where each node is a directory. Nodes in the tree may have a mapping from owner claiming this directory to a series of notes (descriptions of /why/ this owner claims this directory).

Paths may only ever have one owner; After adding all paths to the Checker, call Conflicts to populate a validation.Context with any conflicts discovered.

Practically, this is used to ensure that Cache directories do not overlap with CIPD package directives; CIPD packages may not be installed as subdirs of caches, and caches may not be installed as subdirs of CIPD package directories. Similarly, multiple caches cannot be mapped to the same directory.

func NewChecker

func NewChecker(fullPath string) *Checker

NewChecker creates a new Checker.

func (*Checker) Add

func (c *Checker) Add(path, owner, note string)

Add adds the path to the tree with the owner.

func (*Checker) Conflicts

func (c *Checker) Conflicts() errors.MultiError

Conflicts populates `merr` with all violations found in this Checker.

This will walk the Checker depth-first, pruning branches at the first conflict.

Jump to

Keyboard shortcuts

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