sequencer

package
v0.0.0-...-6d10cd0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2025 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SequenceConfig

type SequenceConfig struct {
	//Name (optional) name of the sequence
	Name string `yaml:"name" json:"name"`
	//Single (optional) should this sequence run in single copy or run in parallel
	Single bool `yaml:"single" json:"single"`
	//Steps execution steps of the sequence
	Steps []StepConfig `yaml:"steps" json:"steps"`
	//Processor name of processor to run the script
	Processor string `yaml:"processor" json:"processor"`
	//Inputs list of the inputs
	Inputs []string `yaml:"inputs" json:"inputs"`
}

SequenceConfig contains description of the execution sequence

type Sequencer

type Sequencer struct {
	//Env variables which represent env part of context data
	Env map[string]interface{} `yaml:"env"`
	//Inputs the list of inputs which should be matched if inputs list in step is empty
	Inputs []string `yaml:"inputs"`
	//Processor name of processor to run the scripts
	Processor string `yaml:"processor"`
	//Store name of store to save state of sequencer
	Store string `yaml:"store"`
	//StoreKey key string to use for storing sequencer state
	StoreKey string `yaml:"store_key"`
	//SequenceConfigs the list of sequence configs
	SequenceConfigs []SequenceConfig `yaml:"sequences"`

	sync.RWMutex
	// contains filtered or unexported fields
}

Sequencer implementation of Sequencer

func (*Sequencer) Init

func (s *Sequencer) Init(ctx context.Context, noload bool)

Init initializes Seqeuncer

func (*Sequencer) Roll

func (s *Sequencer) Roll(ctx context.Context, event *payload.Event) (response interface{})

Roll process event with sequences

func (*Sequencer) Stop

func (s *Sequencer) Stop(ctx context.Context)

Stop stops Sequencer

type StepConfig

type StepConfig struct {
	//Name (optional) of the step
	Name string `yaml:"name" json:"name"`
	//Inputs list of inputs to match
	Inputs []string `yaml:"inputs" json:"inputs"`
	//Types list of event types to match
	Types []string `yaml:"types" json:"types"`
	//Vars list of variables to be added to payload vars field
	Vars map[string]interface{} `yaml:"vars" json:"vars"`
	//File contains name of the file with scripts to be used with Match, Script and/or Method
	File string `yaml:"file" json:"file"`
	//Match contains matcher script
	Match interface{} `yaml:"match" json:"match"`
	//Script contains script to execute on successful match
	Script interface{} `yaml:"script" json:"script"`
	//Method contains name of the method to be executed from File
	Method string `yaml:"method" json:"method"`
	//Timeout (optional) time (in seconds) to cancel sequence if step is waiting longer
	Timeout int64 `yaml:"timeout" json:"timeout"`
	//MaxExecutionTime (optional) maximum time (in seconds) of execution of the script
	MaxExecutionTime int64 `yaml:"max_execution_time" json:"max_execution_time"`
	//Processor name of processor to run the script
	Processor string `yaml:"processor" json:"processor"`
}

StepConfig contains description of the sequence step

Jump to

Keyboard shortcuts

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