Documentation ¶
Index ¶
- Constants
- func AppendStatus(addr *int64, update int64) (change bool)
- func CopyProperties(src, dst interface{})
- func CreateStruct[T any](src any) (target T)
- func ExplainStatus(status int64) []string
- func GetFuncName(f interface{}) string
- func GetIndex(value any) string
- func IsStatusNormal(status int64) bool
- type Context
- type Feature
- type Procedure
- func (pcd *Procedure) AddConfig(config *ProduceConfig)
- func (pcd *Procedure) AddStep(run func(ctx *Context) (any, error), depends ...any) *Step
- func (pcd *Procedure) AddStepWithAlias(alias string, run func(ctx *Context) (any, error), depends ...any) *Step
- func (pcd *Procedure) AddWaitAll(alias string, run func(ctx *Context) (any, error)) *Step
- func (pcd *Procedure) AddWaitBefore(alias string, run func(ctx *Context) (any, error)) *Step
- func (pcd *Procedure) DrawRelation() (procedureName string, depends map[string][]string)
- func (pcd *Procedure) Pause()
- func (pcd *Procedure) SkipFinishedStep(name string, result any)
- func (pcd *Procedure) SupplyCtx(key string, value any)
- func (pcd *Procedure) SupplyCtxByMap(update map[string]any)
- type ProduceConfig
- type Step
- type StepConfig
- type StepInfo
- type Workflow
Constants ¶
View Source
const ( InternalPrefix = "~" WorkflowCtx = "~workflow~" ProcedureCtx = "~procedure~" )
View Source
const ( NoUse = int64(-1) End = int64(0) Start = int64(1) )
View Source
const ( Pending = int64(0) Running = int64(0b1) Pause = int64(0b1 << 1) Success = int64(0b1 << 15) NormalMask = int64(0b1<<16 - 1) Cancel = int64(0b1 << 16) Timeout = int64(0b1 << 17) Panic = int64(0b11 << 18) Failed = int64(0b1 << 31) // abnormal produce status will cause the cancellation of unexecuted steps during execution // abnormal step status will cause the cancellation of unexecuted steps that depend on it AbnormalMask = NormalMask << 16 )
Variables ¶
This section is empty.
Functions ¶
func AppendStatus ¶
func CopyProperties ¶
func CopyProperties(src, dst interface{})
func CreateStruct ¶
func ExplainStatus ¶
func GetFuncName ¶
func GetFuncName(f interface{}) string
func IsStatusNormal ¶
Types ¶
type Feature ¶
type Feature struct {
// contains filtered or unexported fields
}
func (*Feature) GetStatusExplain ¶
func (*Feature) WaitToDone ¶
func (f *Feature) WaitToDone()
type Procedure ¶
type Procedure struct {
// contains filtered or unexported fields
}
func (*Procedure) AddConfig ¶
func (pcd *Procedure) AddConfig(config *ProduceConfig)
func (*Procedure) AddStepWithAlias ¶
func (*Procedure) AddWaitAll ¶
func (*Procedure) AddWaitBefore ¶
func (*Procedure) DrawRelation ¶
func (*Procedure) SkipFinishedStep ¶
func (*Procedure) SupplyCtxByMap ¶
type ProduceConfig ¶
type Step ¶
type Step struct { Start time.Time End time.Time Err error // contains filtered or unexported fields }
func (*Step) AddConfig ¶
func (step *Step) AddConfig(config *StepConfig)
func (*Step) AddPriority ¶
type StepConfig ¶
type Workflow ¶
type Workflow struct {
// contains filtered or unexported fields
}
func NewWorkflow ¶
func (*Workflow) AddProcedure ¶
func (wf *Workflow) AddProcedure(name string, conf *ProduceConfig) *Procedure
func (*Workflow) WaitToDone ¶
Click to show internal directories.
Click to hide internal directories.