workflow

package
v0.0.0-...-d1533f9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPredefinedWorkflows

func GetPredefinedWorkflows() map[string]*Workflow

Predefined workflows for common scenarios

Types

type StepResult

type StepResult struct {
	StepID    string          `json:"step_id"`
	Scanner   string          `json:"scanner"`
	Status    string          `json:"status"`
	StartTime time.Time       `json:"start_time"`
	EndTime   time.Time       `json:"end_time"`
	Duration  time.Duration   `json:"duration"`
	Findings  []types.Finding `json:"findings"`
	ErrorMsg  string          `json:"error_msg,omitempty"`
}

type Workflow

type Workflow struct {
	ID          string          `json:"id"`
	Name        string          `json:"name"`
	Description string          `json:"description"`
	Steps       []WorkflowStep  `json:"steps"`
	Options     WorkflowOptions `json:"options"`
}

type WorkflowCondition

type WorkflowCondition struct {
	Type     string      `json:"type"`     // "finding_count", "severity", "scanner_success"
	Operator string      `json:"operator"` // "gt", "lt", "eq", "contains"
	Value    interface{} `json:"value"`
}

type WorkflowEngine

type WorkflowEngine struct {
	// contains filtered or unexported fields
}

func NewWorkflowEngine

func NewWorkflowEngine(
	plugins core.PluginManager,
	store core.ResultStore,
	queue core.JobQueue,
	telemetry core.Telemetry,
	logger *logger.Logger,
) *WorkflowEngine

func (*WorkflowEngine) ExecuteWorkflow

func (e *WorkflowEngine) ExecuteWorkflow(ctx context.Context, workflow *Workflow, target string) (*WorkflowResult, error)

type WorkflowOptions

type WorkflowOptions struct {
	MaxConcurrency int           `json:"max_concurrency"`
	Timeout        time.Duration `json:"timeout"`
	OnFailure      string        `json:"on_failure"` // "continue", "stop"
	RetryCount     int           `json:"retry_count"`
}

type WorkflowResult

type WorkflowResult struct {
	WorkflowID    string          `json:"workflow_id"`
	Target        string          `json:"target"`
	Status        string          `json:"status"`
	StartTime     time.Time       `json:"start_time"`
	EndTime       time.Time       `json:"end_time"`
	Duration      time.Duration   `json:"duration"`
	StepResults   []StepResult    `json:"step_results"`
	TotalFindings int             `json:"total_findings"`
	Findings      []types.Finding `json:"findings"`
}

type WorkflowStep

type WorkflowStep struct {
	ID         string              `json:"id"`
	Name       string              `json:"name"`
	Scanner    string              `json:"scanner"`
	Options    map[string]string   `json:"options"`
	DependsOn  []string            `json:"depends_on"`
	Conditions []WorkflowCondition `json:"conditions"`
	Parallel   bool                `json:"parallel"`
	ContinueOn string              `json:"continue_on"` // "success", "failure", "always"
	Timeout    time.Duration       `json:"timeout"`
}

Jump to

Keyboard shortcuts

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