Documentation ¶
Index ¶
- Variables
- func Exclude(fsys fs.FS, fn func(path string) bool) fs.FS
- func MarshalJSON(file fs.File) ([]byte, error)
- func Open(f *File) fs.File
- func Print(fsys fs.FS, subpaths ...string) (string, error)
- func Sync(from fs.FS, toDir string, subpaths ...string) error
- func SyncFS(from fs.FS, to FS, subpaths ...string) error
- func UnmarshalJSON(file []byte) (fs.File, error)
- func Write(fsys fs.FS, toDir string, subpaths ...string) error
- func WriteFS(from fs.FS, to FS, subpaths ...string) error
- type DirEntry
- type FS
- type File
- type List
- type Map
- type OS
- type Tree
Constants ¶
This section is empty.
Variables ¶
var Now = func() time.Time { return time.Now() }
Now may be overridden for testing purposes
Functions ¶
Types ¶
type DirEntry ¶
type FS ¶
type FS interface { fs.FS MkdirAll(path string, perm fs.FileMode) error WriteFile(name string, data []byte, perm fs.FileMode) error RemoveAll(path string) error }
FS is a virtual filesystem interface. It extends the fs.FS interface with methods for creating and removing files and directories.
type File ¶
func (*File) Embed ¶
Embed as a string literal. https://github.com/go-bindata/go-bindata/blob/26949cc13d95310ffcc491c325da869a5aafce8f/stringwriter.go#L18-L36
type List ¶
type List []*File
List is meant to be a simple list of files. It's not a tree of files and you can't walk it. Use Tree if you need a more capable filesystem. This filesytem is not safe for concurrent use.
type OS ¶
type OS string
OS creates a new OS filesystem rooted at the given directory. TODO: create an os_windows for opening on multiple drives with the same API: https://github.com/golang/go/issues/44279#issuecomment-955766528