filesystem

package
v1.16.14 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package filesystem is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSystem

type FileSystem interface {
	Stat(name string) (os.FileInfo, error)
	Walk(root string, walkFn filepath.WalkFunc) error
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	OpenFileRO(name string) (*os.File, error)
	OpenFileBuffered(name string) (*bufio.Reader, error)
	ReadDir(dirname string) ([]os.DirEntry, error)
	ReadFile(filename string) ([]byte, error)
	Getwd() (string, error)
}

type MockDirEntry added in v1.16.11

type MockDirEntry struct {
	FName  string
	FIsDir bool
}

MockDirEntry implements os.DirEntry interface for mocking in tests.

func (*MockDirEntry) Info added in v1.16.11

func (m *MockDirEntry) Info() (os.FileInfo, error)

Info returns the mocked file info.

func (*MockDirEntry) IsDir added in v1.16.11

func (m *MockDirEntry) IsDir() bool

IsDir returns the mocked directory flag.

func (*MockDirEntry) Name added in v1.16.11

func (m *MockDirEntry) Name() string

Name returns the mocked name of the directory entry.

func (*MockDirEntry) Type added in v1.16.11

func (m *MockDirEntry) Type() os.FileMode

Type returns the mocked file mode.

type MockFileInfo

type MockFileInfo struct {
	FName    string
	FSize    int64
	FMode    os.FileMode
	FModTime time.Time
	FIsDir   bool
}

func (*MockFileInfo) IsDir

func (m *MockFileInfo) IsDir() bool

func (*MockFileInfo) ModTime

func (m *MockFileInfo) ModTime() time.Time

func (*MockFileInfo) Mode

func (m *MockFileInfo) Mode() os.FileMode

func (*MockFileInfo) Name

func (m *MockFileInfo) Name() string

func (*MockFileInfo) Size

func (m *MockFileInfo) Size() int64

func (*MockFileInfo) Sys

func (m *MockFileInfo) Sys() interface{}

type MockFileSystem

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

MockFileSystem is a mock of FileSystem interface.

func NewMockFileSystem

func NewMockFileSystem(ctrl *gomock.Controller) *MockFileSystem

NewMockFileSystem creates a new mock instance.

func (*MockFileSystem) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockFileSystem) Getwd added in v1.16.11

func (m *MockFileSystem) Getwd() (string, error)

Getwd mocks base method.

func (*MockFileSystem) OpenFile

func (m *MockFileSystem) OpenFile(arg0 string, arg1 int, arg2 fs.FileMode) (*os.File, error)

OpenFile mocks base method.

func (*MockFileSystem) OpenFileBuffered

func (m *MockFileSystem) OpenFileBuffered(arg0 string) (*bufio.Reader, error)

OpenFileBuffered mocks base method.

func (*MockFileSystem) OpenFileRO

func (m *MockFileSystem) OpenFileRO(arg0 string) (*os.File, error)

OpenFileRO mocks base method.

func (*MockFileSystem) ReadDir added in v1.16.11

func (m *MockFileSystem) ReadDir(arg0 string) ([]fs.DirEntry, error)

ReadDir mocks base method.

func (*MockFileSystem) ReadFile added in v1.16.11

func (m *MockFileSystem) ReadFile(arg0 string) ([]byte, error)

ReadFile mocks base method.

func (*MockFileSystem) Stat

func (m *MockFileSystem) Stat(arg0 string) (fs.FileInfo, error)

Stat mocks base method.

func (*MockFileSystem) Walk

func (m *MockFileSystem) Walk(arg0 string, arg1 filepath.WalkFunc) error

Walk mocks base method.

type MockFileSystemMockRecorder

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

MockFileSystemMockRecorder is the mock recorder for MockFileSystem.

func (*MockFileSystemMockRecorder) Getwd added in v1.16.11

func (mr *MockFileSystemMockRecorder) Getwd() *gomock.Call

Getwd indicates an expected call of Getwd.

func (*MockFileSystemMockRecorder) OpenFile

func (mr *MockFileSystemMockRecorder) OpenFile(arg0, arg1, arg2 interface{}) *gomock.Call

OpenFile indicates an expected call of OpenFile.

func (*MockFileSystemMockRecorder) OpenFileBuffered

func (mr *MockFileSystemMockRecorder) OpenFileBuffered(arg0 interface{}) *gomock.Call

OpenFileBuffered indicates an expected call of OpenFileBuffered.

func (*MockFileSystemMockRecorder) OpenFileRO

func (mr *MockFileSystemMockRecorder) OpenFileRO(arg0 interface{}) *gomock.Call

OpenFileRO indicates an expected call of OpenFileRO.

func (*MockFileSystemMockRecorder) ReadDir added in v1.16.11

func (mr *MockFileSystemMockRecorder) ReadDir(arg0 interface{}) *gomock.Call

ReadDir indicates an expected call of ReadDir.

func (*MockFileSystemMockRecorder) ReadFile added in v1.16.11

func (mr *MockFileSystemMockRecorder) ReadFile(arg0 interface{}) *gomock.Call

ReadFile indicates an expected call of ReadFile.

func (*MockFileSystemMockRecorder) Stat

func (mr *MockFileSystemMockRecorder) Stat(arg0 interface{}) *gomock.Call

Stat indicates an expected call of Stat.

func (*MockFileSystemMockRecorder) Walk

func (mr *MockFileSystemMockRecorder) Walk(arg0, arg1 interface{}) *gomock.Call

Walk indicates an expected call of Walk.

type OSFileSystem

type OSFileSystem struct{}

func NewOSFileSystem

func NewOSFileSystem() *OSFileSystem

func (*OSFileSystem) Getwd added in v1.16.11

func (s *OSFileSystem) Getwd() (string, error)

func (*OSFileSystem) OpenFile

func (s *OSFileSystem) OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)

func (*OSFileSystem) OpenFileBuffered

func (s *OSFileSystem) OpenFileBuffered(name string) (*bufio.Reader, error)

func (*OSFileSystem) OpenFileRO

func (s *OSFileSystem) OpenFileRO(name string) (*os.File, error)

func (*OSFileSystem) ReadDir added in v1.16.11

func (s *OSFileSystem) ReadDir(dirname string) ([]os.DirEntry, error)

func (*OSFileSystem) ReadFile added in v1.16.11

func (s *OSFileSystem) ReadFile(filename string) ([]byte, error)

func (*OSFileSystem) Stat

func (s *OSFileSystem) Stat(name string) (os.FileInfo, error)

func (*OSFileSystem) Walk

func (s *OSFileSystem) Walk(root string, walkFn filepath.WalkFunc) error

Jump to

Keyboard shortcuts

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