repository

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fsio

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

func (*Fsio) Confirm

func (fsio *Fsio) Confirm(message string) bool

func (*Fsio) CopyFile

func (fsio *Fsio) CopyFile(srcPath string, dstPath string) error

func (*Fsio) IsDirOrFileExist

func (fsio *Fsio) IsDirOrFileExist(path string) bool

func (*Fsio) ListDirs

func (fsio *Fsio) ListDirs(path string) []string

func (*Fsio) ListFilesRecursively

func (fsio *Fsio) ListFilesRecursively(path string) []string

func (*Fsio) ReadStream

func (fsio *Fsio) ReadStream(path string) *os.File

func (*Fsio) RemoveFile

func (fsio *Fsio) RemoveFile(path string) error

func (*Fsio) SelectDir

func (fsio *Fsio) SelectDir(message string) string

type FsioInterface

type FsioInterface interface {
	Confirm(message string) bool
	SelectDir(message string) string
	IsDirOrFileExist(path string) bool
	ListDirs(path string) []string
	ListFilesRecursively(path string) []string
	ReadStream(path string) *os.File
	RemoveFile(path string) error
	CopyFile(srcPath string, dstPath string) error
}

type FsioMock

type FsioMock struct {
	Fsio // test cases depend on real filesystem now, so extends this struct.
	Out  string
}

func NewFsioMock

func NewFsioMock() *FsioMock

func (*FsioMock) Confirm

func (fsio *FsioMock) Confirm(message string) bool

func (*FsioMock) Printf

func (fsio *FsioMock) Printf(format string, a ...any)

func (*FsioMock) SelectDir

func (fsio *FsioMock) SelectDir(message string) string

type Log

type Log struct{}

func (*Log) Printf

func (repo *Log) Printf(format string, a ...any)

type LogInterface

type LogInterface interface {
	Printf(format string, a ...any)
}

type LogMock

type LogMock struct {
	Out string
}

func (*LogMock) Printf

func (repo *LogMock) Printf(format string, a ...any)

type Repos

type Repos struct {
	Log  LogInterface
	Fsio FsioInterface
}

func New

func New() Repos

func NewMock

func NewMock() Repos

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