plugin

package
v0.0.0-...-d588a31 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package plugin is a generated GoMock package.

Package plugin is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSDKVersionNotFound = errors.New("SDK version not found")

	ErrSDKInstall     = errors.New("SDK install error")
	ErrDownloadFailed = errors.New("download failed")

	ErrExecuteFailed = errors.New("execute failed")
)

Functions

func ErrorInitializePlugin

func ErrorInitializePlugin(pluginID ID) error

func NewPluginNotFoundError

func NewPluginNotFoundError(pluginID ID) error

Types

type BasePlugin

type BasePlugin interface {
	fmt.GoStringer

	GetSDKDir() string
	GetSDKVersionDir(pluginID ID, version string) string
	HasInstalled(pluginID ID, version string) bool

	Exec(cli string, overrideEnv map[string]string, stdIn io.Reader, stdOut, stdErr io.Writer, args []string) error
}

type Error

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

func (*Error) Error

func (err *Error) Error() string

type ExtCommandInit

type ExtCommandInit func(cmd *cobra.Command)

type GetPluginFunc

type GetPluginFunc func(basePlugin BasePlugin) (SDKMPlugin, error)

type ID

type ID string

type MetaInfo

type MetaInfo struct {
	ID             ID
	GetPluginFunc  GetPluginFunc
	ExtCommandInit ExtCommandInit
}

type MockBasePlugin

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

MockBasePlugin is a mock of BasePlugin interface.

func NewMockBasePlugin

func NewMockBasePlugin(ctrl *gomock.Controller) *MockBasePlugin

NewMockBasePlugin creates a new mock instance.

func (*MockBasePlugin) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockBasePlugin) Exec

func (m *MockBasePlugin) Exec(cli string, overrideEnv map[string]string, stdIn io.Reader, stdOut, stdErr io.Writer, args []string) error

Exec mocks base method.

func (*MockBasePlugin) GetSDKDir

func (m *MockBasePlugin) GetSDKDir() string

GetSDKDir mocks base method.

func (*MockBasePlugin) GetSDKVersionDir

func (m *MockBasePlugin) GetSDKVersionDir(pluginID ID, version string) string

GetSDKVersionDir mocks base method.

func (*MockBasePlugin) GoString

func (m *MockBasePlugin) GoString() string

GoString mocks base method.

func (*MockBasePlugin) HasInstalled

func (m *MockBasePlugin) HasInstalled(pluginID ID, version string) bool

HasInstalled mocks base method.

type MockBasePluginMockRecorder

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

MockBasePluginMockRecorder is the mock recorder for MockBasePlugin.

func (*MockBasePluginMockRecorder) Exec

func (mr *MockBasePluginMockRecorder) Exec(cli, overrideEnv, stdIn, stdOut, stdErr, args any) *gomock.Call

Exec indicates an expected call of Exec.

func (*MockBasePluginMockRecorder) GetSDKDir

func (mr *MockBasePluginMockRecorder) GetSDKDir() *gomock.Call

GetSDKDir indicates an expected call of GetSDKDir.

func (*MockBasePluginMockRecorder) GetSDKVersionDir

func (mr *MockBasePluginMockRecorder) GetSDKVersionDir(pluginID, version any) *gomock.Call

GetSDKVersionDir indicates an expected call of GetSDKVersionDir.

func (*MockBasePluginMockRecorder) GoString

func (mr *MockBasePluginMockRecorder) GoString() *gomock.Call

GoString indicates an expected call of GoString.

func (*MockBasePluginMockRecorder) HasInstalled

func (mr *MockBasePluginMockRecorder) HasInstalled(pluginID, version any) *gomock.Call

HasInstalled indicates an expected call of HasInstalled.

type MockSDKMPlugin

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

MockSDKMPlugin is a mock of SDKMPlugin interface.

func NewMockSDKMPlugin

func NewMockSDKMPlugin(ctrl *gomock.Controller) *MockSDKMPlugin

NewMockSDKMPlugin creates a new mock instance.

func (*MockSDKMPlugin) Current

func (m *MockSDKMPlugin) Current(ctx context.Context, rebuildCache bool, baseDir string) (sdkversion.SDKVersion, error)

Current mocks base method.

func (*MockSDKMPlugin) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSDKMPlugin) Env

func (m *MockSDKMPlugin) Env(ctx context.Context, rebuildCache bool, baseDir string) (map[string]string, error)

Env mocks base method.

func (*MockSDKMPlugin) EnvByVersion

func (m *MockSDKMPlugin) EnvByVersion(ctx context.Context, version string) (map[string]string, error)

EnvByVersion mocks base method.

func (*MockSDKMPlugin) Exec

func (m *MockSDKMPlugin) Exec(ctx context.Context, rebuildCache bool, baseDir string, stdIn io.Reader, stdOut, stdErr io.Writer, args []string) error

Exec mocks base method.

func (*MockSDKMPlugin) Install

func (m *MockSDKMPlugin) Install(ctx context.Context, rebuildCache bool, baseDir string) error

Install mocks base method.

func (*MockSDKMPlugin) InstallVersion

func (m *MockSDKMPlugin) InstallVersion(ctx context.Context, version string) error

InstallVersion mocks base method.

func (*MockSDKMPlugin) LatestVersion

