store

package
v0.8.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExecutionStateModel added in v0.8.3

type ExecutionStateModel struct {
	ID         uint   `gorm:"primaryKey"`
	WorkflowID string `gorm:"size:128;index:idx_workflow_run,unique"`
	RunID      string `gorm:"size:128;index:idx_workflow_run,unique"`
	Status     string `gorm:"size:64"`
	StartedAt  time.Time
	UpdatedAt  time.Time
	Nodes      datatypes.JSON `gorm:"type:json"`
	CreatedAt  time.Time
	DeletedAt  gorm.DeletedAt `gorm:"index"`
}

type GormStateStore added in v0.8.3

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

func NewGormStateStore added in v0.8.3

func NewGormStateStore(db *gorm.DB) (*GormStateStore, error)

func (*GormStateStore) Load added in v0.8.3

func (s *GormStateStore) Load(_ context.Context, workflowID, runID string) (*workflow.ExecutionState, error)

func (*GormStateStore) Save added in v0.8.3

type InMemoryState

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

func (*InMemoryState) Load

func (s *InMemoryState) Load() (PipelineState, error)

func (*InMemoryState) Save

func (s *InMemoryState) Save(state PipelineState) error

type MemoryStateStore added in v0.8.3

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

func NewMemoryStateStore added in v0.8.3

func NewMemoryStateStore() *MemoryStateStore

func (*MemoryStateStore) Load added in v0.8.3

func (s *MemoryStateStore) Load(_ context.Context, workflowID, runID string) (*workflow.ExecutionState, error)

func (*MemoryStateStore) Save added in v0.8.3

type PipelineState

type PipelineState struct {
	CurrentStageIndex int
	// 如果Stage内部有多个Unit并行或串行执行的上下文,也需要记录当前Unit的进度
	CurrentUnitIndex int
	Status           string
	// 可以存储上一阶段的输出数据,用于从中间点恢复
	LastOutput any
}

Jump to

Keyboard shortcuts

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