filesystem

package
v0.0.0-...-164eeef Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 6 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 {
	CopyToFile(destination io.Writer, source io.Reader) (int64, error)
	CreateDirectory(path string, perm os.FileMode) error
	CreateFile(name string) (io.WriteCloser, error)
	FindFiles(pattern string) ([]string, error)
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	OpenZip(name string) (*zip.ReadCloser, error)
	ReadFile(name string) ([]byte, error)
	ReadZipFile(file *zip.File) (io.ReadCloser, error)
	RemoveDirectory(path string) error
	Unzip(source, destination string) error
	UnzipFile(zipFile *zip.File, destination string) error
}

func NewFs

func NewFs() Fs

type MockFs

type MockFs struct {
	mock.Mock
}

MockFs is an autogenerated mock type for the Fs type

func NewMockFs

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) CopyToFile

func (_m *MockFs) CopyToFile(destination io.Writer, source io.Reader) (int64, error)

CopyToFile provides a mock function with given fields: destination, source

func (*MockFs) CreateDirectory

func (_m *MockFs) CreateDirectory(path string, perm fs.FileMode) error

CreateDirectory provides a mock function with given fields: path, perm

func (*MockFs) CreateFile

func (_m *MockFs) CreateFile(name string) (io.WriteCloser, error)

CreateFile provides a mock function with given fields: name

func (*MockFs) EXPECT

func (_m *MockFs) EXPECT() *MockFs_Expecter

func (*MockFs) FindFiles

func (_m *MockFs) FindFiles(pattern string) ([]string, error)

FindFiles provides a mock function with given fields: pattern

func (*MockFs) OpenFile

func (_m *MockFs) OpenFile(name string, flag int, perm fs.FileMode) (*os.File, error)

OpenFile provides a mock function with given fields: name, flag, perm

func (*MockFs) OpenZip

func (_m *MockFs) OpenZip(name string) (*zip.ReadCloser, error)

OpenZip provides a mock function with given fields: name

func (*MockFs) ReadFile

func (_m *MockFs) ReadFile(name string) ([]byte, error)

ReadFile provides a mock function with given fields: name

func (*MockFs) ReadZipFile

func (_m *MockFs) ReadZipFile(file *zip.File) (io.ReadCloser, error)

ReadZipFile provides a mock function with given fields: file

func (*MockFs) RemoveDirectory

func (_m *MockFs) RemoveDirectory(path string) error

RemoveDirectory provides a mock function with given fields: path

func (*MockFs) Unzip

func (_m *MockFs) Unzip(source string, destination string) error

Unzip provides a mock function with given fields: source, destination

func (*MockFs) UnzipFile

func (_m *MockFs) UnzipFile(zipFile *zip.File, destination string) error

UnzipFile provides a mock function with given fields: zipFile, destination

type MockFs_CopyToFile_Call

type MockFs_CopyToFile_Call struct {
	*mock.Call
}

MockFs_CopyToFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CopyToFile'

func (*MockFs_CopyToFile_Call) Return

func (*MockFs_CopyToFile_Call) Run

func (_c *MockFs_CopyToFile_Call) Run(run func(destination io.Writer, source io.Reader)) *MockFs_CopyToFile_Call

func (*MockFs_CopyToFile_Call) RunAndReturn

func (_c *MockFs_CopyToFile_Call) RunAndReturn(run func(io.Writer, io.Reader) (int64, error)) *MockFs_CopyToFile_Call

type MockFs_CreateDirectory_Call

type MockFs_CreateDirectory_Call struct {
	*mock.Call
}

MockFs_CreateDirectory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateDirectory'

func (*MockFs_CreateDirectory_Call) Return

func (*MockFs_CreateDirectory_Call) Run

func (*MockFs_CreateDirectory_Call) RunAndReturn

type MockFs_CreateFile_Call

type MockFs_CreateFile_Call struct {
	*mock.Call
}

MockFs_CreateFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CreateFile'

func (*MockFs_CreateFile_Call) Return

func (*MockFs_CreateFile_Call) Run

