Documentation
¶
Index ¶
- Constants
- func Int(i int) string
- func Str(s string) string
- type BoolExprEvaluator
- type CELParser
- func (p *CELParser) CheckStepRunOutAgainstKnown(out *StepRunOut, knownType sqlcv1.StepExpressionKind) error
- func (p *CELParser) CheckStepRunOutAgainstKnownV1(out *StepRunOut, knownType sqlcv1.StepExpressionKind) error
- func (p *CELParser) EvaluateEventExpression(expr string, input Input) (bool, error)
- func (p *CELParser) EvaluateIncomingWebhookExpression(expr string, input Input) (string, error)
- func (p *CELParser) ParseAndEvalIdempotencyKey(idempotencyKeyExpr string, in Input) (string, error)
- func (p *CELParser) ParseAndEvalStepRun(stepRunExpr string, in Input) (*StepRunOut, error)
- func (p *CELParser) ParseAndEvalWorkflowString(workflowExp string, in Input) (string, error)
- func (p *CELParser) ParseIdempotencyKey(idempotencyKeyExpr string) (cel.Program, error)
- func (p *CELParser) ParseStepRun(stepRunExpr string) (cel.Program, error)
- func (p *CELParser) ParseWorkflowString(workflowExp string) (cel.Program, error)
- func (p *CELParser) ValidateWorkflowStringAsInt(workflowExp string) error
- type Input
- type InputOpts
- func WithAdditionalMetadata(metadata map[string]interface{}) InputOpts
- func WithEventID(eventID uuid.UUID) InputOpts
- func WithEventKey(key string) InputOpts
- func WithHeaders(headers map[string]string) InputOpts
- func WithInput(input map[string]interface{}) InputOpts
- func WithParents(parents map[string]map[string]interface{}) InputOpts
- func WithPayload(payload map[string]interface{}) InputOpts
- func WithWorkflowRunID(workflowRunID uuid.UUID) InputOpts
- type StepRunOut
- type StepRunOutType
Constants ¶
View Source
const ( // MaxEvalCost bounds the runtime cost of a single evaluation. Expressions are // tenant-supplied and evaluated in the shared API and engine processes, so a // nested comprehension over literal or attacker-sized lists must fail instead // of consuming unbounded CPU and memory. Ordinary expressions cost a few units // per operation; string traversal costs about 0.1 per byte, which leaves room // for multi-megabyte payloads. MaxEvalCost uint64 = 1_000_000 // MaxEvalDuration bounds wall-clock time per evaluation as a backstop for work // the cost model underestimates. MaxEvalDuration = 5 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BoolExprEvaluator ¶ added in v0.104.0
type BoolExprEvaluator struct {
// contains filtered or unexported fields
}
func NewBoolExprEvaluator ¶ added in v0.104.0
func NewBoolExprEvaluator() (*BoolExprEvaluator, error)
func (*BoolExprEvaluator) Compile ¶ added in v0.104.0
func (e *BoolExprEvaluator) Compile(expr string) (celgo.Program, error)
func (*BoolExprEvaluator) EvalBoolExpr ¶ added in v0.104.0
type CELParser ¶
type CELParser struct {
// contains filtered or unexported fields
}
func NewCELParser ¶
func NewCELParser() *CELParser
func (*CELParser) CheckStepRunOutAgainstKnown ¶
func (p *CELParser) CheckStepRunOutAgainstKnown(out *StepRunOut, knownType sqlcv1.StepExpressionKind) error
func (*CELParser) CheckStepRunOutAgainstKnownV1 ¶
func (p *CELParser) CheckStepRunOutAgainstKnownV1(out *StepRunOut, knownType sqlcv1.StepExpressionKind) error
func (*CELParser) EvaluateEventExpression ¶
func (*CELParser) EvaluateIncomingWebhookExpression ¶ added in v0.70.0
func (*CELParser) ParseAndEvalIdempotencyKey ¶ added in v0.106.0
func (*CELParser) ParseAndEvalStepRun ¶
func (p *CELParser) ParseAndEvalStepRun(stepRunExpr string, in Input) (*StepRunOut, error)
func (*CELParser) ParseAndEvalWorkflowString ¶
func (*CELParser) ParseIdempotencyKey ¶ added in v0.106.0
func (*CELParser) ParseStepRun ¶
func (*CELParser) ParseWorkflowString ¶
func (*CELParser) ValidateWorkflowStringAsInt ¶ added in v0.105.22
ValidateWorkflowStringAsInt compiles like ParseWorkflowString but additionally rejects expressions whose static output type can never be an integer (string or bool). Most real expressions read the dyn input maps and infer dyn, which passes here; the evaluation-time int check at task insert is the backstop.
type InputOpts ¶
type InputOpts func(Input)
func WithAdditionalMetadata ¶
func WithEventID ¶
func WithEventKey ¶
func WithHeaders ¶ added in v0.70.7
func WithParents ¶
func WithPayload ¶
func WithWorkflowRunID ¶
type StepRunOut ¶
type StepRunOut struct {
String *string
Int *int
Type StepRunOutType
}
type StepRunOutType ¶
type StepRunOutType string
const ( StepRunOutTypeString StepRunOutType = "string" StepRunOutTypeInt StepRunOutType = "int" )
Click to show internal directories.
Click to hide internal directories.