Documentation
¶
Overview ¶
Package fs is the working tree source adapter ("fs"): it walks a directory, or reads one file, and emits each regular file as one chunk. A .ipynb file is emitted as one chunk per notebook cell source and cell outputs (see Source.notebook). It reads plain files only (no archive expansion), skips .git at any depth and never follows symlinks inside the tree; an explicitly named root path is followed.
Inside a git work tree, with git available, it reads what git would commit (tracked files plus untracked files that are not ignored) instead of walking, unless Spec.IncludeIgnored is set.
Index ¶
Constants ¶
const Name = "fs"
Name is the adapter name.
Variables ¶
var ErrNoPath = errors.New("fs source: no path")
ErrNoPath is returned for a spec without a path.
Functions ¶
Types ¶
type Source ¶
type Source struct {
// contains filtered or unexported fields
}
Source walks one directory tree, or reads one file, under a target root.
func (*Source) BinarySkipped ¶
BinarySkipped returns how many files were skipped as binary (a NUL byte in the first 8 KiB). It is safe to call while Scan runs.
func (*Source) PathPrefix ¶ added in v0.3.0
PathPrefix returns the slash path of the root relative to the enclosing git top level ("" at the top level, outside git or for a Spec.FS tree). Location paths are relative to the root; joining the prefix gives the repository path.