Documentation
¶
Index ¶
- type Harness
- func (h *Harness) Handle(ctx context.Context, port string, msg any) any
- func (h *Harness) HandleAsLeader(ctx context.Context, port string, msg any) any
- func (h *Harness) Handler(ctx context.Context, port string, data any) any
- func (h *Harness) LeaderHandler(ctx context.Context, port string, data any) any
- func (h *Harness) NewPod() *Harness
- func (h *Harness) PortOutputs(port string) []any
- func (h *Harness) Ports() []module.Port
- func (h *Harness) Reconcile(ctx context.Context) any
- func (h *Harness) ReconcileAsLeader(ctx context.Context) any
- func (h *Harness) Reset()
- type PortMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Harness ¶
type Harness struct {
Metadata map[string]string
Outputs []PortMsg
// contains filtered or unexported fields
}
Harness wraps a component for testing. Captures all port outputs and manages metadata persistence.
func (*Harness) HandleAsLeader ¶
HandleAsLeader sends a message with IsLeader=true in context.
func (*Harness) LeaderHandler ¶
LeaderHandler returns a handler with IsLeader=true in context.
func (*Harness) PortOutputs ¶
PortOutputs returns all data sent to the given port.
func (*Harness) ReconcileAsLeader ¶
ReconcileAsLeader simulates a reconcile with IsLeader=true.
Click to show internal directories.
Click to hide internal directories.