iovfs

package
v0.0.0-...-c0ef09c Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FsWithSys

type FsWithSys interface {
	vfs.FS
	FSys() fs.FS
}

func From

func From(fsys fs.FS, useCaseSensitiveFileNames bool) FsWithSys

From creates a new FS from an fs.FS.

For paths like `c:/foo/bar`, fsys will be used as though it's rooted at `/` and the path is `/c:/foo/bar`.

If the provided fs.FS implements RealpathFS, it will be used to implement the Realpath method. If the provided fs.FS implements WritableFS, it will be used to implement the WriteFile method.

From does not actually handle case-insensitivity; ensure the passed in fs.FS respects case-insensitive file names if needed. Consider using [vfstest.FromMap] for testing.

type RealpathFS

type RealpathFS interface {
	fs.FS
	Realpath(path string) (string, error)
}

type WritableFS

type WritableFS interface {
	fs.FS
	WriteFile(path string, data []byte, perm fs.FileMode) error
	MkdirAll(path string, perm fs.FileMode) error
	// Removes `path` and all its contents. Will return the first error it encounters.
	Remove(path string) error
	Chtimes(path string, aTime time.Time, mTime time.Time) error
}

Jump to

Keyboard shortcuts

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