file

package
v1.19.1 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Overview

Package file is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFileClosed        = errors.New("File is closed")
	ErrOutOfRange        = errors.New("out of range")
	ErrTooLarge          = errors.New("too large")
	ErrFileNotFound      = os.ErrNotExist
	ErrFileExists        = os.ErrExist
	ErrDestinationExists = os.ErrExist
)

Functions

This section is empty.

Types

type File added in v1.17.0

type File interface {
	io.Closer
	io.Reader
	io.ReaderAt
	io.Seeker
	io.Writer
	io.WriterAt

	ReadAll() (RowReader, error)
}

File represents a file in the filesystem.

type FileInfo added in v1.18.0

type FileInfo interface {
	Name() string       // base name of the file
	Size() int64        // length in bytes for regular files; system-dependent for others
	ModTime() time.Time // modification time
	Mode() os.FileMode  // file mode bits
	IsDir() bool        // abbreviation for Mode().IsDir()
}

type FileSystem added in v1.17.0

type FileSystem interface {
	// Create creates a file in the filesystem, returning the file and an
	// error, if any happens.
	Create(name string) (File, error)

	// TODO - Lets make bucket constant for MkdirAll as well, we might create buckets from migrations
	// Mkdir creates a directory in the filesystem, return an error if any
	// happens.
	Mkdir(name string, perm os.FileMode) error

	// MkdirAll creates a directory path and all parents that does not exist
	// yet.
	MkdirAll(path string, perm os.FileMode) error

	// Open opens a file, returning it or an error, if any happens.
	Open(name string) (File, error)

	// OpenFile opens a file using the given flags and the given mode.
	OpenFile(name string, flag int, perm os.FileMode) (File, error)

	// Remove removes a file identified by name, returning an error, if any
	// happens.
	Remove(name string) error

	// RemoveAll removes a directory path and any children it contains. It
	// does not fail if the path does not exist (return nil).
	RemoveAll(path string) error

	// Rename renames a file.
	Rename(oldname, newname string) error

	// ReadDir returns a list of files/directories present in the directory.
	ReadDir(dir string) ([]FileInfo, error)

	// Stat returns the file/directory information in the directory.
	Stat(name string) (FileInfo, error)

	// ChDir changes the current directory.
	ChDir(dirname string) error

	// Getwd returns the path of the current directory.
	Getwd() (string, error)
}

FileSystem : Any simulated or real filesystem should implement this interface.

func New

func New(logger datasource.Logger) FileSystem

New initializes local filesystem with logger.

type FileSystemProvider added in v1.17.0

type FileSystemProvider interface {
	FileSystem

	// UseLogger sets the logger for the FileSystem client.
	UseLogger(logger interface{})

	// UseMetrics sets the metrics for the FileSystem client.
	UseMetrics(metrics interface{})

	// Connect establishes a connection to FileSystem and registers metrics using the provided configuration when the client was Created.
	Connect()
}

type MockFile added in v1.18.0

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

MockFile is a mock of File interface.

func NewMockFile added in v1.18.0

func NewMockFile(ctrl *gomock.Controller) *MockFile

NewMockFile creates a new mock instance.

func (*MockFile) Close added in v1.18.0

func (m *MockFile) Close() error

Close mocks base method.

func (*MockFile) EXPECT added in v1.18.0

func (m *MockFile) EXPECT() *MockFileMockRecorder

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

func (*MockFile) Read added in v1.18.0

func (m *MockFile) Read(p []byte) (int, error)

Read mocks base method.

func (*MockFile) ReadAll added in v1.18.0

func (m *MockFile) ReadAll() (RowReader, error)

ReadAll mocks base method.

func (*MockFile) ReadAt added in v1.18.0

func (m *MockFile) ReadAt(p []byte, off int64) (int, error)

ReadAt mocks base method.

func (*MockFile) Seek added in v1.18.0

func (m *MockFile) Seek(offset int64, whence int) (int64, error)

Seek mocks base method.

func (*MockFile) Write added in v1.18.0