func (m *MockSDKMPlugin) LatestVersion(ctx context.Context, rebuildCache bool) (sdkversion.SDKVersion, error)

LatestVersion mocks base method.

func (*MockSDKMPlugin) LatestVersionByPrefix

func (m *MockSDKMPlugin) LatestVersionByPrefix(ctx context.Context, rebuildCache bool, prefix string) (sdkversion.SDKVersion, error)

LatestVersionByPrefix mocks base method.

func (*MockSDKMPlugin) ListAllVersions

func (m *MockSDKMPlugin) ListAllVersions(ctx context.Context, rebuildCache bool) ([]sdkversion.SDKVersion, error)

ListAllVersions mocks base method.

func (*MockSDKMPlugin) ListAllVersionsByPrefix

func (m *MockSDKMPlugin) ListAllVersionsByPrefix(ctx context.Context, rebuildCache bool, prefix string) ([]sdkversion.SDKVersion, error)

ListAllVersionsByPrefix mocks base method.

func (*MockSDKMPlugin) WithVersions

func (m *MockSDKMPlugin) WithVersions(versions sdkversion.SDKVersions) SDKMPlugin

WithVersions mocks base method.

type MockSDKMPluginMockRecorder

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

MockSDKMPluginMockRecorder is the mock recorder for MockSDKMPlugin.

func (*MockSDKMPluginMockRecorder) Current

func (mr *MockSDKMPluginMockRecorder) Current(ctx, rebuildCache, baseDir any) *gomock.Call

Current indicates an expected call of Current.

func (*MockSDKMPluginMockRecorder) Env

func (mr *MockSDKMPluginMockRecorder) Env(ctx, rebuildCache, baseDir any) *gomock.Call

Env indicates an expected call of Env.

func (*MockSDKMPluginMockRecorder) EnvByVersion

func (mr *MockSDKMPluginMockRecorder) EnvByVersion(ctx, version any) *gomock.Call

EnvByVersion indicates an expected call of EnvByVersion.

func (*MockSDKMPluginMockRecorder) Exec

func (mr *MockSDKMPluginMockRecorder) Exec(ctx, rebuildCache, baseDir, stdIn, stdOut, stdErr, args any) *gomock.Call

Exec indicates an expected call of Exec.

func (*MockSDKMPluginMockRecorder) Install

func (mr *MockSDKMPluginMockRecorder) Install(ctx, rebuildCache, baseDir any) *gomock.Call

Install indicates an expected call of Install.

func (*MockSDKMPluginMockRecorder) InstallVersion

func (mr *MockSDKMPluginMockRecorder) InstallVersion(ctx, version any) *gomock.Call

InstallVersion indicates an expected call of InstallVersion.

func (*MockSDKMPluginMockRecorder) LatestVersion

func (mr *MockSDKMPluginMockRecorder) LatestVersion(ctx, rebuildCache any) *gomock.Call

LatestVersion indicates an expected call of LatestVersion.

func (*MockSDKMPluginMockRecorder) LatestVersionByPrefix

func (mr *MockSDKMPluginMockRecorder) LatestVersionByPrefix(ctx, rebuildCache, prefix any) *gomock.Call

LatestVersionByPrefix indicates an expected call of LatestVersionByPrefix.

func (*MockSDKMPluginMockRecorder) ListAllVersions

func (mr *MockSDKMPluginMockRecorder) ListAllVersions(ctx, rebuildCache any) *gomock.Call

ListAllVersions indicates an expected call of ListAllVersions.

func (*MockSDKMPluginMockRecorder) ListAllVersionsByPrefix

func (mr *MockSDKMPluginMockRecorder) ListAllVersionsByPrefix(ctx, rebuildCache, prefix any) *gomock.Call

ListAllVersionsByPrefix indicates an expected call of ListAllVersionsByPrefix.

func (*MockSDKMPluginMockRecorder) WithVersions

func (mr *MockSDKMPluginMockRecorder) WithVersions(versions any) *gomock.Call

WithVersions indicates an expected call of WithVersions.

type SDKMPlugin

type SDKMPlugin interface {
	WithVersions(versions sdkmSDKVersion.SDKVersions) SDKMPlugin

	ListAllVersions(ctx context.Context, rebuildCache bool) ([]sdkmSDKVersion.SDKVersion, error)
	ListAllVersionsByPrefix(ctx context.Context, rebuildCache bool, prefix string) ([]sdkmSDKVersion.SDKVersion, error)

	LatestVersion(ctx context.Context, rebuildCache bool) (sdkmSDKVersion.SDKVersion, error)
	LatestVersionByPrefix(ctx context.Context, rebuildCache bool, prefix string) (sdkmSDKVersion.SDKVersion, error)

	Current(ctx context.Context, rebuildCache bool, baseDir string) (sdkmSDKVersion.SDKVersion, error)

	Install(ctx context.Context, rebuildCache bool, baseDir string) error
	InstallVersion(ctx context.Context, version string) error

	Env(ctx context.Context, rebuildCache bool, baseDir string) (map[string]string, error)
	EnvByVersion(ctx context.Context, version string) (map[string]string, error)

	Exec(ctx context.Context, rebuildCache bool, baseDir string, stdIn io.Reader, stdOut, stdErr io.Writer, args []string) error
}

Jump to

Keyboard shortcuts

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