workflows

package
v3.3.7 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package workflows contains the workflows

Index

Constants

This section is empty.

Variables

View Source
var ConditionTypes = map[string]ConditionType{
	"and": ANDCondition,
	"or":  ORCondition,
}

ConditionTypes is a table for conversion of condition type from string.

Functions

This section is empty.

Types

type ConditionType

type ConditionType int

ConditionType is the type of condition for matcher

const (
	// ANDCondition matches responses with AND condition in arguments.
	ANDCondition ConditionType = iota + 1
	// ORCondition matches responses with AND condition in arguments.
	ORCondition
)

type Matcher

type Matcher struct {
	// description: |
	//    Name is the name of the items to match.
	Name stringslice.StringSlice `yaml:"name,omitempty" json:"name,omitempty" jsonschema:"title=name of items to match,description=Name of items to match"`
	// description: |
	//   Condition is the optional condition between names. By default,
	//   the condition is assumed to be OR.
	// values:
	//   - "and"
	//   - "or"
	Condition string `` /* 153-byte string literal not displayed */
	// description: |
	//    Subtemplates are run if the name of matcher matches.
	Subtemplates []*WorkflowTemplate `` /* 148-byte string literal not displayed */
	// contains filtered or unexported fields
}

Matcher performs conditional matching on the workflow template results.

func (*Matcher) Compile

func (matcher *Matcher) Compile() error

Compile compiles the matcher for workflow

func (*Matcher) Match

func (matcher *Matcher) Match(result *operators.Result) bool

Match matches a name for matcher names or name

type ProtocolExecuterPair

type ProtocolExecuterPair struct {
	Executer     protocols.Executer
	Options      *protocols.ExecutorOptions
	TemplateType templateTypes.ProtocolType
}

ProtocolExecuterPair is a pair of protocol executer and its options

type Workflow

type Workflow struct {
	// description: |
	//   Workflows is a list of workflows to execute for a template.
	Workflows []*WorkflowTemplate `` /* 155-byte string literal not displayed */

	Options *protocols.ExecutorOptions `yaml:"-" json:"-"`
}

Workflow is a workflow to execute with chained requests, etc.

type WorkflowTemplate

type WorkflowTemplate struct {
	// description: |
	//   Template is a single template or directory to execute as part of workflow.
	// examples:
	//   - name: A single template
	//     value: "\"dns/worksites-detection.yaml\""
	//   - name: A template directory
	//     value: "\"misconfigurations/aem\""
	Template string `` /* 165-byte string literal not displayed */
	// description: |
	//    Tags to run templates based on.
	Tags stringslice.StringSlice `yaml:"tags,omitempty" json:"tags,omitempty" jsonschema:"title=tags to execute,description=Tags to run template based on"`
	// description: |
	//    Matchers perform name based matching to run subtemplates for a workflow.
	Matchers []*Matcher `` /* 190-byte string literal not displayed */
	// description: |
	//    Subtemplates are run if the `template` field Template matches.
	Subtemplates []*WorkflowTemplate `` /* 184-byte string literal not displayed */
	// Executers perform the actual execution for the workflow template
	Executers []*ProtocolExecuterPair `yaml:"-" json:"-"`
}

WorkflowTemplate is a template to be run as part of a workflow

Jump to

Keyboard shortcuts

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