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
- type Loader
- type MockLoader
- type MockLoaderMockRecorder
- type MockPlugin
- func (m *MockPlugin) ApplyCloudInit(arg0 []byte) error
- func (m *MockPlugin) EXPECT() *MockPluginMockRecorder
- func (m *MockPlugin) GetHostname() (string, error)
- func (m *MockPlugin) Init(arg0 PluginContext) error
- func (m *MockPlugin) Install(arg0 []byte) error
- func (m *MockPlugin) PersistFile(arg0 []byte, arg1 string, arg2 uint32, arg3, arg4 int) error
- func (m *MockPlugin) PersistHostname(arg0 string) error
- func (m *MockPlugin) PowerOff() error
- func (m *MockPlugin) Reboot() error
- func (m *MockPlugin) Reset(arg0 []byte) error
- func (m *MockPlugin) TriggerReset() error
- type MockPluginMockRecorder
- func (mr *MockPluginMockRecorder) ApplyCloudInit(arg0 any) *gomock.Call
- func (mr *MockPluginMockRecorder) GetHostname() *gomock.Call
- func (mr *MockPluginMockRecorder) Init(arg0 any) *gomock.Call
- func (mr *MockPluginMockRecorder) Install(arg0 any) *gomock.Call
- func (mr *MockPluginMockRecorder) PersistFile(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
- func (mr *MockPluginMockRecorder) PersistHostname(arg0 any) *gomock.Call
- func (mr *MockPluginMockRecorder) PowerOff() *gomock.Call
- func (mr *MockPluginMockRecorder) Reboot() *gomock.Call
- func (mr *MockPluginMockRecorder) Reset(arg0 any) *gomock.Call
- func (mr *MockPluginMockRecorder) TriggerReset() *gomock.Call
- type Plugin
- type PluginContext
Constants ¶
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 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.
type MockLoaderMockRecorder ¶
type MockLoaderMockRecorder struct {
// contains filtered or unexported fields
}
MockLoaderMockRecorder is the mock recorder for MockLoader.
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) ApplyCloudInit ¶
func (m *MockPlugin) ApplyCloudInit(arg0 []byte) error
ApplyCloudInit 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) PersistFile ¶
PersistFile mocks base method.
func (*MockPlugin) PersistHostname ¶
func (m *MockPlugin) PersistHostname(arg0 string) error
PersistHostname 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) ApplyCloudInit ¶
func (mr *MockPluginMockRecorder) ApplyCloudInit(arg0 any) *gomock.Call
ApplyCloudInit indicates an expected call of ApplyCloudInit.
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) PersistFile ¶
func (mr *MockPluginMockRecorder) PersistFile(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call
PersistFile indicates an expected call of PersistFile.
func (*MockPluginMockRecorder) PersistHostname ¶
func (mr *MockPluginMockRecorder) PersistHostname(arg0 any) *gomock.Call
PersistHostname indicates an expected call of PersistHostname.
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 // ApplyCloudInit should apply a cloud-init input config (in JSON format) to the machine. ApplyCloudInit(input []byte) error // GetHostname should return the current machine hostname. GetHostname() (string, error) // PersistHostname should persist the input hostname to the machine. PersistHostname(hostname string) error // PersistFile should persist any file in the input path, given a content. PersistFile(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 // 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.