Documentation
¶
Index ¶
- func FromMap[File any](m map[string]File, useCaseSensitiveFileNames bool) vfs.FS
- func FromMapWithClock[File any](m map[string]File, useCaseSensitiveFileNames bool, clock Clock) vfs.FS
- func Symlink(target string) *fstest.MapFile
- type Clock
- type MapFS
- func (m *MapFS) Chtimes(path string, aTime time.Time, mTime time.Time) error
- func (m *MapFS) Entries() iter.Seq2[string, *fstest.MapFile]
- func (m *MapFS) GetFileInfo(path string) *fstest.MapFile
- func (m *MapFS) GetModTime(path string) time.Time
- func (m *MapFS) GetTargetOfSymlink(path string) (string, bool)
- func (m *MapFS) MkdirAll(path string, perm fs.FileMode) error
- func (m *MapFS) Open(name string) (fs.File, error)
- func (m *MapFS) Realpath(name string) (string, error)
- func (m *MapFS) Remove(path string) error
- func (m *MapFS) WriteFile(path string, data []byte, perm fs.FileMode) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromMap ¶
FromMap creates a new vfs.FS from a map of paths to file contents. Those file contents may be strings, byte slices, or [fstest.MapFile]s.
The paths must be normalized absolute paths according to the tspath package, without trailing directory separators. The paths must be all POSIX-style or all Windows-style, but not both.
func FromMapWithClock ¶
func FromMapWithClock[File any](m map[string]File, useCaseSensitiveFileNames bool, clock Clock) vfs.FS
FromMapWithClock creates a new vfs.FS from a map of paths to file contents. Those file contents may be strings, byte slices, or [fstest.MapFile]s.
The paths must be normalized absolute paths according to the tspath package, without trailing directory separators. The paths must be all POSIX-style or all Windows-style, but not both.