func (m *MockFile) Write(p []byte) (int, error)

Write mocks base method.

func (*MockFile) WriteAt added in v1.18.0

func (m *MockFile) WriteAt(p []byte, off int64) (int, error)

WriteAt mocks base method.

type MockFileMockRecorder added in v1.18.0

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

MockFileMockRecorder is the mock recorder for MockFile.

func (*MockFileMockRecorder) Close added in v1.18.0

func (mr *MockFileMockRecorder) Close() *gomock.Call

Close indicates an expected call of Close.

func (*MockFileMockRecorder) Read added in v1.18.0

func (mr *MockFileMockRecorder) Read(p any) *gomock.Call

Read indicates an expected call of Read.

func (*MockFileMockRecorder) ReadAll added in v1.18.0

func (mr *MockFileMockRecorder) ReadAll() *gomock.Call

ReadAll indicates an expected call of ReadAll.

func (*MockFileMockRecorder) ReadAt added in v1.18.0

func (mr *MockFileMockRecorder) ReadAt(p, off any) *gomock.Call

ReadAt indicates an expected call of ReadAt.

func (*MockFileMockRecorder) Seek added in v1.18.0

func (mr *MockFileMockRecorder) Seek(offset, whence any) *gomock.Call

Seek indicates an expected call of Seek.

func (*MockFileMockRecorder) Write added in v1.18.0

func (mr *MockFileMockRecorder) Write(p any) *gomock.Call

Write indicates an expected call of Write.

func (*MockFileMockRecorder) WriteAt added in v1.18.0

func (mr *MockFileMockRecorder) WriteAt(p, off any) *gomock.Call

WriteAt indicates an expected call of WriteAt.

type MockFileSystem added in v1.18.0

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

MockFileSystem is a mock of FileSystem interface.

func NewMockFileSystem added in v1.18.0

func NewMockFileSystem(ctrl *gomock.Controller) *MockFileSystem

NewMockFileSystem creates a new mock instance.

func (*MockFileSystem) Create added in v1.18.0

func (m *MockFileSystem) Create(name string) (File, error)

Create mocks base method.

func (*MockFileSystem) EXPECT added in v1.18.0

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

func (*MockFileSystem) Mkdir added in v1.18.0

func (m *MockFileSystem) Mkdir(name string, perm os.FileMode) error

Mkdir mocks base method.

func (*MockFileSystem) MkdirAll added in v1.18.0

func (m *MockFileSystem) MkdirAll(path string, perm os.FileMode) error

MkdirAll mocks base method.

func (*MockFileSystem) Open added in v1.18.0

func (m *MockFileSystem) Open(name string) (File, error)

Open mocks base method.

func (*MockFileSystem) OpenFile added in v1.18.0

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

OpenFile mocks base method.

func (*MockFileSystem) Remove added in v1.18.0

func (m *MockFileSystem) Remove(name string) error

Remove mocks base method.

func (*MockFileSystem) RemoveAll added in v1.18.0

func (m *MockFileSystem) RemoveAll(path string) error

RemoveAll mocks base method.

func (*MockFileSystem) Rename added in v1.18.0

func (m *MockFileSystem) Rename(oldname, newname string) error

Rename mocks base method.

type MockFileSystemMockRecorder added in v1.18.0

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

MockFileSystemMockRecorder is the mock recorder for MockFileSystem.

func (*MockFileSystemMockRecorder) Create added in v1.18.0

func (mr *MockFileSystemMockRecorder) Create(name any) *gomock.Call

Create indicates an expected call of Create.

func (*MockFileSystemMockRecorder) Mkdir added in v1.18.0

func (mr *MockFileSystemMockRecorder) Mkdir(name, perm any) *gomock.Call

Mkdir indicates an expected call of Mkdir.

func (*MockFileSystemMockRecorder) MkdirAll added in v1.18.0

func (mr *MockFileSystemMockRecorder) MkdirAll(path, perm any) *gomock.Call

MkdirAll indicates an expected call of MkdirAll.

