Documentation
¶
Index ¶
- Constants
- func DescriptorFor(componentType devicetypes.ComponentType) componentmanager.Descriptor
- func Descriptors() []componentmanager.Descriptor
- func FactoryFor(componentType devicetypes.ComponentType) componentmanager.ManagerFactory
- type Manager
- func (m *Manager) BringUpControl(ctx context.Context, target common.Target) error
- func (m *Manager) FirmwareControl(ctx context.Context, target common.Target, ...) error
- func (m *Manager) GetBringUpStatus(ctx context.Context, target common.Target) (map[string]operations.MachineBringUpState, error)
- func (m *Manager) GetFirmwareStatus(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) 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 DescriptorFor ¶
func DescriptorFor(componentType devicetypes.ComponentType) componentmanager.Descriptor
DescriptorFor returns a mock manager descriptor for the specified component type.
func Descriptors ¶
func Descriptors() []componentmanager.Descriptor
Descriptors returns mock descriptors for all component types currently supported by the RLA service.
func FactoryFor ¶
func FactoryFor(componentType devicetypes.ComponentType) componentmanager.ManagerFactory
FactoryFor creates a factory function for the specified component type.
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) BringUpControl ¶
BringUpControl simulates opening the bring-up gate.
func (*Manager) FirmwareControl ¶
func (m *Manager) FirmwareControl( ctx context.Context, target common.Target, info operations.FirmwareControlTaskInfo, ) error
FirmwareControl simulates initiating firmware update without waiting for completion.
func (*Manager) GetBringUpStatus ¶
func (m *Manager) GetBringUpStatus( ctx context.Context, target common.Target, ) (map[string]operations.MachineBringUpState, error)
GetBringUpStatus simulates getting bring-up status.
func (*Manager) GetFirmwareStatus ¶
func (m *Manager) GetFirmwareStatus( ctx context.Context, target common.Target, ) (map[string]operations.FirmwareUpdateStatus, error)
GetFirmwareStatus 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) Type ¶
func (m *Manager) Type() devicetypes.ComponentType
Type returns the component type this manager handles.