mock

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 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) BringUpControl added in v1.2.0

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

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 added in v1.2.0

func (m *Manager) GetBringUpStatus(
	ctx context.Context,
	target common.Target,
) (map[string]operations.MachineBringUpState, error)

GetBringUpStatus simulates getting bring-up status.

func (*Manager) GetFirmwareStatus added in v1.2.0

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.

Jump to

Keyboard shortcuts

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