Documentation
¶
Index ¶
- type Dialect
- type MySQLDialect
- type Options
- type PostgresDialect
- type SQLStorage
- func (s *SQLStorage) AppendCompensationRecord(ctx context.Context, namespace string, rec *models.CompensationRecord) error
- func (s *SQLStorage) ClaimReadyStep(ctx context.Context, namespace string, workerID string) (*models.ExecutionStep, error)
- func (s *SQLStorage) CreateExecution(ctx context.Context, namespace string, exec *models.Execution) error
- func (s *SQLStorage) CreateExecutionStep(ctx context.Context, namespace string, step *models.ExecutionStep) error
- func (s *SQLStorage) DeleteSchedule(ctx context.Context, namespace, id string) error
- func (s *SQLStorage) GetActiveSchedules(ctx context.Context) ([]*models.Schedule, error)
- func (s *SQLStorage) GetExecution(ctx context.Context, namespace string, id string) (*models.Execution, error)
- func (s *SQLStorage) GetExecutionStepByNode(ctx context.Context, namespace, executionID, nodeID string) (*models.ExecutionStep, error)
- func (s *SQLStorage) GetExecutionSteps(ctx context.Context, namespace string, executionID string) ([]*models.ExecutionStep, error)
- func (s *SQLStorage) GetSchedule(ctx context.Context, namespace, id string) (*models.Schedule, error)
- func (s *SQLStorage) GetWorkflow(ctx context.Context, namespace string, id string) (*models.Workflow, error)
- func (s *SQLStorage) HeartbeatStep(ctx context.Context, namespace, stepID, workerID string) (bool, error)
- func (s *SQLStorage) ListCompensationRecords(ctx context.Context, namespace, executionID string) ([]*models.CompensationRecord, error)
- func (s *SQLStorage) ListExecutions(ctx context.Context, namespace string) ([]*models.Execution, error)
- func (s *SQLStorage) ListSchedules(ctx context.Context, namespace string, filter storage.ScheduleFilter) ([]*models.Schedule, error)
- func (s *SQLStorage) ListWaitingSteps(ctx context.Context, namespace string, filter storage.TaskFilter) ([]*models.ExecutionStep, error)
- func (s *SQLStorage) ListWorkflows(ctx context.Context, namespace string) ([]*models.Workflow, error)
- func (s *SQLStorage) RecordScheduleRun(ctx context.Context, namespace, id string, fireAt time.Time, ...) error
- func (s *SQLStorage) RunMigrations() error
- func (s *SQLStorage) SaveSchedule(ctx context.Context, sched *models.Schedule) error
- func (s *SQLStorage) SaveWorkflow(ctx context.Context, namespace string, wf *models.Workflow) error
- func (s *SQLStorage) SetEncryption(crypto *storage.Crypto)
- func (s *SQLStorage) TryClaimScheduleRun(ctx context.Context, namespace, id string, fireAt time.Time) (bool, error)
- func (s *SQLStorage) UpdateExecution(ctx context.Context, namespace string, exec *models.Execution) error
- func (s *SQLStorage) UpdateExecutionIf(ctx context.Context, namespace string, exec *models.Execution, ...) (bool, error)
- func (s *SQLStorage) UpdateExecutionStep(ctx context.Context, namespace string, step *models.ExecutionStep) error
- func (s *SQLStorage) UpdateExecutionStepIf(ctx context.Context, namespace string, step *models.ExecutionStep, ...) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLDialect ¶
type MySQLDialect struct{}
func (MySQLDialect) Name ¶
func (d MySQLDialect) Name() string
func (MySQLDialect) Placeholder ¶
func (d MySQLDialect) Placeholder(n int) string
func (MySQLDialect) SkipLocked ¶
func (d MySQLDialect) SkipLocked(query string) string
type Options ¶
type Options struct {
TablePrefix string // e.g. "flow_" so tables become flow_workflows
AutoMigrate bool // default true when using constructors below
VarHistory bool // reserved; history table optional
}
Options configures SQL storage table naming and migrations.
type PostgresDialect ¶
type PostgresDialect struct{}
func (PostgresDialect) Name ¶
func (d PostgresDialect) Name() string
func (PostgresDialect) Placeholder ¶
func (d PostgresDialect) Placeholder(n int) string
func (PostgresDialect) SkipLocked ¶
func (d PostgresDialect) SkipLocked(query string) string
type SQLStorage ¶
type SQLStorage struct {
// contains filtered or unexported fields
}
func NewSQLStorage ¶
func NewSQLStorage(db *sqlx.DB, dialectName string) (*SQLStorage, error)
NewSQLStorage creates storage with auto-migrate and empty prefix (back-compat).
func NewSQLStorageFromDB ¶
NewSQLStorageFromDB wraps database/sql.DB via sqlx.
func NewSQLStorageWithOptions ¶
NewSQLStorageWithOptions creates storage with custom options.
func (*SQLStorage) AppendCompensationRecord ¶
func (s *SQLStorage) AppendCompensationRecord(ctx context.Context, namespace string, rec *models.CompensationRecord) error
func (*SQLStorage) ClaimReadyStep ¶
func (s *SQLStorage) ClaimReadyStep(ctx context.Context, namespace string, workerID string) (*models.ExecutionStep, error)
func (*SQLStorage) CreateExecution ¶
func (*SQLStorage) CreateExecutionStep ¶
func (s *SQLStorage) CreateExecutionStep(ctx context.Context, namespace string, step *models.ExecutionStep) error
func (*SQLStorage) DeleteSchedule ¶
func (s *SQLStorage) DeleteSchedule(ctx context.Context, namespace, id string) error
func (*SQLStorage) GetActiveSchedules ¶
func (*SQLStorage) GetExecution ¶
func (*SQLStorage) GetExecutionStepByNode ¶
func (s *SQLStorage) GetExecutionStepByNode(ctx context.Context, namespace, executionID, nodeID string) (*models.ExecutionStep, error)
func (*SQLStorage) GetExecutionSteps ¶
func (s *SQLStorage) GetExecutionSteps(ctx context.Context, namespace string, executionID string) ([]*models.ExecutionStep, error)
func (*SQLStorage) GetSchedule ¶
func (*SQLStorage) GetWorkflow ¶
func (*SQLStorage) HeartbeatStep ¶
func (s *SQLStorage) HeartbeatStep(ctx context.Context, namespace, stepID, workerID string) (bool, error)
HeartbeatStep extends the lease of a RUNNING step owned by workerID.
func (*SQLStorage) ListCompensationRecords ¶
func (s *SQLStorage) ListCompensationRecords(ctx context.Context, namespace, executionID string) ([]*models.CompensationRecord, error)
func (*SQLStorage) ListExecutions ¶
func (*SQLStorage) ListSchedules ¶
func (s *SQLStorage) ListSchedules(ctx context.Context, namespace string, filter storage.ScheduleFilter) ([]*models.Schedule, error)
func (*SQLStorage) ListWaitingSteps ¶
func (s *SQLStorage) ListWaitingSteps(ctx context.Context, namespace string, filter storage.TaskFilter) ([]*models.ExecutionStep, error)
func (*SQLStorage) ListWorkflows ¶
func (*SQLStorage) RecordScheduleRun ¶
func (*SQLStorage) RunMigrations ¶
func (s *SQLStorage) RunMigrations() error
func (*SQLStorage) SaveSchedule ¶
func (*SQLStorage) SaveWorkflow ¶
func (*SQLStorage) SetEncryption ¶
func (s *SQLStorage) SetEncryption(crypto *storage.Crypto)
func (*SQLStorage) TryClaimScheduleRun ¶
func (*SQLStorage) UpdateExecution ¶
func (*SQLStorage) UpdateExecutionIf ¶
func (s *SQLStorage) UpdateExecutionIf(ctx context.Context, namespace string, exec *models.Execution, from models.TaskStatus) (bool, error)
UpdateExecutionIf implements storage.ConditionalUpdater.
func (*SQLStorage) UpdateExecutionStep ¶
func (s *SQLStorage) UpdateExecutionStep(ctx context.Context, namespace string, step *models.ExecutionStep) error
func (*SQLStorage) UpdateExecutionStepIf ¶
func (s *SQLStorage) UpdateExecutionStepIf(ctx context.Context, namespace string, step *models.ExecutionStep, from models.TaskStatus, worker string) (bool, error)
UpdateExecutionStepIf implements storage.ConditionalUpdater.