Versions in this module Expand all Collapse all v4 v4.6.0 Dec 12, 2024 Changes in this version + type Task struct + type TaskFlow struct + func NewTaskFlow(ctx context.Context, name string) *TaskFlow + func (p *TaskFlow) AddTask(name string, run TaskRunFunc, revert TaskRevertFunc) + func (p *TaskFlow) AddTaskWithOutRevert(run TaskWithoutRevert) *TaskFlow + func (p *TaskFlow) GetResult() map[string]interface{} + func (p *TaskFlow) Revert() + func (p *TaskFlow) Run(params map[string]interface{}) (map[string]interface{}, error) + func (p *TaskFlow) RunWithOutRevert(params map[string]interface{}) error + type TaskRevertFunc func(ctx context.Context, result map[string]interface{}) error + type TaskRunFunc func(ctx context.Context, params map[string]interface{}, ...) (map[string]interface{}, error) + type TaskWithoutRevert func(ctx context.Context, params map[string]interface{}) error + type Transaction struct + func NewTransaction() *Transaction + func (t *Transaction) Commit() error + func (t *Transaction) Rollback() + func (t *Transaction) Then(exec func() error, onRollback func()) *Transaction