condition

package
v0.73.106 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

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

func ParentCondition(parent NamedTask, expression string) *parentCondition

ParentCondition creates a new condition that is satisfied based on the output of the parent task in a DAG.

func SleepCondition

func SleepCondition(duration time.Duration) *sleepCondition

SleepCondition creates a new condition that waits for a specified duration.

func UserEventCondition

func UserEventCondition(eventKey string, expression string) *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
}

type NamedTask

type NamedTask interface {
	// GetName returns the name of the task
	GetName() string
}

NamedTask defines an interface for task types that have a name

Jump to

Keyboard shortcuts

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