utils

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGrafanaPluginDir

func GetGrafanaPluginDir(currentOS string) string

Types

type ApiClient

type ApiClient interface {
	GetPlugin(pluginId, repoUrl string) (models.Plugin, error)
	ListAllPlugins(repoUrl string) (models.PluginRepo, error)
}

type CommandLine

type CommandLine interface {
	ShowHelp() error
	ShowVersion()
	Application() *cli.App
	Args() cli.Args
	Bool(name string) bool
	Int(name string) int
	String(name string) string
	StringSlice(name string) []string
	FlagNames() (names []string)
	Generic(name string) interface{}

	PluginDirectory() string
	PluginRepoURL() string
	PluginURL() string
}

type ContextCommandLine

type ContextCommandLine struct {
	*cli.Context
}

func (*ContextCommandLine) Application

func (c *ContextCommandLine) Application() *cli.App

func (*ContextCommandLine) ConfigFile

func (c *ContextCommandLine) ConfigFile() string

func (*ContextCommandLine) HomePath

func (c *ContextCommandLine) HomePath() string

func (*ContextCommandLine) PluginDirectory

func (c *ContextCommandLine) PluginDirectory() string

func (*ContextCommandLine) PluginRepoURL

func (c *ContextCommandLine) PluginRepoURL() string

func (*ContextCommandLine) PluginURL

func (c *ContextCommandLine) PluginURL() string

func (*ContextCommandLine) ShowHelp

func (c *ContextCommandLine) ShowHelp() error

func (*ContextCommandLine) ShowVersion

func (c *ContextCommandLine) ShowVersion()

type MockArgs

type MockArgs struct {
	mock.Mock
}

MockArgs is an autogenerated mock type for the Args type

func NewMockArgs

func NewMockArgs(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockArgs

NewMockArgs creates a new instance of MockArgs. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockArgs) First

func (_m *MockArgs) First() string

First provides a mock function with given fields:

func (*MockArgs) Get

func (_m *MockArgs) Get(n int) string

Get provides a mock function with given fields: n

func (*MockArgs) Len

func (_m *MockArgs) Len() int

Len provides a mock function with given fields:

func (*MockArgs) Present

func (_m *MockArgs) Present() bool

Present provides a mock function with given fields:

func (*MockArgs) Slice

func (_m *MockArgs) Slice() []string

Slice provides a mock function with given fields:

func (*MockArgs) Tail

func (_m *MockArgs) Tail() []string

Tail provides a mock function with given fields:

type MockCommandLine

type MockCommandLine struct {
	mock.Mock
}

MockCommandLine is an autogenerated mock type for the CommandLine type

func NewMockCommandLine

func NewMockCommandLine(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockCommandLine

NewMockCommandLine creates a new instance of MockCommandLine. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockCommandLine) Application

func (_m *MockCommandLine) Application() *cli.App

Application provides a mock function with given fields:

func (*MockCommandLine) Args

func (_m *MockCommandLine) Args() cli.Args

Args provides a mock function with given fields:

func (*MockCommandLine) Bool

func (_m *MockCommandLine) Bool(name string) bool

Bool provides a mock function with given fields: name

func (*MockCommandLine) FlagNames

func (_m *MockCommandLine) FlagNames() []string

FlagNames provides a mock function with given fields:

func (*MockCommandLine) Generic

func (_m *MockCommandLine) Generic(name string) interface{}

Generic provides a mock function with given fields: name

func (*MockCommandLine) Int

func (_m *MockCommandLine) Int(name string) int

Int provides a mock function with given fields: name

func (*MockCommandLine) PluginDirectory

func (_m *MockCommandLine) PluginDirectory() string

PluginDirectory provides a mock function with given fields:

func (*MockCommandLine) PluginRepoURL

func (_m *MockCommandLine) PluginRepoURL() string

PluginRepoURL provides a mock function with given fields:

func (*MockCommandLine) PluginURL

func (_m *MockCommandLine) PluginURL() string

PluginURL provides a mock function with given fields:

func (*MockCommandLine) ShowHelp

func (_m *MockCommandLine) ShowHelp() error

ShowHelp provides a mock function with given fields:

func (*MockCommandLine) ShowVersion

func (_m *MockCommandLine) ShowVersion()

ShowVersion provides a mock function with given fields:

func (*MockCommandLine) String

func (_m *MockCommandLine) String(name string) string

String provides a mock function with given fields: name

func (*MockCommandLine) StringSlice

func (_m *MockCommandLine) StringSlice(name string) []string

StringSlice provides a mock function with given fields: name

Jump to

Keyboard shortcuts

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