Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToFS ¶
func ToFS(fs Filesystem) fs.FS
Types ¶
type Filesystem ¶
type Filesystem interface { // OpenFile is the generalized open call; most users will use Open or Create // instead. It opens the named file with specified flag (O_RDONLY etc.) and // perm, (0666 etc.) if applicable. If successful, methods on the returned // File can be used for I/O. OpenFile(filename string, flag int, perm os.FileMode) (File, error) // Stat returns a FileInfo describing the named file. Stat(filename string) (os.FileInfo, error) // Remove removes the named file or directory. Remove(filename string) error // ReadDir reads the directory named by dirname and returns a list of // directory entries sorted by filename. ReadDir(path string) ([]os.FileInfo, error) // MkdirAll creates a directory named path, along with any necessary // parents, and returns nil, or else returns an error. The permission bits // perm are used for all directories that MkdirAll creates. If path is/ // already a directory, MkdirAll does nothing and returns nil. MkdirAll(filename string, perm os.FileMode) error }
Filesystem is a subset of a filesystem API surface area Our storage engine requires the ability to open regular files and directories for reading and writing both metadata and contents
func SubFilesystem ¶
func SubFilesystem(fs Filesystem, dir string) Filesystem
SubFilesystem decorates the provided filesystem with one which scopes all provided paths with a parent directory before delegating.
Click to show internal directories.
Click to hide internal directories.