mock

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMockFuncArgumentValue

func GetMockFuncArgumentValue[T any](args []MockFuncArgument, name string) (T, bool)

Types

type MockFileIo

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

func NewMockFileIo

func NewMockFileIo() *MockFileIo

func (MockFileIo) Checksum

func (f MockFileIo) Checksum(path string, method helpers_io.ChecksumMethod) (string, error)

func (MockFileIo) CopyDir

func (f MockFileIo) CopyDir(source, destination string) error

func (MockFileIo) CopyFile

func (f MockFileIo) CopyFile(source, destination string) error

func (MockFileIo) CreateDir

func (f MockFileIo) CreateDir(folderPath string, mode os.FileMode) error

func (MockFileIo) DeleteDir

func (f MockFileIo) DeleteDir(path string) error

func (MockFileIo) DeleteFile

func (f MockFileIo) DeleteFile(path string) error

func (MockFileIo) DirExists

func (f MockFileIo) DirExists(folderPath string) bool

func (MockFileIo) FileExists

func (f MockFileIo) FileExists(path string) bool

func (MockFileIo) GetExecutionPath

func (f MockFileIo) GetExecutionPath() string

func (MockFileIo) GetOperatingSystem

func (f MockFileIo) GetOperatingSystem() helpers_io.OperatingSystem

func (MockFileIo) GetOsPathSeparator

func (f MockFileIo) GetOsPathSeparator() string

func (MockFileIo) JoinPath

func (f MockFileIo) JoinPath(parts ...string) string

func (*MockFileIo) On

func (MockFileIo) ReadBufferedFile

func (f MockFileIo) ReadBufferedFile(path string, from, to int) ([]byte, error)

func (MockFileIo) ReadDir

func (f MockFileIo) ReadDir(path string) ([]fs.DirEntry, error)

func (MockFileIo) ReadFile

func (f MockFileIo) ReadFile(path string) ([]byte, error)

func (MockFileIo) ToOsPath

func (f MockFileIo) ToOsPath(path string) string

func (MockFileIo) WriteBufferedFile

func (f MockFileIo) WriteBufferedFile(path string, data []byte, bufferSize int, mode os.FileMode) error

func (MockFileIo) WriteFile

func (f MockFileIo) WriteFile(path string, data []byte, mode os.FileMode) error

type MockFuncArgument

type MockFuncArgument struct {
	Name  string
	Value interface{}
}

type MockOperation

type MockOperation struct {
	Method      string
	Func        func(args ...MockFuncArgument) interface{}
	FuncWithErr func(args ...MockFuncArgument) (interface{}, error)
	ReturnError error
	CalledWith  []MockFuncArgument
	ReturnValue interface{}
}

Jump to

Keyboard shortcuts

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