func (_c *MockFs_CreateFile_Call) Run(run func(name string)) *MockFs_CreateFile_Call

func (*MockFs_CreateFile_Call) RunAndReturn

func (_c *MockFs_CreateFile_Call) RunAndReturn(run func(string) (io.WriteCloser, error)) *MockFs_CreateFile_Call

type MockFs_Expecter

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

func (*MockFs_Expecter) CopyToFile

func (_e *MockFs_Expecter) CopyToFile(destination interface{}, source interface{}) *MockFs_CopyToFile_Call

CopyToFile is a helper method to define mock.On call

  • destination io.Writer
  • source io.Reader

func (*MockFs_Expecter) CreateDirectory

func (_e *MockFs_Expecter) CreateDirectory(path interface{}, perm interface{}) *MockFs_CreateDirectory_Call

CreateDirectory is a helper method to define mock.On call

  • path string
  • perm fs.FileMode

func (*MockFs_Expecter) CreateFile

func (_e *MockFs_Expecter) CreateFile(name interface{}) *MockFs_CreateFile_Call

CreateFile is a helper method to define mock.On call

  • name string

func (*MockFs_Expecter) FindFiles

func (_e *MockFs_Expecter) FindFiles(pattern interface{}) *MockFs_FindFiles_Call

FindFiles is a helper method to define mock.On call

  • pattern string

func (*MockFs_Expecter) OpenFile

func (_e *MockFs_Expecter) OpenFile(name interface{}, flag interface{}, perm interface{}) *MockFs_OpenFile_Call

OpenFile is a helper method to define mock.On call

  • name string
  • flag int
  • perm fs.FileMode

func (*MockFs_Expecter) OpenZip

func (_e *MockFs_Expecter) OpenZip(name interface{}) *MockFs_OpenZip_Call

OpenZip is a helper method to define mock.On call

  • name string

func (*MockFs_Expecter) ReadFile

func (_e *MockFs_Expecter) ReadFile(name interface{}) *MockFs_ReadFile_Call

ReadFile is a helper method to define mock.On call

  • name string

func (*MockFs_Expecter) ReadZipFile

func (_e *MockFs_Expecter) ReadZipFile(file interface{}) *MockFs_ReadZipFile_Call

ReadZipFile is a helper method to define mock.On call

  • file *zip.File

func (*MockFs_Expecter) RemoveDirectory

func (_e *MockFs_Expecter) RemoveDirectory(path interface{}) *MockFs_RemoveDirectory_Call

RemoveDirectory is a helper method to define mock.On call

  • path string

func (*MockFs_Expecter) Unzip

func (_e *MockFs_Expecter) Unzip(source interface{}, destination interface{}) *MockFs_Unzip_Call

Unzip is a helper method to define mock.On call

  • source string
  • destination string

func (*MockFs_Expecter) UnzipFile

func (_e *MockFs_Expecter) UnzipFile(zipFile interface{}, destination interface{}) *MockFs_UnzipFile_Call

UnzipFile is a helper method to define mock.On call

  • zipFile *zip.File
  • destination string

type MockFs_FindFiles_Call

type MockFs_FindFiles_Call struct {
	*mock.Call
}

MockFs_FindFiles_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'FindFiles'

func (*MockFs_FindFiles_Call) Return

func (_c *MockFs_FindFiles_Call) Return(_a0 []string, _a1 error) *MockFs_FindFiles_Call

func (*MockFs_FindFiles_Call) Run

func (_c *MockFs_FindFiles_Call) Run(run func(pattern string)) *MockFs_FindFiles_Call

func (*MockFs_FindFiles_Call) RunAndReturn

func (_c *MockFs_FindFiles_Call) RunAndReturn(run func(string) ([]string, error)) *MockFs_FindFiles_Call

type MockFs_OpenFile_Call

type MockFs_OpenFile_Call struct {
	*mock.Call
}

MockFs_OpenFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenFile'

func (*MockFs_OpenFile_Call) Return

func (_c *MockFs_OpenFile_Call) Return(_a0 *os.File, _a1 error) *MockFs_OpenFile_Call

