concurrent

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentProcessor

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

ConcurrentProcessor handles concurrent workflow analysis

func NewConcurrentProcessor

func NewConcurrentProcessor(config *ProcessorConfig) *ConcurrentProcessor

NewConcurrentProcessor creates a new concurrent processor

func (*ConcurrentProcessor) GetStats

func (cp *ConcurrentProcessor) GetStats() (completed, total int, config *ProcessorConfig)

GetStats returns processing statistics

func (*ConcurrentProcessor) ProcessWorkflows

func (cp *ConcurrentProcessor) ProcessWorkflows(
	ctx context.Context,
	workflowFiles []parser.WorkflowFile,
	standardRules []rules.Rule,
	policyEngine *policies.PolicyEngine,
	cfg *config.Config,
) ([]rules.Finding, error)

ProcessWorkflows processes multiple workflows concurrently

type ProcessorConfig

type ProcessorConfig struct {
	// MaxWorkers defines the maximum number of concurrent workers
	// If 0, uses number of CPU cores
	MaxWorkers int

	// Timeout for processing a single workflow file
	WorkflowTimeout time.Duration

	// Timeout for the entire analysis operation
	TotalTimeout time.Duration

	// Enable progress reporting
	ShowProgress bool

	// Buffer size for worker channels
	BufferSize int
}

ProcessorConfig contains configuration for concurrent processing

func DefaultProcessorConfig

func DefaultProcessorConfig() *ProcessorConfig

DefaultProcessorConfig returns a default configuration

type ProgressReporter

type ProgressReporter struct {
	Total     int
	Completed int
	// contains filtered or unexported fields
}

ProgressReporter handles progress reporting during concurrent processing

func NewProgressReporter

func NewProgressReporter(total int, showProgress bool) *ProgressReporter

NewProgressReporter creates a new progress reporter

func (*ProgressReporter) GetProgress

func (pr *ProgressReporter) GetProgress() (completed, total int)

GetProgress returns current progress information

func (*ProgressReporter) Update

func (pr *ProgressReporter) Update(workflowName string)

Update increments the completed count and reports progress

type WorkflowJob

type WorkflowJob struct {
	Workflow      parser.WorkflowFile
	StandardRules []rules.Rule
	PolicyEngine  *policies.PolicyEngine
	Config        *config.Config
}

WorkflowJob represents a single workflow analysis job

type WorkflowResult

type WorkflowResult struct {
	WorkflowName string
	Findings     []rules.Finding
	Error        error
	Duration     time.Duration
}

WorkflowResult represents the result of workflow analysis

Jump to

Keyboard shortcuts

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