Documentation ¶
Index ¶
- type FileOperation
- type Filesystem
- func (f *Filesystem) Chroot(path string) (billy.Filesystem, error)
- func (f *Filesystem) Create(filename string) (billy.File, error)
- func (f *Filesystem) Join(elem ...string) string
- func (f *Filesystem) Lstat(filename string) (os.FileInfo, error)
- func (f *Filesystem) MkdirAll(filename string, perm os.FileMode) error
- func (f *Filesystem) Open(filename string) (billy.File, error)
- func (f *Filesystem) OpenFile(filename string, flag int, perm os.FileMode) (billy.File, error)
- func (f *Filesystem) ReadDir(path string) ([]os.FileInfo, error)
- func (f *Filesystem) Readlink(link string) (string, error)
- func (f *Filesystem) Remove(filename string) error
- func (f *Filesystem) Rename(oldpath, newpath string) error
- func (f *Filesystem) Root() string
- func (f *Filesystem) Stat(filename string) (os.FileInfo, error)
- func (f *Filesystem) Symlink(target, link string) error
- func (f *Filesystem) TempFile(dir, prefix string) (billy.File, error)
- type Operation
- type UsageCollector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileOperation ¶
type Filesystem ¶
type Filesystem struct { Inner billy.Filesystem // contains filtered or unexported fields }
A special filesystem that allows injecting errors at arbitrary operations.
func (*Filesystem) Chroot ¶
func (f *Filesystem) Chroot(path string) (billy.Filesystem, error)
func (*Filesystem) Create ¶
func (f *Filesystem) Create(filename string) (billy.File, error)
func (*Filesystem) Join ¶
func (f *Filesystem) Join(elem ...string) string
func (*Filesystem) MkdirAll ¶
func (f *Filesystem) MkdirAll(filename string, perm os.FileMode) error
func (*Filesystem) Open ¶
func (f *Filesystem) Open(filename string) (billy.File, error)
func (*Filesystem) Remove ¶
func (f *Filesystem) Remove(filename string) error
func (*Filesystem) Rename ¶
func (f *Filesystem) Rename(oldpath, newpath string) error
func (*Filesystem) Root ¶
func (f *Filesystem) Root() string
func (*Filesystem) Symlink ¶
func (f *Filesystem) Symlink(target, link string) error
func (*Filesystem) TempFile ¶
func (f *Filesystem) TempFile(dir, prefix string) (billy.File, error)
type UsageCollector ¶
type UsageCollector struct {
// contains filtered or unexported fields
}
UsageCollector tracks which file operations have been used in a test suite and reports which were not tested with an injected error.
func (*UsageCollector) UntestedOps ¶
func (u *UsageCollector) UntestedOps() []FileOperation
func (*UsageCollector) WithError ¶
func (uc *UsageCollector) WithError(fs billy.Filesystem, op Operation, filename string, err error) *Filesystem
Click to show internal directories.
Click to hide internal directories.