mockfs

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	Error  error
	ErrMap errors.ErrMap
	*mapfs.FS
}

func New

func New(loc path.Absolute) (*FS, error)

func (*FS) Clear

func (t *FS) Clear()

func (*FS) Delete

func (m *FS) Delete(p path.Relative, recursive bool) error

func (*FS) Drive

func (m *FS) Drive(p path.Relative) (l path.Local, err error)

func (*FS) Exists

func (t *FS) Exists(p path.Relative) bool

func (*FS) FreeSpace

func (d *FS) FreeSpace(p path.Relative) int64

func (*FS) GetMeta

func (t *FS) GetMeta(name path.Relative) (map[string][]byte, error)

func (*FS) GetMode

func (d *FS) GetMode(name path.Relative) (fs.FileMode, error)

func (*FS) Glob added in v0.17.0

func (d *FS) Glob(pattern string) (matches []path.Relative, err error)

func (*FS) ModTime

func (m *FS) ModTime(p path.Relative) (t time.Time, err error)

func (*FS) Move

func (m *FS) Move(src path.Relative, targetFolder path.Relative) error

func (*FS) ReadFrom

func (t *FS) ReadFrom(fsys fs.FS, p path.Relative) error

func (*FS) ReadSeeker added in v0.11.0

func (d *FS) ReadSeeker(p path.Relative) (io.ReadSeekCloser, error)

func (*FS) Reader

func (m *FS) Reader(p path.Relative) (io.ReadCloser, error)

func (*FS) Rename

func (m *FS) Rename(p path.Relative, name string) error

should fail when the new name is not a name but a path

func (*FS) SetMeta

func (t *FS) SetMeta(name path.Relative, meta map[string][]byte) error

func (*FS) SetMode

func (d *FS) SetMode(name path.Relative, m fs.FileMode) error

func (*FS) Size

func (d *FS) Size(name path.Relative) int64

func (*FS) Write

func (m *FS) Write(p path.Relative, rd io.ReadCloser, recursive bool) (err error)

func (*FS) WriteTo

func (t *FS) WriteTo(fsys fs.FS) error

func (*FS) WriteWithMeta

func (m *FS) WriteWithMeta(p path.Relative, rd io.ReadCloser, meta map[string][]byte, recursive bool) error

func (*FS) WriteWithMode

func (m *FS) WriteWithMode(p path.Relative, rd io.ReadCloser, perm fs.FileMode, recursive bool) (err error)

Jump to

Keyboard shortcuts

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