Documentation
¶
Overview ¶
Package flowtest provides database-free helpers backed by Flow's production codecs and deterministic engine primitives.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunCommit ¶
func RunCommit[A, R any](ctx context.Context, registration flow.Registration, tx flow.Tx, args A, result R, info flow.CommandInfo) error
RunCommit invokes the production declared commit function with a caller's transaction double. A registration without a commit function is a no-op.
Types ¶
type CanonicalValue ¶
func AssertCanonicalStable ¶
func AssertCanonicalStable(t TestingT, value any) CanonicalValue
func Canonical ¶
func Canonical(value any) (CanonicalValue, error)
type DirectResult ¶
type DirectResult[R any] struct { Result R Commands map[string]json.RawMessage Events []StagedEvent }
func RunDirect ¶
func RunDirect[A, R any](ctx context.Context, root flow.Registration, args A, maxCommands int, resolver func(name string, version int) (flow.Registration, bool)) (DirectResult[R], error)
RunDirect recursively executes a closed tree of successful worker decisions. Resolver supplies registrations for staged sub-command name/version.
type RetryClass ¶
type RetryClass string
const ( Retryable RetryClass = "retryable" RetryAt RetryClass = "retry_after" Permanent RetryClass = "permanent" Panic RetryClass = "panic" Timeout RetryClass = "timeout" Interrupted RetryClass = "interrupted" LeaseLost RetryClass = "lease_lost" )
type RetryDecision ¶
type RetryDecision struct {
Retry bool
ConsumesAttempt bool
ConsumedAttempts int
NextAttemptAt time.Time
StopReason string
}
func DecideRetry ¶
func DecideRetry(policy flow.RetryPolicy, input RetryInput) (RetryDecision, error)
type RetryInput ¶
type StagedCommand ¶
type StagedEvent ¶
type StagedEvent struct {
Name string
Key string
Payload json.RawMessage
}
type WorkerOption ¶
type WorkerOption interface {
// contains filtered or unexported methods
}
func WithCommandInfo ¶
func WithCommandInfo(info flow.CommandInfo) WorkerOption
type WorkerResult ¶
type WorkerResult[R any] struct { Result R Err error Panicked bool Commands []StagedCommand Events []StagedEvent }
func RunWorker ¶
func RunWorker[A, R any](ctx context.Context, registration flow.Registration, args A, opts ...WorkerOption) (WorkerResult[R], error)
RunWorker invokes the registered production worker and production staged decision recorder without PostgreSQL.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package replaytest provides PostgreSQL-backed assertions for verifying that Flow's journal replay agrees with its live projections.
|
Package replaytest provides PostgreSQL-backed assertions for verifying that Flow's journal replay agrees with its live projections. |
Click to show internal directories.
Click to hide internal directories.