Documentation
¶
Overview ¶
Package fileio is a generated GoMock package.
Index ¶
- Constants
- Variables
- func NewReader() *reader
- func NewWriter() *writer
- type FileOption
- type ManagedFile
- type MockManagedFile
- type MockManagedFileMockRecorder
- type MockReadWriter
- func (m *MockReadWriter) CopyFile(src, dst string) error
- func (m *MockReadWriter) CreateManagedFile(file types.File) (ManagedFile, error)
- func (m *MockReadWriter) EXPECT() *MockReadWriterMockRecorder
- func (m *MockReadWriter) FileExists(filePath string) (bool, error)
- func (m *MockReadWriter) MkdirAll(path string, perm fs.FileMode) error
- func (m *MockReadWriter) PathFor(filePath string) string
- func (m *MockReadWriter) ReadDir(dirPath string) ([]fs.DirEntry, error)
- func (m *MockReadWriter) ReadFile(filePath string) ([]byte, error)
- func (m *MockReadWriter) RemoveAll(path string) error
- func (m *MockReadWriter) RemoveFile(file string) error
- func (m *MockReadWriter) SetRootdir(path string)
- func (m *MockReadWriter) WriteFile(name string, data []byte, perm fs.FileMode, opts ...FileOption) error
- type MockReadWriterMockRecorder
- func (mr *MockReadWriterMockRecorder) CopyFile(src, dst any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) CreateManagedFile(file any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) FileExists(filePath any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) MkdirAll(path, perm any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) PathFor(filePath any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) ReadDir(dirPath any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) ReadFile(filePath any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) RemoveAll(path any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) RemoveFile(file any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) SetRootdir(path any) *gomock.Call
- func (mr *MockReadWriterMockRecorder) WriteFile(name, data, perm any, opts ...any) *gomock.Call
- type MockReader
- func (m *MockReader) EXPECT() *MockReaderMockRecorder
- func (m *MockReader) FileExists(filePath string) (bool, error)
- func (m *MockReader) PathFor(filePath string) string
- func (m *MockReader) ReadDir(dirPath string) ([]fs.DirEntry, error)
- func (m *MockReader) ReadFile(filePath string) ([]byte, error)
- func (m *MockReader) SetRootdir(path string)
- type MockReaderMockRecorder
- func (mr *MockReaderMockRecorder) FileExists(filePath any) *gomock.Call
- func (mr *MockReaderMockRecorder) PathFor(filePath any) *gomock.Call
- func (mr *MockReaderMockRecorder) ReadDir(dirPath any) *gomock.Call
- func (mr *MockReaderMockRecorder) ReadFile(filePath any) *gomock.Call
- func (mr *MockReaderMockRecorder) SetRootdir(path any) *gomock.Call
- type MockWriter
- func (m *MockWriter) CopyFile(src, dst string) error
- func (m *MockWriter) CreateManagedFile(file types.File) (ManagedFile, error)
- func (m *MockWriter) EXPECT() *MockWriterMockRecorder
- func (m *MockWriter) MkdirAll(path string, perm fs.FileMode) error
- func (m *MockWriter) PathFor(filePath string) string
- func (m *MockWriter) RemoveAll(path string) error
- func (m *MockWriter) RemoveFile(file string) error
- func (m *MockWriter) SetRootdir(path string)
- func (m *MockWriter) WriteFile(name string, data []byte, perm fs.FileMode, opts ...FileOption) error
- type MockWriterMockRecorder
- func (mr *MockWriterMockRecorder) CopyFile(src, dst any) *gomock.Call
- func (mr *MockWriterMockRecorder) CreateManagedFile(file any) *gomock.Call
- func (mr *MockWriterMockRecorder) MkdirAll(path, perm any) *gomock.Call
- func (mr *MockWriterMockRecorder) PathFor(filePath any) *gomock.Call
- func (mr *MockWriterMockRecorder) RemoveAll(path any) *gomock.Call
- func (mr *MockWriterMockRecorder) RemoveFile(file any) *gomock.Call
- func (mr *MockWriterMockRecorder) SetRootdir(path any) *gomock.Call
- func (mr *MockWriterMockRecorder) WriteFile(name, data, perm any, opts ...any) *gomock.Call
- type Option
- type ReadWriter
- type Reader
- type Writer
Constants ¶
const ( // DefaultDirectoryPermissions houses the default mode to use when no directory permissions are provided DefaultDirectoryPermissions os.FileMode = 0o755 // defaultFilePermissions houses the default mode to use when no file permissions are provided DefaultFilePermissions os.FileMode = 0o644 )
Variables ¶
var ErrPathIsDir = errors.New("provided path is a directory")
Functions ¶
Types ¶
type FileOption ¶ added in v0.3.0
type FileOption func(*fileOptions)
type ManagedFile ¶
type MockManagedFile ¶
type MockManagedFile struct {
// contains filtered or unexported fields
}
MockManagedFile is a mock of ManagedFile interface.
func NewMockManagedFile ¶
func NewMockManagedFile(ctrl *gomock.Controller) *MockManagedFile
NewMockManagedFile creates a new mock instance.
func (*MockManagedFile) EXPECT ¶
func (m *MockManagedFile) EXPECT() *MockManagedFileMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockManagedFile) Exists ¶
func (m *MockManagedFile) Exists() (bool, error)
Exists mocks base method.
func (*MockManagedFile) IsUpToDate ¶
func (m *MockManagedFile) IsUpToDate() (bool, error)
IsUpToDate mocks base method.
type MockManagedFileMockRecorder ¶
type MockManagedFileMockRecorder struct {
// contains filtered or unexported fields
}
MockManagedFileMockRecorder is the mock recorder for MockManagedFile.
func (*MockManagedFileMockRecorder) Exists ¶
func (mr *MockManagedFileMockRecorder) Exists() *gomock.Call
Exists indicates an expected call of Exists.
func (*MockManagedFileMockRecorder) IsUpToDate ¶
func (mr *MockManagedFileMockRecorder) IsUpToDate() *gomock.Call
IsUpToDate indicates an expected call of IsUpToDate.
func (*MockManagedFileMockRecorder) Path ¶
func (mr *MockManagedFileMockRecorder) Path() *gomock.Call
Path indicates an expected call of Path.
func (*MockManagedFileMockRecorder) Write ¶
func (mr *MockManagedFileMockRecorder) Write() *gomock.Call
Write indicates an expected call of Write.
type MockReadWriter ¶
type MockReadWriter struct {
// contains filtered or unexported fields
}
MockReadWriter is a mock of ReadWriter interface.
func NewMockReadWriter ¶
func NewMockReadWriter(ctrl *gomock.Controller) *MockReadWriter
NewMockReadWriter creates a new mock instance.
func (*MockReadWriter) CopyFile ¶
func (m *MockReadWriter) CopyFile(src, dst string) error
CopyFile mocks base method.
func (*MockReadWriter) CreateManagedFile ¶
func (m *MockReadWriter) CreateManagedFile(file types.File) (ManagedFile, error)
CreateManagedFile mocks base method.
func (*MockReadWriter) EXPECT ¶
func (m *MockReadWriter) EXPECT() *MockReadWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockReadWriter) FileExists ¶
func (m *MockReadWriter) FileExists(filePath string) (bool, error)
FileExists mocks base method.
func (*MockReadWriter) MkdirAll ¶ added in v0.3.0
func (m *MockReadWriter) MkdirAll(path string, perm fs.FileMode) error
MkdirAll mocks base method.
func (*MockReadWriter) PathFor ¶
func (m *MockReadWriter) PathFor(filePath string) string
PathFor mocks base method.
func (*MockReadWriter) ReadDir ¶ added in v0.3.0
func (m *MockReadWriter) ReadDir(dirPath string) ([]fs.DirEntry, error)
ReadDir mocks base method.
func (*MockReadWriter) ReadFile ¶
func (m *MockReadWriter) ReadFile(filePath string) ([]byte, error)
ReadFile mocks base method.
func (*MockReadWriter) RemoveAll ¶ added in v0.3.0
func (m *MockReadWriter) RemoveAll(path string) error
RemoveAll mocks base method.
func (*MockReadWriter) RemoveFile ¶
func (m *MockReadWriter) RemoveFile(file string) error
RemoveFile mocks base method.
func (*MockReadWriter) SetRootdir ¶
func (m *MockReadWriter) SetRootdir(path string)
SetRootdir mocks base method.
func (*MockReadWriter) WriteFile ¶
func (m *MockReadWriter) WriteFile(name string, data []byte, perm fs.FileMode, opts ...FileOption) error
WriteFile mocks base method.
type MockReadWriterMockRecorder ¶
type MockReadWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockReadWriterMockRecorder is the mock recorder for MockReadWriter.
func (*MockReadWriterMockRecorder) CopyFile ¶
func (mr *MockReadWriterMockRecorder) CopyFile(src, dst any) *gomock.Call
CopyFile indicates an expected call of CopyFile.
func (*MockReadWriterMockRecorder) CreateManagedFile ¶
func (mr *MockReadWriterMockRecorder) CreateManagedFile(file any) *gomock.Call
CreateManagedFile indicates an expected call of CreateManagedFile.
func (*MockReadWriterMockRecorder) FileExists ¶
func (mr *MockReadWriterMockRecorder) FileExists(filePath any) *gomock.Call
FileExists indicates an expected call of FileExists.
func (*MockReadWriterMockRecorder) MkdirAll ¶ added in v0.3.0
func (mr *MockReadWriterMockRecorder) MkdirAll(path, perm any) *gomock.Call
MkdirAll indicates an expected call of MkdirAll.
func (*MockReadWriterMockRecorder) PathFor ¶
func (mr *MockReadWriterMockRecorder) PathFor(filePath any) *gomock.Call
PathFor indicates an expected call of PathFor.
func (*MockReadWriterMockRecorder) ReadDir ¶ added in v0.3.0
func (mr *MockReadWriterMockRecorder) ReadDir(dirPath any) *gomock.Call
ReadDir indicates an expected call of ReadDir.
func (*MockReadWriterMockRecorder) ReadFile ¶
func (mr *MockReadWriterMockRecorder) ReadFile(filePath any) *gomock.Call
ReadFile indicates an expected call of ReadFile.
func (*MockReadWriterMockRecorder) RemoveAll ¶ added in v0.3.0
func (mr *MockReadWriterMockRecorder) RemoveAll(path any) *gomock.Call
RemoveAll indicates an expected call of RemoveAll.
func (*MockReadWriterMockRecorder) RemoveFile ¶
func (mr *MockReadWriterMockRecorder) RemoveFile(file any) *gomock.Call
RemoveFile indicates an expected call of RemoveFile.
func (*MockReadWriterMockRecorder) SetRootdir ¶
func (mr *MockReadWriterMockRecorder) SetRootdir(path any) *gomock.Call
SetRootdir indicates an expected call of SetRootdir.
type MockReader ¶
type MockReader struct {
// contains filtered or unexported fields
}
MockReader is a mock of Reader interface.
func NewMockReader ¶
func NewMockReader(ctrl *gomock.Controller) *MockReader
NewMockReader creates a new mock instance.
func (*MockReader) EXPECT ¶
func (m *MockReader) EXPECT() *MockReaderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockReader) FileExists ¶
func (m *MockReader) FileExists(filePath string) (bool, error)
FileExists mocks base method.
func (*MockReader) PathFor ¶
func (m *MockReader) PathFor(filePath string) string
PathFor mocks base method.
func (*MockReader) ReadDir ¶ added in v0.3.0
func (m *MockReader) ReadDir(dirPath string) ([]fs.DirEntry, error)
ReadDir mocks base method.
func (*MockReader) ReadFile ¶
func (m *MockReader) ReadFile(filePath string) ([]byte, error)
ReadFile mocks base method.
func (*MockReader) SetRootdir ¶
func (m *MockReader) SetRootdir(path string)
SetRootdir mocks base method.
type MockReaderMockRecorder ¶
type MockReaderMockRecorder struct {
// contains filtered or unexported fields
}
MockReaderMockRecorder is the mock recorder for MockReader.
func (*MockReaderMockRecorder) FileExists ¶
func (mr *MockReaderMockRecorder) FileExists(filePath any) *gomock.Call
FileExists indicates an expected call of FileExists.
func (*MockReaderMockRecorder) PathFor ¶
func (mr *MockReaderMockRecorder) PathFor(filePath any) *gomock.Call
PathFor indicates an expected call of PathFor.
func (*MockReaderMockRecorder) ReadDir ¶ added in v0.3.0
func (mr *MockReaderMockRecorder) ReadDir(dirPath any) *gomock.Call
ReadDir indicates an expected call of ReadDir.
func (*MockReaderMockRecorder) ReadFile ¶
func (mr *MockReaderMockRecorder) ReadFile(filePath any) *gomock.Call
ReadFile indicates an expected call of ReadFile.
func (*MockReaderMockRecorder) SetRootdir ¶
func (mr *MockReaderMockRecorder) SetRootdir(path any) *gomock.Call
SetRootdir indicates an expected call of SetRootdir.
type MockWriter ¶
type MockWriter struct {
// contains filtered or unexported fields
}
MockWriter is a mock of Writer interface.
func NewMockWriter ¶
func NewMockWriter(ctrl *gomock.Controller) *MockWriter
NewMockWriter creates a new mock instance.
func (*MockWriter) CopyFile ¶
func (m *MockWriter) CopyFile(src, dst string) error
CopyFile mocks base method.
func (*MockWriter) CreateManagedFile ¶
func (m *MockWriter) CreateManagedFile(file types.File) (ManagedFile, error)
CreateManagedFile mocks base method.
func (*MockWriter) EXPECT ¶
func (m *MockWriter) EXPECT() *MockWriterMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockWriter) MkdirAll ¶ added in v0.3.0
func (m *MockWriter) MkdirAll(path string, perm fs.FileMode) error
MkdirAll mocks base method.
func (*MockWriter) PathFor ¶ added in v0.3.0
func (m *MockWriter) PathFor(filePath string) string
PathFor mocks base method.
func (*MockWriter) RemoveAll ¶ added in v0.3.0
func (m *MockWriter) RemoveAll(path string) error
RemoveAll mocks base method.
func (*MockWriter) RemoveFile ¶
func (m *MockWriter) RemoveFile(file string) error
RemoveFile mocks base method.
func (*MockWriter) SetRootdir ¶
func (m *MockWriter) SetRootdir(path string)
SetRootdir mocks base method.
func (*MockWriter) WriteFile ¶
func (m *MockWriter) WriteFile(name string, data []byte, perm fs.FileMode, opts ...FileOption) error
WriteFile mocks base method.
type MockWriterMockRecorder ¶
type MockWriterMockRecorder struct {
// contains filtered or unexported fields
}
MockWriterMockRecorder is the mock recorder for MockWriter.
func (*MockWriterMockRecorder) CopyFile ¶
func (mr *MockWriterMockRecorder) CopyFile(src, dst any) *gomock.Call
CopyFile indicates an expected call of CopyFile.
func (*MockWriterMockRecorder) CreateManagedFile ¶
func (mr *MockWriterMockRecorder) CreateManagedFile(file any) *gomock.Call
CreateManagedFile indicates an expected call of CreateManagedFile.
func (*MockWriterMockRecorder) MkdirAll ¶ added in v0.3.0
func (mr *MockWriterMockRecorder) MkdirAll(path, perm any) *gomock.Call
MkdirAll indicates an expected call of MkdirAll.
func (*MockWriterMockRecorder) PathFor ¶ added in v0.3.0
func (mr *MockWriterMockRecorder) PathFor(filePath any) *gomock.Call
PathFor indicates an expected call of PathFor.
func (*MockWriterMockRecorder) RemoveAll ¶ added in v0.3.0
func (mr *MockWriterMockRecorder) RemoveAll(path any) *gomock.Call
RemoveAll indicates an expected call of RemoveAll.
func (*MockWriterMockRecorder) RemoveFile ¶
func (mr *MockWriterMockRecorder) RemoveFile(file any) *gomock.Call
RemoveFile indicates an expected call of RemoveFile.
func (*MockWriterMockRecorder) SetRootdir ¶
func (mr *MockWriterMockRecorder) SetRootdir(path any) *gomock.Call
SetRootdir indicates an expected call of SetRootdir.
type Option ¶
type Option func(*readWriter)
func WithTestRootDir ¶
WithTestRootDir sets the root directory for the reader and writer, useful for testing.
type ReadWriter ¶
func NewReadWriter ¶
func NewReadWriter(opts ...Option) ReadWriter
type Writer ¶
type Writer interface {
SetRootdir(path string)
PathFor(filePath string) string
WriteFile(name string, data []byte, perm fs.FileMode, opts ...FileOption) error
RemoveFile(file string) error
RemoveAll(path string) error
MkdirAll(path string, perm fs.FileMode) error
CopyFile(src, dst string) error
CreateManagedFile(file ign3types.File) (ManagedFile, error)
}