Documentation
¶
Overview ¶
Package overlayfs implements an overlay FileSystem where writes land in an in-memory overlay and reads come from the overlay-or-real-disk union.
Semantics:
- Reads: serve from the overlay if present; otherwise from the host subtree under Root.
- Writes: always go into the overlay; the host disk is never modified.
- Deletes: store a tombstone in the overlay; later reads see ENOENT.
- Listing: union of host readdir + overlay entries, minus tombstones.
- Symlinks: rejected by default for security; opt in via AllowSymlinks.
Index ¶
- type FS
- func (f *FS) AllPaths() []string
- func (f *FS) AppendFile(name string, data []byte, perm os.FileMode) error
- func (f *FS) Chmod(name string, mode os.FileMode) error
- func (f *FS) Chtimes(name string, atime, mtime time.Time) error
- func (f *FS) Create(name string) (gobashfs.File, error)
- func (f *FS) Link(oldpath, newpath string) error
- func (f *FS) Lstat(name string) (os.FileInfo, error)
- func (f *FS) Mkdir(name string, perm os.FileMode) error
- func (f *FS) MkdirAll(name string, perm os.FileMode) error
- func (f *FS) MountPoint() string
- func (f *FS) Open(name string) (iofs.File, error)
- func (f *FS) OpenFile(name string, flag int, perm os.FileMode) (gobashfs.File, error)
- func (f *FS) ReadDir(name string) ([]iofs.DirEntry, error)
- func (f *FS) ReadFile(name string) ([]byte, error)
- func (f *FS) Readlink(name string) (string, error)
- func (f *FS) Realpath(name string) (string, error)
- func (f *FS) Remove(name string) error
- func (f *FS) RemoveAll(name string) error
- func (f *FS) Rename(oldpath, newpath string) error
- func (f *FS) Stat(name string) (os.FileInfo, error)
- func (f *FS) Symlink(target, linkpath string) error
- func (f *FS) WriteFile(name string, data []byte, perm os.FileMode) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FS ¶
type FS struct {
// contains filtered or unexported fields
}
FS is the overlay FileSystem.
func (*FS) AllPaths ¶
AllPaths returns the overlay's contents — host paths require a disk walk we do not perform here. Globbing tests should populate the overlay or use memfs directly.
func (*FS) MountPoint ¶
MountPoint returns "/" for the overlay; multi-mount support comes later via mountfs.
Click to show internal directories.
Click to hide internal directories.