fake

package
v0.0.0-...-3514596 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTempDirectory

func CreateTempDirectory(parentDirectory string, c *check.C) string

func CreateTempFile

func CreateTempFile(directory, fileName, content string, c *check.C) *os.File

func DirEntry

func DirEntry(name string, isDir bool) fs.DirEntry

Types

type Executor

type Executor struct{}

func (*Executor) Execute

func (nsexec *Executor) Execute([]string, string, []string, time.Duration) (string, error)

func (*Executor) ExecuteWithStdin

func (nsexec *Executor) ExecuteWithStdin(string, []string, string, time.Duration) (string, error)

func (*Executor) ExecuteWithStdinPipe

func (nsexec *Executor) ExecuteWithStdinPipe(string, []string, string, time.Duration) (string, error)

func (*Executor) ExecuteWithTimeout

func (nsexec *Executor) ExecuteWithTimeout([]string, string, []string, time.Duration) (string, error)

func (*Executor) ExecuteWithoutTimeout

func (nsexec *Executor) ExecuteWithoutTimeout([]string, string, []string, time.Duration) (string, error)

type FileSystem

type FileSystem struct {
	DirEntries []fs.DirEntry
	Data       []byte
}

FileSystem is a mock implementation of the fs.FS interface

func (*FileSystem) ReadDir

func (fs *FileSystem) ReadDir(string) ([]fs.DirEntry, error)

func (*FileSystem) ReadFile

func (fs *FileSystem) ReadFile(filePath string) ([]byte, error)

type Joiner

type Joiner struct {
	MockDelay  time.Duration
	MockResult interface{}
	MockError  error
}

func (*Joiner) Revert

func (nsjoin *Joiner) Revert() error

func (*Joiner) Run

func (nsjoin *Joiner) Run(fn func() (interface{}, error)) (interface{}, error)

Jump to

Keyboard shortcuts

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