journal

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BranchJournal

type BranchJournal interface {
	Get(ctx context.Context, runID, sourceNode string) ([]BranchRecord, bool, error)
	Put(ctx context.Context, runID, sourceNode string, records []BranchRecord) error
}

BranchJournal persists branching decisions for deterministic execution replay.

type BranchRecord

type BranchRecord struct {
	RunID       string       `json:"run_id"`
	SourceNode  string       `json:"source_node"`
	From        string       `json:"from"`
	To          string       `json:"to"`
	When        string       `json:"when,omitempty"`
	Otherwise   bool         `json:"otherwise,omitempty"`
	Status      BranchStatus `json:"status"`
	Reason      string       `json:"reason"`
	DecisionSeq int          `json:"decision_seq"`
	CreatedAt   time.Time    `json:"created_at"`
}

type BranchStatus

type BranchStatus string
const (
	BranchSelected BranchStatus = "selected"
	BranchSkipped  BranchStatus = "skipped"
)

type MemoryBranchJournal

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

func NewMemoryBranchJournal

func NewMemoryBranchJournal() *MemoryBranchJournal

func (*MemoryBranchJournal) Get

func (j *MemoryBranchJournal) Get(_ context.Context, runID, sourceNode string) ([]BranchRecord, bool, error)

func (*MemoryBranchJournal) Put

func (j *MemoryBranchJournal) Put(_ context.Context, runID, sourceNode string, records []BranchRecord) error

type SQLBranchJournal

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

func NewSQLBranchJournal

func NewSQLBranchJournal(db *sql.DB) *SQLBranchJournal

func (*SQLBranchJournal) EnsureSchema

func (j *SQLBranchJournal) EnsureSchema(ctx context.Context) error

func (*SQLBranchJournal) Get

func (j *SQLBranchJournal) Get(ctx context.Context, runID, sourceNode string) ([]BranchRecord, bool, error)

func (*SQLBranchJournal) Put

func (j *SQLBranchJournal) Put(ctx context.Context, runID, sourceNode string, records []BranchRecord) error

Jump to

Keyboard shortcuts

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