func (*MockFileSystemMockRecorder) Open added in v1.18.0

func (mr *MockFileSystemMockRecorder) Open(name any) *gomock.Call

Open indicates an expected call of Open.

func (*MockFileSystemMockRecorder) OpenFile added in v1.18.0

func (mr *MockFileSystemMockRecorder) OpenFile(name, flag, perm any) *gomock.Call

OpenFile indicates an expected call of OpenFile.

func (*MockFileSystemMockRecorder) Remove added in v1.18.0

func (mr *MockFileSystemMockRecorder) Remove(name any) *gomock.Call

Remove indicates an expected call of Remove.

func (*MockFileSystemMockRecorder) RemoveAll added in v1.18.0

func (mr *MockFileSystemMockRecorder) RemoveAll(path any) *gomock.Call

RemoveAll indicates an expected call of RemoveAll.

func (*MockFileSystemMockRecorder) Rename added in v1.18.0

func (mr *MockFileSystemMockRecorder) Rename(oldname, newname any) *gomock.Call

Rename indicates an expected call of Rename.

type MockFileSystemProvider added in v1.17.0

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

MockFileSystemProvider is a mock of FileSystemProvider interface.

func NewMockFileSystemProvider added in v1.17.0

func NewMockFileSystemProvider(ctrl *gomock.Controller) *MockFileSystemProvider

NewMockFileSystemProvider creates a new mock instance.

func (*MockFileSystemProvider) ChDir added in v1.18.0

func (m *MockFileSystemProvider) ChDir(arg0 string) error

ChDir mocks base method.

func (*MockFileSystemProvider) Connect added in v1.17.0

func (m *MockFileSystemProvider) Connect()

Connect mocks base method.

func (*MockFileSystemProvider) Create added in v1.17.0

func (m *MockFileSystemProvider) Create(name string) (File, error)

Create mocks base method.

func (*MockFileSystemProvider) EXPECT added in v1.17.0

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

func (*MockFileSystemProvider) Getwd added in v1.18.0

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

Getwd mocks base method.

func (*MockFileSystemProvider) Mkdir added in v1.17.0

func (m *MockFileSystemProvider) Mkdir(name string, perm os.FileMode) error

Mkdir mocks base method.

func (*MockFileSystemProvider) MkdirAll added in v1.17.0

func (m *MockFileSystemProvider) MkdirAll(path string, perm os.FileMode) error

MkdirAll mocks base method.

func (*MockFileSystemProvider) Open added in v1.17.0

func (m *MockFileSystemProvider) Open(name string) (File, error)

Open mocks base method.

func (*MockFileSystemProvider) OpenFile added in v1.17.0

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

OpenFile mocks base method.

func (*MockFileSystemProvider) ReadDir added in v1.18.0

func (m *MockFileSystemProvider) ReadDir(arg0 string) ([]FileInfo, error)

ReadDir mocks base method.

func (*MockFileSystemProvider) Remove added in v1.17.0

func (m *MockFileSystemProvider) Remove(name string) error

Remove mocks base method.

func (*MockFileSystemProvider) RemoveAll added in v1.17.0

func (m *MockFileSystemProvider) RemoveAll(path string) error

RemoveAll mocks base method.

func (*MockFileSystemProvider) Rename added in v1.17.0

func (m *MockFileSystemProvider) Rename(oldname, newname string) error

Rename mocks base method.

func (*MockFileSystemProvider) Stat added in v1.18.0

func (m *MockFileSystemProvider) Stat(arg0 string) (FileInfo, error)

Stat mocks base method.

func (*MockFileSystemProvider) UseLogger added in v1.17.0

func (m *MockFileSystemProvider) UseLogger(logger any)

UseLogger mocks base method.

func (*MockFileSystemProvider) UseMetrics added in v1.17.0

func (m *MockFileSystemProvider) UseMetrics(metrics any)

UseMetrics mocks base method.

type MockFileSystemProviderMockRecorder added in v1.17.0

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

