Documentation
¶
Index ¶
- func Conditions(cs ...Condition) *conditions
- func Or(conditions ...Condition) *orGroup
- func ParentCondition(parent NamedTask, expression string) *parentCondition
- func SleepCondition(duration time.Duration) *sleepCondition
- func UserEventCondition(eventKey string, expression string) *userEventCondition
- type Condition
- type ConditionMulti
- type NamedTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Conditions ¶
func Conditions(cs ...Condition) *conditions
Conditions creates a new condition that is satisfied if all of the conditions are satisfied.
func Or ¶
func Or(conditions ...Condition) *orGroup
Or creates a new condition that is satisfied if any of the conditions in the group are satisfied. By default, conditions are evaluated as an intersection (AND). For more complex conditions, you can use Or to create a group of conditions that are evaluated as a union (OR).
func ParentCondition ¶
ParentCondition creates a new condition that is satisfied based on the output of the parent task in a DAG.
func SleepCondition ¶
SleepCondition creates a new condition that waits for a specified duration.
func UserEventCondition ¶
UserEventCondition creates a new condition that waits for a user event to occur. The eventKey is the key of the user event that the condition is waiting for. The expression is an optional CEL expression that can be used to filter the user event, such as `event.data.key == "value"`.
Types ¶
type Condition ¶
type Condition interface {
ToPB(action contracts.Action) *ConditionMulti
}
Condition represents a set of conditions to either trigger a task or satisfy a wait condition. Callers should not use Condition directly. Instead, you should use a condition wrapper, such as Conditions, SleepCondition, UserEventCondition, ParentCondition, Or.
type ConditionMulti ¶
type ConditionMulti struct {
SleepConditions []*contracts.SleepMatchCondition
UserEventConditions []*contracts.UserEventMatchCondition
ParentConditions []*contracts.ParentOverrideMatchCondition
}