Versions in this module Expand all Collapse all v1 v1.2.0 Oct 30, 2024 v1.1.0 Jun 24, 2024 Changes in this version + var ErrInjected = errors.New("injected error") + func WrapFile(f vfs.File, inj Injector) vfs.File + type FS struct + func Wrap(fs vfs.FS, inj Injector) *FS + func (fs *FS) Create(name string) (vfs.File, error) + func (fs *FS) GetDiskUsage(path string) (vfs.DiskUsage, error) + func (fs *FS) Link(oldname, newname string) error + func (fs *FS) List(dir string) ([]string, error) + func (fs *FS) Lock(name string) (io.Closer, error) + func (fs *FS) MkdirAll(dir string, perm os.FileMode) error + func (fs *FS) Open(name string, opts ...vfs.OpenOption) (vfs.File, error) + func (fs *FS) OpenDir(name string) (vfs.File, error) + func (fs *FS) OpenReadWrite(name string, opts ...vfs.OpenOption) (vfs.File, error) + func (fs *FS) PathBase(p string) string + func (fs *FS) PathDir(p string) string + func (fs *FS) PathJoin(elem ...string) string + func (fs *FS) Remove(name string) error + func (fs *FS) RemoveAll(fullname string) error + func (fs *FS) Rename(oldname, newname string) error + func (fs *FS) ReuseForWrite(oldname, newname string) (vfs.File, error) + func (fs *FS) Stat(name string) (os.FileInfo, error) + func (fs *FS) Unwrap() vfs.FS + type InjectIndex struct + func OnIndex(index int32) *InjectIndex + func (ii *InjectIndex) Index() int32 + func (ii *InjectIndex) MaybeError(_ Op, _ string) error + func (ii *InjectIndex) SetIndex(v int32) + type Injector interface + MaybeError func(op Op, path string) error + func WithProbability(op OpKind, p float64) Injector + type InjectorFunc func(Op, string) error + func (f InjectorFunc) MaybeError(op Op, path string) error + type Op int + const OpCreate + const OpFileClose + const OpFileFlush + const OpFilePreallocate + const OpFileRead + const OpFileReadAt + const OpFileStat + const OpFileSync + const OpFileWrite + const OpFileWriteAt + const OpGetDiskUsage + const OpLink + const OpList + const OpLock + const OpMkdirAll + const OpOpen + const OpOpenDir + const OpRemove + const OpRemoveAll + const OpRename + const OpReuseForRewrite + const OpStat + func (o Op) OpKind() OpKind + type OpKind int + const OpKindRead + const OpKindWrite