mock

package
v0.0.0-...-ef927d8 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileEntry

type FileEntry struct {
	fs.DirEntry
	Filename    string
	IsDirectory bool
}

FileEntry is a mock of the fs.FileEntry interface.

func NewFileEntry

func NewFileEntry(filename string, isDirectory bool) FileEntry

func (FileEntry) IsDir

func (f FileEntry) IsDir() bool

func (FileEntry) Name

func (f FileEntry) Name() string

type FileReader

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

FileReader is a mock implementation of the domain.FileReader interface.

func NewFileReader

func NewFileReader() *FileReader

func (*FileReader) GitFile

func (f *FileReader) GitFile(_ string) (pulse.GitFile, error)

func (*FileReader) SetFile

func (f *FileReader) SetFile(file pulse.GitFile)

type Reader

type Reader struct {
	DirectoryIndex int
	Directories    []string
	Entries        map[string][]fs.DirEntry
	FileContents   map[string][]byte
}

Reader is a mock implementation of the filereader.Reader interface.

func (*Reader) Dir

func (f *Reader) Dir(_ string) string

func (*Reader) Filename

func (f *Reader) Filename(path string) string

func (*Reader) IsFile

func (f *Reader) IsFile(_ string) bool

func (*Reader) ReadDir

func (f *Reader) ReadDir(dir string) ([]fs.DirEntry, error)

func (*Reader) ReadFile

func (f *Reader) ReadFile(filename string) ([]byte, error)

Jump to

Keyboard shortcuts

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