Documentation
¶
Index ¶
- Constants
- func FactoryFor(componentType devicetypes.ComponentType) componentmanager.ManagerFactory
- func RegisterAll(registry *componentmanager.Registry)
- type Manager
- func (m *Manager) AllowBringUpAndPowerOn(ctx context.Context, target common.Target) error
- func (m *Manager) FirmwareControl(ctx context.Context, target common.Target, ...) error
- func (m *Manager) GetBringUpState(ctx context.Context, target common.Target) (map[string]operations.MachineBringUpState, error)
- func (m *Manager) GetFirmwareUpdateStatus(ctx context.Context, target common.Target) (map[string]operations.FirmwareUpdateStatus, error)
- func (m *Manager) GetPowerStatus(ctx context.Context, target common.Target) (map[string]operations.PowerStatus, error)
- func (m *Manager) InjectExpectation(ctx context.Context, target common.Target, ...) error
- func (m *Manager) PowerControl(ctx context.Context, target common.Target, ...) error
- func (m *Manager) StartFirmwareUpdate(ctx context.Context, target common.Target, ...) error
- func (m *Manager) Type() devicetypes.ComponentType
Constants ¶
const ( // ImplementationName is the name used to identify mock implementations. ImplementationName = "mock" // DefaultDelay is the simulated delay for mock operations. DefaultDelay = time.Second )
Variables ¶
This section is empty.
Functions ¶
func FactoryFor ¶
func FactoryFor(componentType devicetypes.ComponentType) componentmanager.ManagerFactory
FactoryFor creates a factory function for the specified component type.
func RegisterAll ¶
func RegisterAll(registry *componentmanager.Registry)
RegisterAll registers mock factories for all component types.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is a mock component manager for testing and development.
func New ¶
func New(componentType devicetypes.ComponentType) *Manager
New creates a new mock Manager for the specified component type.
func NewWithDelay ¶
func NewWithDelay(componentType devicetypes.ComponentType, delay time.Duration) *Manager
NewWithDelay creates a new mock Manager with a custom delay.
func (*Manager) AllowBringUpAndPowerOn ¶
AllowBringUpAndPowerOn simulates opening the power-on gate.
func (*Manager) FirmwareControl ¶
func (m *Manager) FirmwareControl( ctx context.Context, target common.Target, info operations.FirmwareControlTaskInfo, ) error
FirmwareControl simulates firmware operations.
func (*Manager) GetBringUpState ¶
func (m *Manager) GetBringUpState( ctx context.Context, target common.Target, ) (map[string]operations.MachineBringUpState, error)
GetBringUpState simulates getting bring-up state.
func (*Manager) GetFirmwareUpdateStatus ¶
func (m *Manager) GetFirmwareUpdateStatus( ctx context.Context, target common.Target, ) (map[string]operations.FirmwareUpdateStatus, error)
GetFirmwareUpdateStatus simulates getting firmware update status.
func (*Manager) GetPowerStatus ¶
func (m *Manager) GetPowerStatus( ctx context.Context, target common.Target, ) (map[string]operations.PowerStatus, error)
GetPowerStatus simulates getting power status.
func (*Manager) InjectExpectation ¶
func (m *Manager) InjectExpectation( ctx context.Context, target common.Target, info operations.InjectExpectationTaskInfo, ) error
InjectExpectation simulates injecting expected configuration.
func (*Manager) PowerControl ¶
func (m *Manager) PowerControl( ctx context.Context, target common.Target, info operations.PowerControlTaskInfo, ) error
PowerControl simulates power operations.
func (*Manager) StartFirmwareUpdate ¶
func (m *Manager) StartFirmwareUpdate( ctx context.Context, target common.Target, info operations.FirmwareControlTaskInfo, ) error
StartFirmwareUpdate simulates initiating firmware update without waiting for completion.
func (*Manager) Type ¶
func (m *Manager) Type() devicetypes.ComponentType
Type returns the component type this manager handles.