fake

package
v0.0.0-...-273f5df Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeFileSystem

type FakeFileSystem struct {
	// contains filtered or unexported fields
}

FakeFileSystem is a fake implementation of FileSystem interface that uses a Recorder to record the operations performed on it.

func NewFakeFileSystem

func NewFakeFileSystem(t *testing.T, rec testutils.Recorder, mountParentDir string, files map[string]string) *FakeFileSystem

NewFakeFileSystem creates a new instance of FakeFileSystem using the provided recorder and a directory that should be parent for all the fake mountpoints. It also takes map with fake files that will be accessible with GetDelimitedReader (besides those written with WriteFile).

func (*FakeFileSystem) ChownForEmulator

func (fs *FakeFileSystem) ChownForEmulator(filePath string, recursive bool) error

ChownForEmulator implements ChownForEmulator method of FileSystem interface.

func (*FakeFileSystem) GetDelimitedReader

func (fs *FakeFileSystem) GetDelimitedReader(path string) (fs.DelimitedReader, error)

GetDelimitedReader implements the FileReader method of FileSystem interface.

func (*FakeFileSystem) IsPathAnNs

func (fs *FakeFileSystem) IsPathAnNs(path string) bool

IsPathAnNs implements the IsPathAnNs method of FileSystem interface.

func (*FakeFileSystem) Mount

func (fs *FakeFileSystem) Mount(source string, target string, fstype string, bind bool) error

Mount implements the Mount method of FileSystem interface.

func (*FakeFileSystem) Unmount

func (fs *FakeFileSystem) Unmount(target string, detach bool) error

Unmount implements the Unmount method of FileSystem interface.

func (*FakeFileSystem) WriteFile

func (fs *FakeFileSystem) WriteFile(path string, data []byte, perm os.FileMode) error

WriteFile implements the WriteFile method of FilesManipulator interface.

Jump to

Keyboard shortcuts

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