Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBadDispatch = errors.New("ctx, linter and regexp must be provided")
ErrBadDispatch is returned when a dispatcher is created with bad parameters
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
Job is a single job to be run by the orchestrator it carries its dispatcher's context across the queue, like an http.Request, for the producer span and cancellation
type JobOrchestrator ¶
type JobOrchestrator struct {
// contains filtered or unexported fields
}
JobOrchestrator is responsible for dispatching jobs to dispatchers
func New ¶
func New(files []string, reporter linter.Reporter, locking, failFast bool) *JobOrchestrator
New creates a new JobOrchestrator locking decides if we should have an exclusive lock per file due to potential writes
func (*JobOrchestrator) CreateDispatcher ¶
func (d *JobOrchestrator) CreateDispatcher(ctx context.Context, l linter.Linter, reg *regexp.Regexp, groupBy string) error
CreateDispatcher submits jobQ to the dispatchers, ctx should be the one returned by Start so it stops when the run is aborted. If groupBy is non-empty, matched files are grouped by nearest ancestor directory containing the named marker file (e.g. "go.mod"), and the linter runs once per group. Otherwise a batched linter.BatchLinter runs once per chunk of the matched files, see batchChunks.