mock

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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

func (m *Manager) AllowBringUpAndPowerOn(
	ctx context.Context,
	target common.Target,
) error

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.

Jump to

Keyboard shortcuts

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