Documentation
¶
Overview ¶
Package pinfs is the writable-filesystem abstraction for pin's outputs: vendored asset files and the pin.lock. OS is the default; alternative Writers pipe outputs into memory, an archive, or any other target without changing pin's resolve and sync logic.
Writer paths are slash-separated. The OS implementation joins them with its constructor-provided root.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory is an in-memory Writer. The contents map is the source of truth; iterate via Files() or look up a single entry via Get(). A zero-value *Memory is not usable — construct one via NewMemory.
func (*Memory) Files ¶
Files returns a snapshot of the in-memory contents keyed by slash-separated path. The returned map is owned by the caller; the returned byte slices are copies.
type Writer ¶
type Writer interface {
WriteFile(path string, data []byte) error
// ReadFile returns fs.ErrNotExist-wrapped for missing paths. Pin
// uses it to skip rewriting an unchanged lockfile; an
// implementation that doesn't support reads can return
// fs.ErrNotExist unconditionally.
ReadFile(path string) ([]byte, error)
Remove(path string) error
}
Writer is the minimal interface pin uses to emit its outputs. Implementations must make WriteFile atomic, create parent directories on write, and tolerate not-exist errors on Remove.