Documentation ¶
Overview ¶
Package driver contains a Driver implementation that sends analyses to a CompilationAnalyzer based on a Queue of compilations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompilationFunc ¶
type CompilationFunc func(context.Context, *apb.CompilationUnit) error
CompilationFunc handles a single CompilationUnit.
type Driver ¶
type Driver struct { Analyzer analysis.CompilationAnalyzer FileDataService string // AnalysisError is called for each non-nil err returned from the Analyzer // (before Teardown is called). The error returned from AnalysisError // replaces the analysis error that would normally be returned from Run. AnalysisError func(context.Context, *apb.CompilationUnit, error) error // Compilations is a queue of compilations to be sent for analysis. Compilations Queue // Setup is called after a compilation has been pulled from the Queue and // before it is sent to the Analyzer (or Output is called). Setup CompilationFunc // Output is called for each analysis output returned from the Analyzer Output analysis.OutputFunc // Teardown is called after a compilation has been analyzed and there will be no further calls to Output. Teardown CompilationFunc }
Driver sends compilations sequentially from a queue to an analyzer.
type Queue ¶
type Queue interface { // Next invokes f with the next available compilation in the queue. If no // further values are available, Next must return io.EOF; otherwise, the // return value from f is propagated to the caller of Next. Next(_ context.Context, f CompilationFunc) error }
A Queue represents an ordered sequence of compilation units.
Click to show internal directories.
Click to hide internal directories.