Versions in this module Expand all Collapse all v0 v0.1.1 Aug 31, 2023 v0.1.0 Aug 15, 2023 Changes in this version + var FS FileSystem = MockFS() + var Time = TimeFunc() + var UUID = UUIDFunc() + func Mock(fsOpts ...FSOption) + func TimeFunc() func() (t time.Time) + func UUIDFunc() func() (uuid.UUID, error) + type FSOption func(*FakeFileSystem) + func WithDirectory(path string) FSOption + func WithFile(path string, data []byte) FSOption + type FakeFile struct + type FakeFileDescriptor struct + func (m *FakeFileDescriptor) Close() error + func (m *FakeFileDescriptor) Info() (fs.FileInfo, error) + func (m *FakeFileDescriptor) IsDir() bool + func (m *FakeFileDescriptor) ModTime() time.Time + func (m *FakeFileDescriptor) Mode() fs.FileMode + func (m *FakeFileDescriptor) Name() string + func (m *FakeFileDescriptor) Read(b []byte) (n int, err error) + func (m *FakeFileDescriptor) Seek(offset int64, whence int) (int64, error) + func (m *FakeFileDescriptor) Size() int64 + func (m *FakeFileDescriptor) Stat() (fs.FileInfo, error) + func (m *FakeFileDescriptor) Sys() any + func (m *FakeFileDescriptor) Type() fs.FileMode + func (m *FakeFileDescriptor) Write(src []byte) (n int, err error) + type FakeFileSystem struct + func MockFS(opts ...FSOption) (fs *FakeFileSystem) + func (m *FakeFileSystem) Create(path string) (File, error) + func (m *FakeFileSystem) Open(path string) (File, error) + func (m *FakeFileSystem) OpenFile(path string, flag int, perm os.FileMode) (File, error) + func (m *FakeFileSystem) ReadFile(path string) ([]byte, error) + func (m *FakeFileSystem) Remove(path string) error + func (m *FakeFileSystem) RemoveAll(path string) error + func (m *FakeFileSystem) Stat(path string) (fs.FileInfo, error) + func (m *FakeFileSystem) String() (pp string) + func (m *FakeFileSystem) Truncate(path string, size int64) error + func (m *FakeFileSystem) WalkDir(root string, fn fs.WalkDirFunc) (err error) + func (m *FakeFileSystem) WriteFile(path string, data []byte, perm os.FileMode) error + type File interface + Close func() error + Name func() string + Read func(b []byte) (n int, err error) + Seek func(offset int64, whence int) (ret int64, err error) + Stat func() (os.FileInfo, error) + Write func(b []byte) (n int, err error) + type FileSystem interface + Create func(path string) (File, error) + Open func(path string) (File, error) + OpenFile func(path string, flag int, perm fs.FileMode) (File, error) + ReadFile func(path string) ([]byte, error) + Remove func(path string) error + RemoveAll func(path string) error + Stat func(path string) (os.FileInfo, error) + Truncate func(path string, size int64) error + WalkDir func(root string, fn fs.WalkDirFunc) error + WriteFile func(path string, data []byte, perm os.FileMode) error + type RealFileSystem struct + func (*RealFileSystem) Create(path string) (File, error) + func (*RealFileSystem) Open(path string) (File, error) + func (*RealFileSystem) OpenFile(path string, flag int, perm os.FileMode) (File, error) + func (*RealFileSystem) ReadFile(path string) ([]byte, error) + func (*RealFileSystem) Remove(path string) error + func (*RealFileSystem) RemoveAll(path string) error + func (*RealFileSystem) Stat(path string) (fs.FileInfo, error) + func (*RealFileSystem) Truncate(path string, size int64) error + func (*RealFileSystem) WalkDir(root string, fn fs.WalkDirFunc) error + func (*RealFileSystem) WriteFile(path string, data []byte, perm os.FileMode) error