Documentation
¶
Overview ¶
Package enrich executes enrichment sources against the deployment's grain store in one of two modes: direct (auto-approve -- assertions land in the source's enrichment:<name> graph) or queue (candidates become PIPELINE-provenance suggestions for moderation). The mode is a per-source deployment decision; the enrichers themselves are mode-blind.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Source string `json:"source"`
Mode Mode `json:"mode"`
// Works is the number of Works enriched (direct) or with candidates
// queued (queue).
Works int `json:"works"`
// Scope names the run's filter ("" when the whole corpus).
Scope string `json:"scope,omitempty"`
// Stats carries the enricher's own run counters (batches, skips,
// resolved, elapsed) when the source reports them.
Stats *ingest.EnrichStats `json:"stats,omitempty"`
}
Result summarizes one run.
type Service ¶
type Service struct {
Blob blob.Store
GrainPrefix string
Queue *suggest.Service
Sources map[string]Source
// Summaries, when set, is the shared maintained summary source
// (workindex) queue-mode runs read instead of a per-run
// corpus walk; nil falls back to ScanSummaries.
Summaries ingest.SummarySource
}
Service runs configured sources.
func (*Service) Run ¶
func (s *Service) Run(ctx context.Context, name string, keep func(*ingest.WorkSummary) bool) (Result, error)
Run executes one configured source by name. A non-nil keep scopes the run to the summaries it accepts: only those works are handed to the enricher (an external-service source queries for exactly the scoped set) and only their grains gain statements; out-of-scope works keep what they have.