fs

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS interface {
	ReadFile(filename string) ([]byte, error)
	WriteFile(filename string, data []byte, perm os.FileMode) error
	Exists(path string) (bool, error)
	TempDir(dir string, prefix string) (string, error)
	Remove(path string) error
}

func NewOS

func NewOS() FS

type MockFS

type MockFS struct {
	mock.Mock
}

MockFS is an autogenerated mock type for the FS type

func NewMockFS added in v0.3.0

func NewMockFS(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockFS

NewMockFS creates a new instance of MockFS. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockFS) Exists

func (_m *MockFS) Exists(path string) (bool, error)

Exists provides a mock function with given fields: path

func (*MockFS) ReadFile

func (_m *MockFS) ReadFile(filename string) ([]byte, error)

ReadFile provides a mock function with given fields: filename

func (*MockFS) Remove

func (_m *MockFS) Remove(path string) error

Remove provides a mock function with given fields: path

func (*MockFS) TempDir

func (_m *MockFS) TempDir(dir string, prefix string) (string, error)

TempDir provides a mock function with given fields: dir, prefix

func (*MockFS) WriteFile

func (_m *MockFS) WriteFile(filename string, data []byte, perm iofs.FileMode) error

WriteFile provides a mock function with given fields: filename, data, perm

Jump to

Keyboard shortcuts

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