iovfs

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func From

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

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.

Types

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
}

Jump to

Keyboard shortcuts

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