Documentation
¶
Overview ¶
Package fs provides file system adapters for walking and hashing files.
Index ¶
Constants ¶
const ( // WalkerNodeID is the unique identifier for the FS walker Graft node. WalkerNodeID graft.ID = "adapter.fs.walker" // ResolverNodeID is the unique identifier for the FS input resolver Graft node. ResolverNodeID graft.ID = "adapter.fs.resolver" // HasherNodeID is the unique identifier for the FS hasher Graft node. HasherNodeID graft.ID = "adapter.fs.hasher" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hasher ¶
type Hasher struct {
// contains filtered or unexported fields
}
Hasher provides hashing functionality for tasks and files.
func (*Hasher) ComputeFileHash ¶
ComputeFileHash computes the XXHash of a file's content.
func (*Hasher) ComputeInputHash ¶
func (h *Hasher) ComputeInputHash(task *domain.Task, env map[string]string, inputs []string) (string, error)
ComputeInputHash computes a single hash representing the task configuration, environment, and input files.
func (*Hasher) ComputeOutputHash ¶
ComputeOutputHash computes the hash of the output files or directories. Note: Unlike task inputs/outputs, the output file list comes from filesystem traversal or executor results, which are not guaranteed to be in a deterministic order. Therefore, we must explicitly sort the list before hashing to ensure consistency.
type Resolver ¶
type Resolver struct{}
Resolver implements the InputResolver interface using filepath.Glob.
type Walker ¶
type Walker struct{}
Walker provides file walking functionality.
func (*Walker) WalkFiles ¶
WalkFiles yields all files in the root directory, skipping .git and ignored directories. It returns an iterator that yields file paths relative to the root (or absolute if root is absolute, but typically WalkDir yields paths including root). Actually, filepath.WalkDir yields paths starting with root.