Documentation
¶
Index ¶
- type ExecutionMode
- type Pipeline
- func (p *Pipeline) AddValidator(validator interfaces.Validator) error
- func (p *Pipeline) Execute(ctx context.Context, block interfaces.Block) interfaces.ValidationResult
- func (p *Pipeline) ExecuteParallel(ctx context.Context, block interfaces.Block) interfaces.ValidationResult
- func (p *Pipeline) GetMetrics() interfaces.ValidatorMetrics
- func (p *Pipeline) GetValidatorStats(name string) (*ValidatorStats, error)
- func (p *Pipeline) GetValidators() []interfaces.Validator
- func (p *Pipeline) RemoveValidator(name string) error
- func (p *Pipeline) SetMode(mode ExecutionMode)
- func (p *Pipeline) SetStopOnFirstError(stop bool)
- type PipelineMetrics
- type ValidatorStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExecutionMode ¶
type ExecutionMode string
ExecutionMode defines how validators are executed
const ( // ModeSequential executes validators one after another ModeSequential ExecutionMode = "sequential" // ModeParallel executes validators concurrently ModeParallel ExecutionMode = "parallel" )
type Pipeline ¶
type Pipeline struct {
// contains filtered or unexported fields
}
Pipeline implements the ValidationPipeline interface
func NewParallelPipeline ¶
func NewParallelPipeline() *Pipeline
NewParallelPipeline creates a pipeline that executes validators in parallel
func NewPipeline ¶
func NewPipeline(mode ExecutionMode) *Pipeline
NewPipeline creates a new validation pipeline
func NewSequentialPipeline ¶
func NewSequentialPipeline() *Pipeline
NewSequentialPipeline creates a pipeline that executes validators sequentially
func (*Pipeline) AddValidator ¶
func (p *Pipeline) AddValidator(validator interfaces.Validator) error
AddValidator adds a validator to the pipeline
func (*Pipeline) Execute ¶
func (p *Pipeline) Execute(ctx context.Context, block interfaces.Block) interfaces.ValidationResult
Execute runs all validators on the block
func (*Pipeline) ExecuteParallel ¶
func (p *Pipeline) ExecuteParallel(ctx context.Context, block interfaces.Block) interfaces.ValidationResult
ExecuteParallel runs validators concurrently
func (*Pipeline) GetMetrics ¶
func (p *Pipeline) GetMetrics() interfaces.ValidatorMetrics
GetMetrics returns pipeline metrics
func (*Pipeline) GetValidatorStats ¶
func (p *Pipeline) GetValidatorStats(name string) (*ValidatorStats, error)
GetValidatorStats returns statistics for a specific validator
func (*Pipeline) GetValidators ¶
func (p *Pipeline) GetValidators() []interfaces.Validator
GetValidators returns all validators in the pipeline
func (*Pipeline) RemoveValidator ¶
RemoveValidator removes a validator by name
func (*Pipeline) SetMode ¶
func (p *Pipeline) SetMode(mode ExecutionMode)
SetMode sets the execution mode (sequential or parallel)
func (*Pipeline) SetStopOnFirstError ¶
SetStopOnFirstError sets whether to stop validation on first error
type PipelineMetrics ¶
type PipelineMetrics struct {
// contains filtered or unexported fields
}
PipelineMetrics tracks validation pipeline statistics
func NewPipelineMetrics ¶
func NewPipelineMetrics() *PipelineMetrics
NewPipelineMetrics creates new pipeline metrics