Versions in this module Expand all Collapse all v0 v0.40.4 May 19, 2022 Changes in this version + var ErrDirNotExist = errors.New("directory does not exist") + var ErrIsDir = errors.New("operation not valid on a directory") + var ErrIsFile = errors.New("operation not valid on a file") + var InMemNowFunc = time.Now + var LocalFS = &localFS + func UnmarshalJSONFile(fs ReadableFS, path string, dest interface{}) error + type FSIterCB func(path string, size int64, isDir bool) (stop bool) + type Filesys interface + WithWorkingDir func(path string) (Filesys, error) + func LocalFilesysWithWorkingDir(cwd string) (Filesys, error) + type FilesysLock interface + TryLock func() (bool, error) + Unlock func() error + func CreateFilesysLock(fs Filesys, filename string) FilesysLock + type InMemFS struct + func EmptyInMemFS(workingDir string) *InMemFS + func NewInMemFS(dirs []string, files map[string][]byte, cwd string) *InMemFS + func (fs *InMemFS) Abs(path string) (string, error) + func (fs *InMemFS) Delete(path string, force bool) error + func (fs *InMemFS) DeleteFile(path string) error + func (fs *InMemFS) Exists(path string) (exists bool, isDir bool) + func (fs *InMemFS) Iter(path string, recursive bool, cb FSIterCB) error + func (fs *InMemFS) LastModified(path string) (t time.Time, exists bool) + func (fs *InMemFS) MkDirs(path string) error + func (fs *InMemFS) MoveFile(srcPath, destPath string) error + func (fs *InMemFS) OpenForRead(fp string) (io.ReadCloser, error) + func (fs *InMemFS) OpenForWrite(fp string, perm os.FileMode) (io.WriteCloser, error) + func (fs *InMemFS) OpenForWriteAppend(fp string, perm os.FileMode) (io.WriteCloser, error) + func (fs *InMemFS) ReadFile(fp string) ([]byte, error) + func (fs *InMemFS) WriteFile(fp string, data []byte) error + func (fs InMemFS) WithWorkingDir(path string) (Filesys, error) + type InMemFileLock struct + func NewInMemFileLock(fs Filesys) *InMemFileLock + func (memLock *InMemFileLock) TryLock() (bool, error) + func (memLock *InMemFileLock) Unlock() error + type LocalFileLock struct + func NewLocalFileLock(fs Filesys, filename string) *LocalFileLock + func (locLock *LocalFileLock) TryLock() (bool, error) + func (locLock *LocalFileLock) Unlock() error + type ReadWriteFS interface + type ReadableFS interface + Abs func(path string) (string, error) + Exists func(path string) (exists bool, isDir bool) + LastModified func(path string) (t time.Time, exists bool) + OpenForRead func(fp string) (io.ReadCloser, error) + ReadFile func(fp string) ([]byte, error) + type WalkableFS interface + Iter func(directory string, recursive bool, cb FSIterCB) error + type WritableFS interface + Delete func(path string, force bool) error + DeleteFile func(path string) error + MkDirs func(path string) error + MoveFile func(srcPath, destPath string) error + OpenForWrite func(fp string, perm os.FileMode) (io.WriteCloser, error) + OpenForWriteAppend func(fp string, perm os.FileMode) (io.WriteCloser, error) + WriteFile func(fp string, data []byte) error