mocks

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilContext = errors.New("nil context")
	ErrNoCycles   = errors.New("cycles must be > 0")
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

Controller implements a simple simulation controller for testing purposes.

func NewController

func NewController() *Controller

NewController creates a mock controller ready for injection.

func (*Controller) GetState

func (m *Controller) GetState() *state.NetworkState

GetState returns the last recorded state.

func (*Controller) LoadPreset

func (m *Controller) LoadPreset(name string, params map[string]int) error

LoadPreset loads a pre-defined network topology.

func (*Controller) Rebuild

func (m *Controller) Rebuild(cfg config.EntityConfig) error

Rebuild resets the simulation state based on the provided configuration.

func (*Controller) Run

func (m *Controller) Run(ctx context.Context, cfg config.EntityConfig, cycles uint64) error

Run satisfies the simulation controller contract.

func (*Controller) SetState

func (m *Controller) SetState(ns state.NetworkState)

SetState updates the current network state.

func (*Controller) Subscribe

func (m *Controller) Subscribe() <-chan state.NetworkState

Subscribe returns a channel that receives state updates.

Jump to

Keyboard shortcuts

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