commandstest

package
v0.0.0-...-900be4e Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCliContext

func NewCliContext(flags map[string]string) (*utils.ContextCommandLine, error)

NewCliContext creates a new CLI context with a certain set of flags.

Types

type FakeFileInfo

type FakeFileInfo struct {
	IsDirectory bool
}

func (*FakeFileInfo) IsDir

func (ffi *FakeFileInfo) IsDir() bool

func (FakeFileInfo) ModTime

func (ffi FakeFileInfo) ModTime() time.Time

func (FakeFileInfo) Mode

func (ffi FakeFileInfo) Mode() os.FileMode

func (FakeFileInfo) Name

func (ffi FakeFileInfo) Name() string

func (FakeFileInfo) Size

func (ffi FakeFileInfo) Size() int64

func (FakeFileInfo) Sys

func (ffi FakeFileInfo) Sys() interface{}

type FakeGrafargComClient

type FakeGrafargComClient struct {
	GetPluginFunc      func(pluginId, repoUrl string) (models.Plugin, error)
	DownloadFileFunc   func(pluginName string, tmpFile *os.File, url string, checksum string) (err error)
	ListAllPluginsFunc func(repoUrl string) (models.PluginRepo, error)
}

func (*FakeGrafargComClient) DownloadFile

func (client *FakeGrafargComClient) DownloadFile(pluginName string, tmpFile *os.File, url string, checksum string) (err error)

func (*FakeGrafargComClient) GetPlugin

func (client *FakeGrafargComClient) GetPlugin(pluginID, repoUrl string) (models.Plugin, error)

func (*FakeGrafargComClient) ListAllPlugins

func (client *FakeGrafargComClient) ListAllPlugins(repoURL string) (models.PluginRepo, error)

type FakeIoUtil

type FakeIoUtil struct {
	FakeReadDir     []os.FileInfo
	FakeIsDirectory bool
}

func (*FakeIoUtil) ReadDir

func (util *FakeIoUtil) ReadDir(path string) ([]os.FileInfo, error)

func (*FakeIoUtil) ReadFile

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

func (*FakeIoUtil) RemoveAll

func (util *FakeIoUtil) RemoveAll(path string) error

func (*FakeIoUtil) Stat

func (util *FakeIoUtil) Stat(path string) (os.FileInfo, error)

Jump to

Keyboard shortcuts

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