Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultAnalyzerTimeout = 5 * time.Minute
DefaultAnalyzerTimeout is the default timeout for analyzer execution.
Variables ¶
This section is empty.
Functions ¶
func ApplyEngineOptions ¶ added in v0.82.1
func ApplyEngineOptions(opts ...EngineOption) *engineConfig
ApplyEngineOptions applies all engine options and returns the configuration This is used internally by the engine implementation
Types ¶
type AnalyzerEngine ¶
type AnalyzerEngine interface {
Run(ctx context.Context, req RunRequest, proposal *mcms.TimelockProposal) (analyzer.AnalyzedProposal, error)
RegisterAnalyzer(analyzer analyzer.BaseAnalyzer) error
RegisterRenderer(renderer renderer.Renderer) error
RenderTo(w io.Writer, rendererID string, renderReq renderer.RenderRequest, proposal analyzer.AnalyzedProposal) error
}
func NewAnalyzerEngine ¶ added in v0.82.1
func NewAnalyzerEngine(opts ...EngineOption) AnalyzerEngine
type Deps ¶ added in v0.82.1
type Deps struct {
DecoderFactory func(cfg decoder.Config) (decoder.ProposalDecoder, error)
}
type EngineOption ¶ added in v0.82.1
type EngineOption func(*engineConfig)
EngineOption configures the analyzer engine using the functional options pattern
func WithAnalyzerTimeout ¶ added in v0.82.1
func WithAnalyzerTimeout(timeout time.Duration) EngineOption
WithAnalyzerTimeout allows configuring the timeout for analyzer execution Each analyzer will be given this amount of time to complete before being cancelled This is important for analyzers that make network calls or other long-running operations Default is 5 minutes if not specified
Example:
engine := proposalanalysis.NewAnalyzerEngine(
proposalanalysis.WithAnalyzerTimeout(2 * time.Minute),
)
type RunRequest ¶ added in v0.82.1
type RunRequest struct {
Domain cldfdomain.Domain
Environment *deployment.Environment
DecoderConfig decoder.Config
}
Click to show internal directories.
Click to hide internal directories.