MockFileSystemProviderMockRecorder is the mock recorder for MockFileSystemProvider.

func (*MockFileSystemProviderMockRecorder) ChDir added in v1.18.0

ChDir indicates an expected call of ChDir.

func (*MockFileSystemProviderMockRecorder) Connect added in v1.17.0

Connect indicates an expected call of Connect.

func (*MockFileSystemProviderMockRecorder) Create added in v1.17.0

Create indicates an expected call of Create.

func (*MockFileSystemProviderMockRecorder) Getwd added in v1.18.0

Getwd indicates an expected call of Getwd.

func (*MockFileSystemProviderMockRecorder) Mkdir added in v1.17.0

func (mr *MockFileSystemProviderMockRecorder) Mkdir(name, perm any) *gomock.Call

Mkdir indicates an expected call of Mkdir.

func (*MockFileSystemProviderMockRecorder) MkdirAll added in v1.17.0

func (mr *MockFileSystemProviderMockRecorder) MkdirAll(path, perm any) *gomock.Call

MkdirAll indicates an expected call of MkdirAll.

func (*MockFileSystemProviderMockRecorder) Open added in v1.17.0

Open indicates an expected call of Open.

func (*MockFileSystemProviderMockRecorder) OpenFile added in v1.17.0

func (mr *MockFileSystemProviderMockRecorder) OpenFile(name, flag, perm any) *gomock.Call

OpenFile indicates an expected call of OpenFile.

func (*MockFileSystemProviderMockRecorder) ReadDir added in v1.18.0

ReadDir indicates an expected call of ReadDir.

func (*MockFileSystemProviderMockRecorder) Remove added in v1.17.0

Remove indicates an expected call of Remove.

func (*MockFileSystemProviderMockRecorder) RemoveAll added in v1.17.0

func (mr *MockFileSystemProviderMockRecorder) RemoveAll(path any) *gomock.Call

RemoveAll indicates an expected call of RemoveAll.

func (*MockFileSystemProviderMockRecorder) Rename added in v1.17.0

func (mr *MockFileSystemProviderMockRecorder) Rename(oldname, newname any) *gomock.Call

Rename indicates an expected call of Rename.

func (*MockFileSystemProviderMockRecorder) Stat added in v1.18.0

Stat indicates an expected call of Stat.

func (*MockFileSystemProviderMockRecorder) UseLogger added in v1.17.0

func (mr *MockFileSystemProviderMockRecorder) UseLogger(logger any) *gomock.Call

UseLogger indicates an expected call of UseLogger.

func (*MockFileSystemProviderMockRecorder) UseMetrics added in v1.17.0

func (mr *MockFileSystemProviderMockRecorder) UseMetrics(metrics any) *gomock.Call

UseMetrics indicates an expected call of UseMetrics.

type MockRowReader added in v1.18.0

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

MockRowReader is a mock of RowReader interface.

func NewMockRowReader added in v1.18.0

func NewMockRowReader(ctrl *gomock.Controller) *MockRowReader

NewMockRowReader creates a new mock instance.

func (*MockRowReader) EXPECT added in v1.18.0

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

func (*MockRowReader) Next added in v1.18.0

func (m *MockRowReader) Next() bool

Next mocks base method.

func (*MockRowReader) Scan added in v1.18.0

func (m *MockRowReader) Scan(arg0 any) error

Scan mocks base method.

type MockRowReaderMockRecorder added in v1.18.0

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

MockRowReaderMockRecorder is the mock recorder for MockRowReader.

func (*MockRowReaderMockRecorder) Next added in v1.18.0

Next indicates an expected call of Next.

func (*MockRowReaderMockRecorder) Scan added in v1.18.0

func (mr *MockRowReaderMockRecorder) Scan(arg0 any) *gomock.Call

Scan indicates an expected call of Scan.

type RowReader added in v1.17.0

type RowReader interface {
	Next() bool
	Scan(interface{}) error
}

Directories

Path Synopsis
ftp module
s3 module
sftp module

Jump to

Keyboard shortcuts

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