func (*MockFs_OpenFile_Call) Run

func (_c *MockFs_OpenFile_Call) Run(run func(name string, flag int, perm fs.FileMode)) *MockFs_OpenFile_Call

func (*MockFs_OpenFile_Call) RunAndReturn

func (_c *MockFs_OpenFile_Call) RunAndReturn(run func(string, int, fs.FileMode) (*os.File, error)) *MockFs_OpenFile_Call

type MockFs_OpenZip_Call

type MockFs_OpenZip_Call struct {
	*mock.Call
}

MockFs_OpenZip_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'OpenZip'

func (*MockFs_OpenZip_Call) Return

func (*MockFs_OpenZip_Call) Run

func (_c *MockFs_OpenZip_Call) Run(run func(name string)) *MockFs_OpenZip_Call

func (*MockFs_OpenZip_Call) RunAndReturn

func (_c *MockFs_OpenZip_Call) RunAndReturn(run func(string) (*zip.ReadCloser, error)) *MockFs_OpenZip_Call

type MockFs_ReadFile_Call

type MockFs_ReadFile_Call struct {
	*mock.Call
}

MockFs_ReadFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadFile'

func (*MockFs_ReadFile_Call) Return

func (_c *MockFs_ReadFile_Call) Return(_a0 []byte, _a1 error) *MockFs_ReadFile_Call

func (*MockFs_ReadFile_Call) Run

func (_c *MockFs_ReadFile_Call) Run(run func(name string)) *MockFs_ReadFile_Call

func (*MockFs_ReadFile_Call) RunAndReturn

func (_c *MockFs_ReadFile_Call) RunAndReturn(run func(string) ([]byte, error)) *MockFs_ReadFile_Call

type MockFs_ReadZipFile_Call

type MockFs_ReadZipFile_Call struct {
	*mock.Call
}

MockFs_ReadZipFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'ReadZipFile'

func (*MockFs_ReadZipFile_Call) Return

func (*MockFs_ReadZipFile_Call) Run

func (_c *MockFs_ReadZipFile_Call) Run(run func(file *zip.File)) *MockFs_ReadZipFile_Call

func (*MockFs_ReadZipFile_Call) RunAndReturn

func (_c *MockFs_ReadZipFile_Call) RunAndReturn(run func(*zip.File) (io.ReadCloser, error)) *MockFs_ReadZipFile_Call

type MockFs_RemoveDirectory_Call

type MockFs_RemoveDirectory_Call struct {
	*mock.Call
}

MockFs_RemoveDirectory_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'RemoveDirectory'

func (*MockFs_RemoveDirectory_Call) Return

func (*MockFs_RemoveDirectory_Call) Run

func (*MockFs_RemoveDirectory_Call) RunAndReturn

type MockFs_UnzipFile_Call

type MockFs_UnzipFile_Call struct {
	*mock.Call
}

MockFs_UnzipFile_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnzipFile'

func (*MockFs_UnzipFile_Call) Return

func (*MockFs_UnzipFile_Call) Run

func (_c *MockFs_UnzipFile_Call) Run(run func(zipFile *zip.File, destination string)) *MockFs_UnzipFile_Call

func (*MockFs_UnzipFile_Call) RunAndReturn

func (_c *MockFs_UnzipFile_Call) RunAndReturn(run func(*zip.File, string) error) *MockFs_UnzipFile_Call

type MockFs_Unzip_Call

type MockFs_Unzip_Call struct {
	*mock.Call
}

MockFs_Unzip_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Unzip'

func (*MockFs_Unzip_Call) Return

func (_c *MockFs_Unzip_Call) Return(_a0 error) *MockFs_Unzip_Call

func (*MockFs_Unzip_Call) Run

func (_c *MockFs_Unzip_Call) Run(run func(source string, destination string)) *MockFs_Unzip_Call

func (*MockFs_Unzip_Call) RunAndReturn

func (_c *MockFs_Unzip_Call) RunAndReturn(run func(string, string) error) *MockFs_Unzip_Call

Jump to

Keyboard shortcuts

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