testengine

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testengine is the private bridge between flow's production deterministic recorders and the public database-free flowtest package. It contains no implementation of orchestration semantics.

Index

Constants

This section is empty.

Variables

View Source
var Run func(any, Request) (Result, error)

Functions

This section is empty.

Types

type EventInput

type EventInput struct {
	Name     string
	Key      string
	Position int64
	Payload  json.RawMessage
}

type EventWait

type EventWait struct {
	Name string
	Key  string
}

type Info

type Info struct {
	RunID            string
	RunKey           string
	CommandID        string
	CommandKey       string
	Name             string
	Version          int
	CreatedAt        time.Time
	BudgetStartedAt  time.Time
	Attempt          int
	AttemptStartedAt time.Time
}

type Operation

type Operation string
const (
	Worker Operation = "worker"
	Commit Operation = "commit"
)

type Request

type Request struct {
	Operation   Operation
	Context     context.Context
	Args        json.RawMessage
	Result      json.RawMessage
	Info        Info
	Tx          any
	EventInputs []EventInput
}

type Result

type Result struct {
	Value        json.RawMessage
	HandlerError error
	Panicked     bool
	Commands     []StagedCommand
	Events       []StagedEvent
}

func Invoke

func Invoke(registration any, request Request) (Result, error)

type StagedCommand

type StagedCommand struct {
	Key        string
	Name       string
	Version    int
	Args       json.RawMessage
	StartAfter time.Duration
	Waits      []EventWait
	Within     time.Duration
}

type StagedEvent

type StagedEvent struct {
	Name    string
	Key     string
	Payload json.RawMessage
}

Jump to

Keyboard shortcuts

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