fsx

package
v1.10.12 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS interface {
	Open(name string) (File, error)
	OpenFile(name string, flag int, perm fs.FileMode) (File, error)
	Stat(name string) (fs.FileInfo, error)
	MkdirAll(path string, perm fs.FileMode) error
	Rename(oldpath string, newpath string) error
	Remove(name string) error
	ReadDir(name string) ([]fs.DirEntry, error)
	WalkDir(root string, fn fs.WalkDirFunc) error
}

FS is Coldkeep's minimal filesystem abstraction.

It intentionally covers only the filesystem operations identified by the v1.10.8 seam classification work. It is not a general virtual filesystem, path policy layer, repository layout abstraction, or fault-injection API.

type File

type File interface {
	io.Reader
	io.Writer
	io.Closer
	io.ReaderAt
	io.Seeker
	Sync() error
	Truncate(size int64) error
}

File is the minimal file handle abstraction required by FS.

The methods mirror the behavior needed by current Coldkeep read, write, close, durability-sync, random-read, seek, and truncate paths. All methods are satisfied by *os.File.

type NoopFS

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

NoopFS is a behavior-preserving wrapper around an FS.

It exists to provide an explicit seam for later deterministic wrappers while preserving the wrapped filesystem's behavior exactly in v1.10.8.

func NewNoop

func NewNoop(base FS) NoopFS

NewNoop returns a behavior-preserving filesystem wrapper around base.

func (NoopFS) MkdirAll

func (n NoopFS) MkdirAll(path string, perm fs.FileMode) error

MkdirAll delegates to the wrapped filesystem.

func (NoopFS) Open

func (n NoopFS) Open(name string) (File, error)

Open delegates to the wrapped filesystem.

func (NoopFS) OpenFile

func (n NoopFS) OpenFile(name string, flag int, perm fs.FileMode) (File, error)

OpenFile delegates to the wrapped filesystem.

func (NoopFS) ReadDir

func (n NoopFS) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir delegates to the wrapped filesystem.

func (NoopFS) Remove

func (n NoopFS) Remove(name string) error

Remove delegates to the wrapped filesystem.

func (NoopFS) Rename

func (n NoopFS) Rename(oldpath string, newpath string) error

Rename delegates to the wrapped filesystem.

func (NoopFS) Stat

func (n NoopFS) Stat(name string) (fs.FileInfo, error)

Stat delegates to the wrapped filesystem.

func (NoopFS) WalkDir

func (n NoopFS) WalkDir(root string, fn fs.WalkDirFunc) error

WalkDir delegates to the wrapped filesystem.

type OSFS

type OSFS struct{}

OSFS is an FS implementation backed directly by the local operating system.

It must preserve standard library behavior exactly. It must not rewrite paths, retry operations, normalize errors, swallow errors, or add fault-injection behavior.

func Default

func Default() OSFS

Default returns the default OS-backed filesystem implementation.

func (OSFS) MkdirAll

func (OSFS) MkdirAll(path string, perm fs.FileMode) error

MkdirAll delegates to os.MkdirAll.

func (OSFS) Open

func (OSFS) Open(name string) (File, error)

Open delegates to os.Open.

func (OSFS) OpenFile

func (OSFS) OpenFile(name string, flag int, perm fs.FileMode) (File, error)

OpenFile delegates to os.OpenFile.

func (OSFS) ReadDir

func (OSFS) ReadDir(name string) ([]fs.DirEntry, error)

ReadDir delegates to os.ReadDir.

func (OSFS) Remove

func (OSFS) Remove(name string) error

Remove delegates to os.Remove.

func (OSFS) Rename

func (OSFS) Rename(oldpath string, newpath string) error

Rename delegates to os.Rename.

func (OSFS) Stat

func (OSFS) Stat(name string) (fs.FileInfo, error)

Stat delegates to os.Stat.

func (OSFS) WalkDir

func (OSFS) WalkDir(root string, fn fs.WalkDirFunc) error

WalkDir delegates to filepath.WalkDir.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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