Documentation
¶
Overview ¶
Package fs provides the filesystem abstraction layer for pulse storage backends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config holds filesystem configuration for Pulse storage operations. The FS field uses afero.Fs as the interface contract, enabling transparent swapping between real OS filesystems and in-memory implementations for testing.
Extension hook: callers can inject any afero.Fs implementation via WithFs to support custom storage backends (e.g., encrypted FS, remote mounts).
func Default ¶
Default returns an OsFs rooted at the directory specified by the PULSE_DATA_DIR environment variable. Returns an error if the variable is empty or unset.
func New ¶
New creates a configured filesystem with the given options. If no FS is injected, an OsFs rooted at the data directory is created. If no DataDir is set, it is not resolved from the environment (use Default for that).
func NewMemMap ¶
func NewMemMap() *Config
NewMemMap returns a Config backed by an in-memory MemMapFs. Intended for testing; the DataDir is empty.
type Option ¶
type Option func(*Config)
Option configures a Config during construction.
func WithDataDir ¶
WithDataDir sets an explicit data directory path. This takes precedence over the PULSE_DATA_DIR environment variable.