osplugin

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: github.com/rancher-sandbox/cluster-api-provider-elemental/pkg/agent/osplugin (interfaces: Loader,Plugin)

Generated by this command:

mockgen -copyright_file=hack/boilerplate.go.txt -destination=pkg/agent/osplugin/plugin_mocks.go -package=osplugin github.com/rancher-sandbox/cluster-api-provider-elemental/pkg/agent/osplugin Loader,Plugin

Package osplugin is a generated GoMock package.

Index

Constants

View Source
const (
	// GetPluginSymbol is the symbol expected to return a Plugin implementation.
	GetPluginSymbol = "GetPlugin"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

type Loader interface {
	Load(string) (Plugin, error)
}

Loader is a simple plugin loader.

func NewLoader

func NewLoader() Loader

NewLoader returns a simple Loader implementation.

type MockLoader

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

MockLoader is a mock of Loader interface.

func NewMockLoader

func NewMockLoader(ctrl *gomock.Controller) *MockLoader

NewMockLoader creates a new mock instance.

func (*MockLoader) EXPECT

func (m *MockLoader) EXPECT() *MockLoaderMockRecorder

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

func (*MockLoader) Load

func (m *MockLoader) Load(arg0 string) (Plugin, error)

Load mocks base method.

type MockLoaderMockRecorder

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

MockLoaderMockRecorder is the mock recorder for MockLoader.

func (*MockLoaderMockRecorder) Load

func (mr *MockLoaderMockRecorder) Load(arg0 any) *gomock.Call

Load indicates an expected call of Load.

type MockPlugin

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

MockPlugin is a mock of Plugin interface.

func NewMockPlugin

func NewMockPlugin(ctrl *gomock.Controller) *MockPlugin

NewMockPlugin creates a new mock instance.

func (*MockPlugin) Bootstrap added in v0.4.0

func (m *MockPlugin) Bootstrap(arg0 string, arg1 []byte) error

Bootstrap mocks base method.

func (*MockPlugin) EXPECT

func (m *MockPlugin) EXPECT() *MockPluginMockRecorder

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

func (*MockPlugin) GetHostname

func (m *MockPlugin) GetHostname() (string, error)

GetHostname mocks base method.

func (*MockPlugin) Init

func (m *MockPlugin) Init(arg0 PluginContext) error

Init mocks base method.

func (*MockPlugin) Install

func (m *MockPlugin) Install(arg0 []byte) error

Install mocks base method.

func (*MockPlugin) InstallCloudInit added in v0.4.0

func (m *MockPlugin) InstallCloudInit(arg0 []byte) error

InstallCloudInit mocks base method.

func (*MockPlugin) InstallFile added in v0.4.0

func (m *MockPlugin) InstallFile(arg0 []byte, arg1 string, arg2 uint32, arg3, arg4 int) error

InstallFile mocks base method.

func (*MockPlugin) InstallHostname added in v0.4.0

func (m *MockPlugin) InstallHostname(arg0 string) error

InstallHostname mocks base method.

func (*MockPlugin) PowerOff

func (m *MockPlugin) PowerOff() error

PowerOff mocks base method.

func (*MockPlugin) Reboot

func (m *MockPlugin) Reboot() error

Reboot mocks base method.

func (*MockPlugin) Reset

func (m *MockPlugin) Reset(arg0 []byte) error

Reset mocks base method.

func (*MockPlugin) TriggerReset

func (m *MockPlugin) TriggerReset() error

TriggerReset mocks base method.

type MockPluginMockRecorder

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

MockPluginMockRecorder is the mock recorder for MockPlugin.

func (*MockPluginMockRecorder) Bootstrap added in v0.4.0

func (mr *MockPluginMockRecorder) Bootstrap(arg0, arg1 any) *gomock.Call

Bootstrap indicates an expected call of Bootstrap.

func (*MockPluginMockRecorder) GetHostname

func (mr *MockPluginMockRecorder) GetHostname() *gomock.Call

GetHostname indicates an expected call of GetHostname.

func (*MockPluginMockRecorder) Init

func (mr *MockPluginMockRecorder) Init(arg0 any) *gomock.Call

Init indicates an expected call of Init.

func (*MockPluginMockRecorder) Install

func (mr *MockPluginMockRecorder) Install(arg0 any) *gomock.Call

Install indicates an expected call of Install.

func (*MockPluginMockRecorder) InstallCloudInit added in v0.4.0

func (mr *MockPluginMockRecorder) InstallCloudInit(arg0 any) *gomock.Call

InstallCloudInit indicates an expected call of InstallCloudInit.

func (*MockPluginMockRecorder) InstallFile added in v0.4.0

func (mr *MockPluginMockRecorder) InstallFile(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call

InstallFile indicates an expected call of InstallFile.

func (*MockPluginMockRecorder) InstallHostname added in v0.4.0

func (mr *MockPluginMockRecorder) InstallHostname(arg0 any) *gomock.Call

InstallHostname indicates an expected call of InstallHostname.

func (*MockPluginMockRecorder) PowerOff

func (mr *MockPluginMockRecorder) PowerOff() *gomock.Call

PowerOff indicates an expected call of PowerOff.

func (*MockPluginMockRecorder) Reboot

func (mr *MockPluginMockRecorder) Reboot() *gomock.Call

Reboot indicates an expected call of Reboot.

func (*MockPluginMockRecorder) Reset

func (mr *MockPluginMockRecorder) Reset(arg0 any) *gomock.Call

Reset indicates an expected call of Reset.

func (*MockPluginMockRecorder) TriggerReset

func (mr *MockPluginMockRecorder) TriggerReset() *gomock.Call

TriggerReset indicates an expected call of TriggerReset.

type Plugin

type Plugin interface {
	// Init is called just after the plugin is loaded to pass context information.
	Init(PluginContext) error
	// GetHostname should return the current machine hostname.
	GetHostname() (string, error)
	// InstallCloudInit should install a cloud-init input config (in JSON format) to the machine.
	InstallCloudInit(input []byte) error
	// InstallHostname should install the input hostname to the machine.
	InstallHostname(hostname string) error
	// InstallFile should install any file to the input path, given a content.
	InstallFile(content []byte, path string, permission uint32, owner int, group int) error
	// Install should install any needed components to the machine, given an input install config (in JSON format).
	// This is called by the agent on '--install' argument.
	Install(input []byte) error
	// Bootstrap should apply the CAPI bootstrap config to the machine.
	// The format can be either "cloud-init" or "ignition".
	Bootstrap(format string, input []byte) error
	// TriggerReset should prepare the machine for reset.
	TriggerReset() error
	// Reset should reset the machine to an installable state, given an input reset config (in JSON format).
	// This is called by the agent on '--reset' argument.
	Reset(input []byte) error
	// PowerOff should poweroff the machine.
	PowerOff() error
	// Reboot should reboot the machine.
	Reboot() error
}

Plugin represents the OS Plugin interface. Any Plugin is expected to fully implement the interface.

type PluginContext

type PluginContext struct {
	// WorkDir is the agent work directory
	WorkDir string
	// ConfigPath is the agent full config path
	ConfigPath string
	// Debug options should be enabled
	Debug bool
}

PluginContext contains information to be passed to any plugin.

Jump to

Keyboard shortcuts

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