Documentation
¶
Overview ¶
Package ingest drives a source: discovery, change detection by object version, detail reads of what moved, and saves through the source's store.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Job ¶
type Job struct {
Every time.Duration
// Prepare builds one run's registration; a non-empty skip, such as a
// low budget, runs nothing and is the job's skipped text.
Prepare func(ctx context.Context, now time.Time) (p Plan, skip string, err error)
}
Job is a source's ingestion job: the daemon runs it every Every with RunJob.
type Plan ¶
type Plan struct {
Registration
// After runs once Run returns, with its report and error, and gives the
// job's outcome; nil summarizes the report and returns Run's error.
After func(ctx context.Context, rep Report, err error) (summary, skipped string, _ error)
}
Plan is one run of a Job.
type Registration ¶
type Registration struct {
Source port.Source
Store port.SourceStore
Codec unit.Codec
// Units holds every registered codec, disabled plugins' included; a link's To is checked against it.
Units *unit.Registry
// Links stores the links the read facts name; nil drops them.
Links port.LinkStore
}
Registration is one source with its store and its unit codec.
type Report ¶
type Report struct {
Provider unit.ProviderID
Discovered, Moved int
Read []unit.Unit // units of the read facts, distinct, sorted by Unit.Less
Cursor string // the cursor saved by this pass
// Links are the links saved by this pass; LinksDropped those whose To did not parse.
Links, LinksDropped int
}
Report is what one pass did.
func Run ¶
Run is one two-phase pass: Discover from the stored cursor, Stubs of Watched (minus discovered), compare each object's Version with Versions, Read what moved or is unknown, Save (light facts of every stub, read facts, cursor), See every object returned. It spends no budget itself: the source's client does. Passes of one provider never interleave.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ingesttest is a fake "thread" provider for driving ingest: a conversation service, a budgeted client, its Source and its SourceStore.
|
Package ingesttest is a fake "thread" provider for driving ingest: a conversation service, a budgeted client, its Source and its SourceStore. |