filesystem

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: BSD-3-Clause Imports: 5 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RenameIfExists

func RenameIfExists(a, b string) (renamed bool, err error)

Renames the file "a" to "b" iff "a" exists. It returns "true" and no error, if rename were successful. It returns "false" and no error, if the file "a" does not exist. It returns "false" and an error, if rename failed.

Types

type MockFile

type MockFile struct {
	MockName    string
	MockIsDir   bool
	MockType    fs.FileMode
	MockInfo    fs.FileInfo
	MockInfoErr error
}

MockFile is an implementation of fs.File for unit testing.

func (MockFile) Info

func (m MockFile) Info() (fs.FileInfo, error)

func (MockFile) IsDir

func (m MockFile) IsDir() bool

func (MockFile) Name

func (m MockFile) Name() string

func (MockFile) Type

func (m MockFile) Type() fs.FileMode

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

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

ReadDir mocks base method.

type MockReaderMockRecorder

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

MockReaderMockRecorder is the mock recorder for MockReader.

func (*MockReaderMockRecorder) ReadDir

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

ReadDir indicates an expected call of ReadDir.

type Reader

type Reader interface {
	// ReadDir reads a given directory.
	// Returns the files in the directory.
	ReadDir(string) ([]fs.DirEntry, error)
}

Reader is an interface for reading the filesystem.

func NewReader

func NewReader() Reader

NewReader returns an instance of Reader

Jump to

Keyboard shortcuts

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