history

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryStore

type HistoryStore interface {
	SaveTransition(record *TransitionRecord) error
	ListHistory(workflowID string, opts QueryOptions) ([]TransitionRecord, error)
	GenerateSchema() string
	Initialize() error
}

HistoryStore is the interface for saving and querying transition history.

type Option

type Option func(*SQLiteHistory)

func WithCustomFields

func WithCustomFields(fields map[string]string) Option

func WithTable

func WithTable(name string) Option

type QueryOptions

type QueryOptions struct {
	Limit      int
	Offset     int
	FromDate   *time.Time
	ToDate     *time.Time
	Actor      string
	Transition string
}

QueryOptions allows for pagination and filtering.

type SQLiteHistory

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

func NewSQLiteHistory

func NewSQLiteHistory(db *sql.DB, opts ...Option) *SQLiteHistory

func (*SQLiteHistory) GenerateSchema

func (h *SQLiteHistory) GenerateSchema() string

func (*SQLiteHistory) Initialize

func (h *SQLiteHistory) Initialize() error

func (*SQLiteHistory) ListHistory

func (h *SQLiteHistory) ListHistory(workflowID string, opts QueryOptions) ([]TransitionRecord, error)

func (*SQLiteHistory) SaveTransition

func (h *SQLiteHistory) SaveTransition(record *TransitionRecord) error

type TransitionRecord

type TransitionRecord struct {
	WorkflowID   string
	FromState    string
	ToState      string
	Transition   string
	Notes        string
	Actor        string
	CreatedAt    time.Time
	CustomFields map[string]interface{} // For custom columns, if any
}

TransitionRecord is the base struct for a transition event.

Jump to

Keyboard shortcuts

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