Documentation
¶
Overview ¶
Package store holds ingestion's SQLite store: every item, its sightings, its bytes' records, each stage's outputs and decisions, its deliveries, the task leases and the connector cursors.
The store is one writer connection beside a pool of readers. Each stage's tables come from an embedded schema file of its own in this directory, converged on every open. A stage adds a table in its file and declares it in Tables, and Open refuses a table that is in neither Tables nor unlogged. Every write runs through Update, which stamps it later than every write before it, so the outbox reads each table in commit order by stamp. Update also settles the phase of each item the write touched, on the item's row, so the outbox ships the phase that ItemRecords.Phase decides.
Index ¶
- Constants
- Variables
- func DeliverCapability(deliverer string) string
- func JoinUnits(units []Unit) (text string, starts []int)
- func ModelStages() []string
- func NewFlowID() string
- func NoteAnswered(answered, note *string) bool
- func NoteDigest(note *string) *string
- func Precedes(step, later string) bool
- func PreferParse(extractor string)
- func ReadingParseScanned(outputs []Output) bool
- func ScanRules(producerVersion string) string
- func ScanVersion(rules, extractor, extractorVersion string) string
- func Stamp(t time.Time) string
- type Blob
- type ChapterInBook
- type Claim
- type Condition
- type ConnectorCounts
- type Cursor
- type Decision
- type Declarations
- type Delivery
- type DeliveryAttempt
- type Finding
- type Home
- type Item
- type ItemPage
- type ItemRecords
- func (r ItemRecords) Conditions() []Condition
- func (r ItemRecords) NewestDecision(gate string) (Decision, bool)
- func (r ItemRecords) NoUsableParse() bool
- func (r ItemRecords) PersonPlaced() bool
- func (r ItemRecords) Phase() string
- func (r ItemRecords) ReviewPlacement() (Decision, bool)
- func (r ItemRecords) Side() (string, bool)
- func (r ItemRecords) UnitCount(o Output) (int, bool)
- func (r ItemRecords) WaitingAt() string
- func (r ItemRecords) WaitsOnPerson() (reason, since string, ok bool)
- type KeyedRequest
- type Leased
- type Option
- type OutboxMark
- type Outcome
- type Output
- type Parse
- type ParsePick
- type ParseUnit
- type Replay
- type ReplayQueue
- type Row
- type Section
- type Sighting
- type Span
- type Store
- func (s *Store) AppliedDeclarations(ctx context.Context) (Declarations, bool, error)
- func (s *Store) Blob(ctx context.Context, sum string) (Blob, error)
- func (s *Store) Blobs(ctx context.Context) ([]Blob, error)
- func (s *Store) Claim(ctx context.Context, c Claim) ([]Leased, error)
- func (s *Store) Close() error
- func (s *Store) ConnectorCounts(ctx context.Context) (map[string]ConnectorCounts, error)
- func (s *Store) Cursor(ctx context.Context, connector string) (Cursor, bool, error)
- func (s *Store) Deliveries(ctx context.Context, key string) ([]Delivery, error)
- func (s *Store) Heartbeat(ctx context.Context, id string, token int64, lease time.Duration) (Task, error)
- func (s *Store) Item(ctx context.Context, key string) (ItemRecords, error)
- func (s *Store) ItemRow(ctx context.Context, key string) (Item, bool, error)
- func (s *Store) ItemZones(ctx context.Context, keys []string) (map[string]Zone, error)
- func (s *Store) Items(ctx context.Context, page ItemPage) ([]ItemRecords, string, error)
- func (s *Store) ItemsWithNoSourceTime(ctx context.Context, mediaTypes []string, after string, limit int) ([]Item, error)
- func (s *Store) KeepOutboxMark(ctx context.Context, m OutboxMark, version string) error
- func (s *Store) KeyedRequest(ctx context.Context, caller, key string) (KeyedRequest, bool, error)
- func (s *Store) Leased(ctx context.Context, id string, token int64) (Task, error)
- func (s *Store) LiveHomes(ctx context.Context, sum string) ([]Home, error)
- func (s *Store) LiveHomesAt(ctx context.Context, root, pathSHA256 string) ([]Home, error)
- func (s *Store) Now() time.Time
- func (s *Store) OutboxMarks(ctx context.Context) (map[string]OutboxMark, error)
- func (s *Store) Outputs(ctx context.Context, key string) ([]Output, error)
- func (s *Store) Parse(ctx context.Context, key string, pick ParsePick) (Parse, error)
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) Reader() *sql.DB
- func (s *Store) Replay(ctx context.Context, r Replay, queue ReplayQueue) (Replay, bool, error)
- func (s *Store) ReplayItems(ctx context.Context, r Replay, takes func(Item) bool) ([]Item, error)
- func (s *Store) Report(ctx context.Context, id string, token int64, outcome Outcome, ...) (Task, error)
- func (s *Store) RetryTask(ctx context.Context, id string) (Task, error)
- func (s *Store) ReviewPlacedItems(ctx context.Context) ([]ItemRecords, error)
- func (s *Store) ReviewQueue(ctx context.Context) ([]Waiting, error)
- func (s *Store) SettlePhases(ctx context.Context) (items, moved int, err error)
- func (s *Store) Sighted(ctx context.Context, key, connector string) (bool, error)
- func (s *Store) StageTokens(ctx context.Context, stage string, limit int) ([]Tokens, error)
- func (s *Store) Tasks(ctx context.Context, q TaskQuery) ([]Task, error)
- func (s *Store) Update(ctx context.Context, fn func(*Tx) error) error
- func (s *Store) Workers(ctx context.Context, since string) ([]Worker, int, error)
- type Table
- type Task
- type TaskQuery
- type Tokens
- type Tx
- func (t *Tx) AddDecision(ctx context.Context, d Decision) (Decision, error)
- func (t *Tx) AddKeyedRequest(ctx context.Context, r KeyedRequest) error
- func (t *Tx) AppliedDeclarations(ctx context.Context) (Declarations, bool, error)
- func (t *Tx) Blob(ctx context.Context, sum string) (Blob, bool, error)
- func (t *Tx) ChapterSection(ctx context.Context, key string) (Section, bool, error)
- func (t *Tx) Chapters(ctx context.Context, key string) ([]Item, error)
- func (t *Tx) Children(ctx context.Context, key string) ([]Item, error)
- func (t *Tx) Cursor(ctx context.Context, connector string) (Cursor, bool, error)
- func (t *Tx) Decisions(ctx context.Context, key string) ([]Decision, error)
- func (t *Tx) Deliveries(ctx context.Context, key string) ([]Delivery, error)
- func (t *Tx) Delivery(ctx context.Context, key, destination string) (Delivery, bool, error)
- func (t *Tx) Enqueue(ctx context.Context, task Task) (Task, error)
- func (t *Tx) HasTask(ctx context.Context, key, stage string) (bool, error)
- func (t *Tx) Item(ctx context.Context, key string) (Item, bool, error)
- func (t *Tx) KeyedRequest(ctx context.Context, caller, key string) (KeyedRequest, bool, error)
- func (t *Tx) LiveHomes(ctx context.Context, sum string) ([]Home, error)
- func (t *Tx) LiveHomesAt(ctx context.Context, root, pathSHA256 string) ([]Home, error)
- func (t *Tx) LiveHomesUnder(ctx context.Context, root string) ([]Home, error)
- func (t *Tx) NewestDecision(ctx context.Context, key, gate string) (Decision, bool, error)
- func (t *Tx) Now() time.Time
- func (t *Tx) OpenTask(ctx context.Context, key, stage string) (Task, bool, error)
- func (t *Tx) Outputs(ctx context.Context, key string) ([]Output, error)
- func (t *Tx) Parse(ctx context.Context, key string, pick ParsePick) (Parse, error)
- func (t *Tx) PollInFlight(ctx context.Context, connector string) (Task, bool, error)
- func (t *Tx) PutBlob(ctx context.Context, b Blob) error
- func (t *Tx) PutCursor(ctx context.Context, c Cursor) error
- func (t *Tx) PutDeclarations(ctx context.Context, d Declarations) error
- func (t *Tx) PutDelivery(ctx context.Context, d Delivery) error
- func (t *Tx) PutHome(ctx context.Context, h Home, gone bool) error
- func (t *Tx) PutItem(ctx context.Context, item Item) error
- func (t *Tx) PutOutput(ctx context.Context, o Output) error
- func (t *Tx) PutOutputWithUnits(ctx context.Context, o Output, units []Unit) error
- func (t *Tx) PutSections(ctx context.Context, sections []Section) (bool, error)
- func (t *Tx) PutSighting(ctx context.Context, s Sighting) error
- func (t *Tx) QueueDelivery(ctx context.Context, item Item, path *string, chapter *ChapterInBook, ...) (bool, error)
- func (t *Tx) RecordDelivery(ctx context.Context, task Task, a DeliveryAttempt) error
- func (t *Tx) Records(ctx context.Context, key string) (ItemRecords, error)
- func (t *Tx) ReleaseFirstFill(ctx context.Context, connector string) (int, error)
- func (t *Tx) Sections(ctx context.Context, key string) ([]Section, error)
- func (t *Tx) Sighting(ctx context.Context, key, connector string) (Sighting, bool, error)
- func (t *Tx) Sightings(ctx context.Context, key string) ([]Sighting, error)
- func (t *Tx) UndeliveredChapterKeys(ctx context.Context) ([]string, error)
- func (t *Tx) UnplacedScannedKeys(ctx context.Context) ([]string, error)
- func (t *Tx) UnsettledKeysReadAs(ctx context.Context, verdict string) ([]string, error)
- func (t *Tx) WithdrawDeliveries(ctx context.Context, key, keep string) error
- func (t *Tx) WithdrawQueued(ctx context.Context, key, stage, why string) error
- type Unit
- type Waiting
- type Worker
- type Writes
- type Zone
Constants ¶
const ( ConditionTrue = "True" ConditionFalse = "False" ConditionUnknown = "Unknown" )
Condition statuses, as Kubernetes writes them.
const ( StagePoll = "poll" StageLand = "land" StageParse = "parse" // StageStructure profiles a PDF's bytes: its outline, page labels, // creation date and fonts. StageStructure = "structure" // StageContents is a model's reading of the printed contents pages of a // PDF whose outline gives it no sections. StageContents = "contents" // StageSections is the write of an item's sections that serve makes from // its structure or its contents, which queues no task. StageSections = "sections" StageScan = "scan" StageQuality = "quality" StageModelRead = "model-read" StageDeliver = "deliver" )
Stages, in the order that an item passes them, after the poll that fetches it. A task or an output names one.
const ( GateQuality = "quality" GateSide = "side" GateRead = "read" )
Gates, each deciding by an appended decision.
const ( OutputWaiting = "waiting" OutputDone = "done" OutputFailed = "failed" )
Output states for a stage's output.
const ( DeliveryPending = "pending" DeliveryDelivered = "delivered" DeliveryDeliveredToExisting = "delivered-to-existing" DeliveryRefused = "refused" )
Delivery outcomes.
const ( FirstFillNone = "none" FirstFillHeld = "held" FirstFillReleased = "released" )
A connector's first fill: none until an item reaches a model stage, held once one has, and released once a person lets the rest through.
const ( ReasonNoParse = "no-parse" ReasonQualityReview = "quality-review" )
Why an item waits on a person where no side decision sent it to review, in the words of schemas/review-list.schema.json. Every other reason is the cause of the side decision that sent the item to review.
const ( // SectionsFromOutline are sections read from a PDF's own outline, or one // section over the whole of a short PDF that has none. SectionsFromOutline = "outline" // SectionsFromContents are sections read from a book's printed contents // pages. SectionsFromContents = "contents" )
Producers of an item's sections.
const ( SectionPart = "part" SectionChapter = "chapter" SectionSection = "section" SectionFrontMatter = "front-matter" SectionBackMatter = "back-matter" )
Kinds of section.
const ( TaskQueued = "queued" TaskLeased = "leased" TaskDone = "done" TaskFailed = "failed" )
Task states.
const ( // LapsedClaimsFail is the claim whose lapsed lease fails its task rather // than return it to the next claim. A run that ends its worker, such as an // extractor killed for its memory, never reports, and would otherwise take // down a worker every lease. LapsedClaimsFail = 3 // HeartbeatEvery is how often a worker's claims write its row, which is // how fresh a worker's last heartbeat reads. HeartbeatEvery = time.Minute )
const MediaTypeChapter = "application/x-book-chapter"
MediaTypeChapter is a book's chapter: a child item that holds no bytes of its own and takes its parent's side and read decisions.
const PlacedByPerson = "person"
PlacedByPerson is the placed_by of a replay that runs a stage only over the labeled items, each one that a person placed from review.
const StageQualityArm = "quality-arm"
StageQualityArm is the quality gate's prompt answered by a model that its task names, as a measurement against each label beside the gate's own answer. It sits on no item's line, so its tasks and outputs move no item's phase, decision or delivery.
const StampLayout = "2006-01-02T15:04:05.000Z"
StampLayout is how every table writes an instant: RFC 3339 in UTC at a fixed width, so the text sorts as it reads.
Variables ¶
var ( // ErrNoTask is a call naming a task the store does not hold. ErrNoTask = errors.New("no such task") // ErrStaleLease is a heartbeat or report under a token that does not hold // the task's lease: a later claim took the lapsed lease, or the task ended. ErrStaleLease = errors.New("the task's lease is not held under this token") )
var ErrBadCursor = errors.New("not a cursor this list wrote")
ErrBadCursor refuses a page cursor that Items did not write.
var ErrNoBlob = errors.New("no such blob")
ErrNoBlob is a read naming bytes with no blob row.
var ErrNoCursor = errors.New("no cursor for the connector")
ErrNoCursor names a connector with no cursor, because no applied set declared it.
var ErrNoItem = errors.New("no such item")
ErrNoItem is a write or read naming an item the store does not hold.
var ErrNoParse = errors.New("no done parse")
ErrNoParse is a read of an item that holds no done parse to match it.
var ErrNoSighting = errors.New("the connector sighted no item")
ErrNoSighting is a replay naming a connector that sighted no item.
var ErrReplayDiffers = errors.New("the replay's id names a replay of another stage or other items")
ErrReplayDiffers is a replay whose id names one already recorded with another stage, connector, key or placed_by.
var ErrTaskDone = errors.New("the task ended done")
ErrTaskDone is a retry of a task that ended done, which a replay runs again instead.
var ErrUnitsOutOfOrder = errors.New("a parse's units are numbered from 1 in their order")
ErrUnitsOutOfOrder is a parse whose units are not numbered 1, 2, 3 in order.
var ErrUnitsOutsideParse = errors.New("only a parse holds units")
ErrUnitsOutsideParse is a stage other than parse reporting units.
var Tables = []Table{ { Name: "items", Key: []string{"key"}, Stamp: []string{"updated_ts"}, Text: []string{"title", "url"}, Kept: []string{"created_ts", "flow_id", "parent_flow_id"}, Writes: Upserts, }, { Name: "sightings", Key: []string{"item_key", "connector"}, Stamp: []string{"last_seen_ts"}, JSON: []string{"tags", "fields"}, Text: []string{"external_key", "fields"}, Kept: []string{"first_seen_ts"}, Writes: Upserts, }, {Name: "blobs", Key: []string{"sha256"}, Stamp: []string{"created_ts"}, Writes: Appends}, { Name: "homes", Key: []string{"blob_sha256", "root", "path_sha256"}, Stamp: []string{"gone_ts", "found_ts"}, Text: []string{"path"}, Writes: Upserts, }, { Name: "outputs", Key: []string{"item_key", "stage", "producer", "producer_version"}, Stamp: []string{"updated_ts"}, JSON: []string{"tokens", "findings", "units", "spans", "answer"}, Text: []string{"text", "units", "spans", "answer", "error"}, Kept: []string{"created_ts"}, Writes: Upserts, }, { Name: "parse_units", Key: []string{"item_key", "extractor", "extractor_version", "n"}, Stamp: []string{"created_ts"}, Text: []string{"label", "text"}, Writes: Appends, }, { Name: "sections", Key: []string{"item_key", "producer", "producer_version", "n"}, Stamp: []string{"created_ts"}, Text: []string{"title"}, Writes: Appends, }, {Name: "replays", Key: []string{"id"}, Stamp: []string{"requested_ts"}, Writes: Appends}, {Name: "decisions", Key: []string{"item_key", "gate", "sequence"}, Stamp: []string{"decided_ts"}, Writes: Appends}, { Name: "deliveries", Key: []string{"item_key", "destination"}, Stamp: []string{"updated_ts"}, Text: []string{"last_error", "title", "url", "path"}, Writes: Upserts, }, { Name: "tasks", Key: []string{"id"}, Stamp: []string{"updated_ts"}, Text: []string{"error"}, Kept: []string{"created_ts"}, Writes: Upserts, }, { Name: "workers", Key: []string{"id"}, Stamp: []string{"heartbeat_ts"}, JSON: []string{"capabilities"}, Kept: []string{"started_ts"}, Writes: Upserts, }, { Name: "cursors", Key: []string{"connector"}, Stamp: []string{"updated_ts"}, Text: []string{"last_error"}, Kept: []string{"created_ts"}, Writes: Upserts, }, { Name: "declarations", Key: []string{"commit"}, Stamp: []string{"applied_ts"}, JSON: []string{"connectors", "routing_rules", "destinations"}, Writes: Upserts, }, { Name: "keyed_requests", Key: []string{"caller", "idempotency_key"}, Stamp: []string{"created_ts"}, JSON: []string{"answer"}, Writes: Appends, }, }
Tables is every table the outbox ships. A stage adding a table adds it here, beside its schema file.
Functions ¶
func DeliverCapability ¶
DeliverCapability is the capability of a deliver task that deliverer runs, so a worker claims only the tasks of the deliverers it holds.
func JoinUnits ¶
JoinUnits joins units' text in order by a blank line, and answers where each unit's text starts in the joined text.
func ModelStages ¶ added in v0.21.0
func ModelStages() []string
ModelStages are the stages that read an item with a model.
func NoteAnswered ¶
NoteAnswered says whether an output that answered the note under answered, a NoteDigest, answers note. An output answers a decision that carries no note whatever note it answered, so only a new note reads an item again.
func NoteDigest ¶
NoteDigest is the hex SHA-256 of a read decision's note, trimmed, and nil where the note is empty.
func PreferParse ¶ added in v0.22.0
func PreferParse(extractor string)
PreferParse registers extractor as preferred: an item's readers take its done parse over any other extractor's, whichever was written later. An extractor that reads a selected item better than its primary one registers so, from its package's init. Every reader of a parse, from the scan to the item's parse route, then reads the same one, and a newer parse by the primary extractor never takes its place.
func ReadingParseScanned ¶ added in v0.22.0
ReadingParseScanned says whether outputs, oldest first as Tx.Outputs reads them, hold a done scan of the item's reading parse: its newest done parse by a preferred extractor where it holds one, and its newest done parse otherwise. The side gate places an item only then, so no item is placed before the scan of the parse that its readers read.
func ScanVersion ¶
ScanVersion is the producer version of a scan by rules that read the parse extractor wrote at extractorVersion. The parse is part of it, so a scan of each parse keeps its own row beside the parse it read.
Types ¶
type Blob ¶
type Blob struct {
SHA256 string `json:"sha256"`
MD5 string `json:"md5"`
SizeBytes int64 `json:"size_bytes"`
MediaType string `json:"media_type"`
CreatedTS string `json:"created_ts"`
}
Blob is landed bytes, written once.
type ChapterInBook ¶ added in v0.23.0
type ChapterInBook struct {
BookDestinationID string `json:"book_destination_id"`
PDFPageStart int `json:"pdf_page_start"`
PDFPageEnd int `json:"pdf_page_end"`
PrintedPageStart *string `json:"printed_page_start"`
PrintedPageEnd *string `json:"printed_page_end"`
}
ChapterInBook is where a book's chapter sits in its destination: the destination's id for its book's record, from the book's settled delivery, and the chapter's pages in the book, from the newest sections that name it. A deliver task carries it whole, as its delivery first kept it.
type Claim ¶
type Claim struct {
Worker Worker
// Max bounds how many tasks the claim leases.
Max int
// MaxByCapability bounds how many tasks of each capability it names the
// claim leases, within Max. A capability that it does not name is bound
// by Max alone.
MaxByCapability map[string]int
Lease time.Duration
}
Claim is a worker asking for work.
type Condition ¶
type Condition struct {
// Type is a stage or a gate.
Type string `json:"type"`
Status string `json:"status"`
// Reason is a decision's verdict, an output's or a delivery's state.
Reason string `json:"reason"`
}
Condition is how far one stage or gate has gone with an item.
type ConnectorCounts ¶
type ConnectorCounts struct {
Items int
Waiting int
Review int
Failed int
// Held counts the items whose model stage the connector's own first fill
// holds.
Held int
}
ConnectorCounts counts the items each connector sighted: all of them, and those that wait at a model stage, wait on a person's placement, or failed.
type Cursor ¶
type Cursor struct {
Connector string `json:"connector"`
Position *string `json:"position"`
DueAt string `json:"due_at"`
// StaleAt is written by the connectors package, which holds the freshness.
StaleAt *string `json:"stale_at"`
LastRunTS *string `json:"last_run_ts"`
LastDeliveryTS *string `json:"last_delivery_ts"`
LastError *string `json:"last_error"`
LastErrorTS *string `json:"last_error_ts"`
Failures int `json:"failures"`
FirstFill string `json:"first_fill"`
FirstFillItemKey *string `json:"first_fill_item_key"`
CreatedTS string `json:"created_ts"`
UpdatedTS string `json:"updated_ts"`
}
Cursor is one connector's position and when it is next due.
type Decision ¶
type Decision struct {
ItemKey string `json:"item_key"`
Gate string `json:"gate"`
Sequence int `json:"sequence"`
Verdict string `json:"verdict"`
DecidedBy string `json:"decided_by"`
Confidence *float64 `json:"confidence"`
Cause string `json:"cause"`
Destination *string `json:"destination"`
Note *string `json:"note"`
// Lens is set on a read decision whose verdict is model.
Lens *string `json:"lens"`
ClientID *string `json:"client_id"`
DecidedTS string `json:"decided_ts"`
}
Decision is one gate's decision on one item. The newest at a gate decides.
func ReviewPlacement ¶
ReviewPlacement is the label among decisions, one item's at every gate: the newest side decision, where a person made it after the gates sent the item to review. The gates sent it there where an earlier side decision was a review, or where the quality gate's review came before the placement. A placement that no review came before labels nothing, as one made before the gates ran, or one carried over from a judgment made elsewhere.
type Declarations ¶
type Declarations struct {
Commit string `json:"commit"`
AppliedTS string `json:"applied_ts"`
AppliedBy string `json:"applied_by"`
Connectors []json.RawMessage `json:"connectors"`
RoutingRules []json.RawMessage `json:"routing_rules"`
Destinations []json.RawMessage `json:"destinations"`
}
Declarations is one applied set of connectors, routing rules and destinations, each declaration as its JSON.
type Delivery ¶
type Delivery struct {
ItemKey string `json:"item_key"`
Destination string `json:"destination"`
DestinationID *string `json:"destination_id"`
Outcome string `json:"outcome"`
Attempts int `json:"attempts"`
LastError *string `json:"last_error"`
// Title, URL and SourceTS are the item's when the delivery was first
// queued, which every attempt sends. So is Path, for a deliverer that
// writes an item by its file: its live home's path below the root that
// the deliverer's config names. It is nil for every other deliverer.
Title *string `json:"title"`
URL *string `json:"url"`
SourceTS *string `json:"source_ts"`
Path *string `json:"path"`
// BookDestinationID and the pages are a book's chapter's, kept the same
// way from its ChapterInBook, and nil for every other item.
BookDestinationID *string `json:"book_destination_id"`
PDFPageStart *int `json:"pdf_page_start"`
PDFPageEnd *int `json:"pdf_page_end"`
PrintedPageStart *string `json:"printed_page_start"`
PrintedPageEnd *string `json:"printed_page_end"`
UpdatedTS string `json:"updated_ts"`
}
Delivery is one item's delivery to one destination.
func (Delivery) Chapter ¶ added in v0.23.0
func (d Delivery) Chapter() *ChapterInBook
Chapter is where the delivery's chapter sits in its book's record, as the delivery first kept it, and nil where the delivery is no chapter's.
type DeliveryAttempt ¶
DeliveryAttempt is how one run of a deliver task ended: the outcome, the destination's own id for the record that holds the item, and the destination's answer where it is pending or refused.
type Finding ¶
type Finding struct {
Rule string `json:"rule"`
Severity string `json:"severity"`
Unit *int `json:"unit"`
Offset int `json:"offset"`
Length int `json:"length"`
}
Finding is one scanner rule's match, without its span: where it starts and how many bytes it covers. Unit names the parse's unit it starts in, and its offset counts from that unit's start. A finding from Scanner.Scan names no unit.
type Home ¶
type Home struct {
BlobSHA256 string `json:"blob_sha256"`
Root string `json:"root"`
PathSHA256 string `json:"path_sha256"`
Path string `json:"path"`
// ModifiedTS is the file's modification time, to the nanosecond, when its
// bytes were last hashed at Path. A file whose size or modification time
// differs is hashed again before it is read as the blob.
ModifiedTS *string `json:"modified_ts"`
FoundTS string `json:"found_ts"`
GoneTS *string `json:"gone_ts"`
}
Home names where a file already lives, under a named root.
type Item ¶
type Item struct {
Key string `json:"key"`
MediaType string `json:"media_type"`
Zone Zone `json:"zone"`
BlobSHA256 *string `json:"blob_sha256"`
ParentKey *string `json:"parent_key"`
FlowID string `json:"flow_id"`
ParentFlowID *string `json:"parent_flow_id"`
Title *string `json:"title"`
URL *string `json:"url"`
// SourceTS is when the artifact was made at its source, such as a Reddit
// post's creation, as a store stamp, and nil where the source gives none.
SourceTS *string `json:"source_ts"`
// Phase is what the write's settle decides before it commits, replacing
// any value that a put carried. A put of an item with no phase leaves the
// column as it was.
Phase *string `json:"phase,omitempty"`
CreatedTS string `json:"created_ts"`
UpdatedTS string `json:"updated_ts"`
}
Item is one artifact.
func (Item) PlacedThroughParent ¶ added in v0.20.0
PlacedThroughParent says whether the item takes every side and read decision from its parent, as a book's chapter does. A person places its parent instead, so neither the review queue nor a placement takes it.
type ItemPage ¶
ItemPage asks for up to Limit items, newest first, after the item that the cursor After names.
type ItemRecords ¶
type ItemRecords struct {
Item Item
// Blob is the row of the item's bytes, and nil where it holds none.
Blob *Blob
Homes []Home
Sightings []Sighting
Outputs []Output
Decisions []Decision
Deliveries []Delivery
Tasks []Task
// Sections are the item's sections, each producer version's in order.
Sections []Section
// contains filtered or unexported fields
}
ItemRecords is one item with every stage record written about it.
func (ItemRecords) Conditions ¶
func (r ItemRecords) Conditions() []Condition
Conditions derives each stage's and gate's condition from which records exist, as Kubernetes derives a pod's status from its conditions. A stage with no record is left out. So when a push sends an item past the gates, it shows no gate at all rather than one that failed.
func (ItemRecords) NewestDecision ¶
func (r ItemRecords) NewestDecision(gate string) (Decision, bool)
NewestDecision is the item's newest decision at gate, and false where none is.
func (ItemRecords) NoUsableParse ¶
func (r ItemRecords) NoUsableParse() bool
NoUsableParse says whether the item's parse failed and no parse is done, so it waits in review rather than passing a gate on empty text.
func (ItemRecords) PersonPlaced ¶
func (r ItemRecords) PersonPlaced() bool
PersonPlaced says whether a person made the item's newest side decision.
func (ItemRecords) Phase ¶
func (r ItemRecords) Phase() string
Phase is the item's phase in the words of schemas/items-list.schema.json: dropped where the newest side decision drops it, review where WaitsOnPerson says it waits, failed where another stage on the line holds a newest task that failed, dropped where the quality gate drops it before any side decision, waiting where a model stage holds it, and otherwise the furthest stage whose condition is True. A person can place an item whose parse or quality gate failed, which moves it on from that stage. A failed stage of besideScan fails no phase.
func (ItemRecords) ReviewPlacement ¶
func (r ItemRecords) ReviewPlacement() (Decision, bool)
ReviewPlacement is the item's label, as ReviewPlacement decides it from the item's decisions.
func (ItemRecords) Side ¶
func (r ItemRecords) Side() (string, bool)
Side is the newest side decision's verdict where it placed the item on a side, and false where none has.
func (ItemRecords) UnitCount ¶
func (r ItemRecords) UnitCount(o Output) (int, bool)
UnitCount counts the units of the parse o, and is false where o is no parse.
func (ItemRecords) WaitingAt ¶
func (r ItemRecords) WaitingAt() string
WaitingAt is the model stage that holds the item, and "" where none does.
func (ItemRecords) WaitsOnPerson ¶
func (r ItemRecords) WaitsOnPerson() (reason, since string, ok bool)
WaitsOnPerson says why the item waits on a person's placement, and since when. It is the one answer that Phase, the review queue and each connector's count read. A chapter whose book waits in review waits too, on the book's placement. An item waits where its newest side decision sent it to review, under that decision's cause. Where no side decision holds it, the item waits as no-parse where no parse is usable, and as quality-review where the quality gate's newest decision sent it there. It is false where the item waits on nobody.
type KeyedRequest ¶
type KeyedRequest struct {
Caller string `json:"caller"`
IdempotencyKey string `json:"idempotency_key"`
Route string `json:"route"`
Connector *string `json:"connector"`
Fingerprint string `json:"fingerprint"`
Status int `json:"status"`
Answer json.RawMessage `json:"answer"`
CreatedTS string `json:"created_ts"`
}
KeyedRequest is one request a caller sent under an Idempotency-Key, and what it answered.
type Leased ¶
Leased is a leased task with its item's row, so a worker runs the task holding no scope to read items. A poll task has no item, so its Item is empty. A deliver task carries its delivery's row too, whose title, URL and source time every attempt sends. A model stage's task carries the item's outputs at its stage, so a task whose run is already dispatched reads that run rather than starting another. A model read's task carries the item's newest read decision, whose lens and note the read answers.
type OutboxMark ¶
type OutboxMark struct {
Table string
ThroughStamp string
ThroughRowID int64
// Shipped counts the records every accepted batch carried, resends
// included.
Shipped int64
}
OutboxMark is how far the outbox has shipped one table.
type Outcome ¶
type Outcome struct {
// State is TaskDone, TaskFailed, or TaskQueued to try again after
// RetryAfter.
State string
Error *string
RetryAfter time.Duration
}
Outcome is how a worker's task ended.
type Output ¶
type Output struct {
ItemKey string `json:"item_key"`
Stage string `json:"stage"`
Producer string `json:"producer"`
ProducerVersion string `json:"producer_version"`
Lens *string `json:"lens"`
LensVersion *string `json:"lens_version"`
// NoteDigest is NoteDigest of the note that a model read answered.
NoteDigest *string `json:"note_digest"`
// InputProducer and InputVersion name the parse a later stage read, such
// as the parse a scan's findings index the units of.
InputProducer *string `json:"input_producer"`
InputVersion *string `json:"input_version"`
State string `json:"state"`
BlobSHA256 *string `json:"blob_sha256"`
DispatchID *string `json:"dispatch_id"`
RunID *string `json:"run_id"`
// Model and Effort are what a model stage asked its run for, and
// AnsweredModel the model that its run reports answering on.
Model *string `json:"model"`
Effort *string `json:"effort"`
AnsweredModel *string `json:"answered_model"`
Tokens *Tokens `json:"tokens"`
Findings []Finding `json:"findings"`
// RulesVersion is the scanner rules' version that made Findings.
RulesVersion *string `json:"rules_version"`
Quality *int `json:"quality"`
SideGuess *string `json:"side_guess"`
SideConfidence *float64 `json:"side_confidence"`
Spans []Span `json:"spans"`
Answer json.RawMessage `json:"answer"`
Error *string `json:"error"`
CreatedTS string `json:"created_ts"`
UpdatedTS string `json:"updated_ts"`
}
Output is one stage's output for one item from one producer at one version.
func NewestDone ¶
NewestDone is the newest done output of stage among outputs, and nil where none is. A model stage's newest done output is its answer.
type Parse ¶
type Parse struct {
Item Item
Output Output
Units []Unit
// Scan is the newest done scan that read this parse, and nil where none did.
Scan *Output
}
Parse is one item's done parse with its units, and the newest done scan of it.
type ParsePick ¶
ParsePick picks one of an item's done parses: the newest, of Extractor and at Version where each is set.
type ParseUnit ¶
type ParseUnit struct {
ItemKey string `json:"item_key"`
Extractor string `json:"extractor"`
ExtractorVersion string `json:"extractor_version"`
N int `json:"n"`
Label *string `json:"label"`
Text string `json:"text"`
CreatedTS string `json:"created_ts"`
}
ParseUnit is one unit as parse_units holds it.
type Replay ¶
type Replay struct {
// ID derives from the caller and its Idempotency-Key.
ID string `json:"id"`
Stage string `json:"stage"`
Connector *string `json:"connector"`
ItemKey *string `json:"item_key"`
// PlacedBy is PlacedByPerson where the replay ran only over the labeled
// items, and nil where it ran over every item it selected.
PlacedBy *string `json:"placed_by"`
// Model is the model that a measurement arm's replay asked each task's
// run for, and nil for every other replay.
Model *string `json:"model"`
// Items counts the tasks queued, one per item.
Items int `json:"items"`
RequestedBy string `json:"requested_by"`
RequestedTS string `json:"requested_ts"`
}
Replay is one replay that queued a stage again over the items its connector and key select.
type ReplayQueue ¶
ReplayQueue queues a stage's tasks for item, and answers whether it queued any.
type Row ¶
Row is one row as its table holds it: each column by name, a JSON column as json.RawMessage, and its rowid.
type Section ¶ added in v0.20.0
type Section struct {
ItemKey string `json:"item_key"`
Producer string `json:"producer"`
ProducerVersion string `json:"producer_version"`
N int `json:"n"`
// ParentN is the n of the entry that holds this one, and nil at the top.
ParentN *int `json:"parent_n"`
Level int `json:"level"`
Kind string `json:"kind"`
Title *string `json:"title"`
// PDFPageStart and PDFPageEnd are the section's first and last PDF pages,
// from 1. A positional parse holds PDF page n as unit n, so the range
// names the section's units.
PDFPageStart int `json:"pdf_page_start"`
PDFPageEnd int `json:"pdf_page_end"`
// PrintedPageStart and PrintedPageEnd are the pages as the book prints
// them, and nil where it gives no way to tell.
PrintedPageStart *string `json:"printed_page_start"`
PrintedPageEnd *string `json:"printed_page_end"`
// StartPlacedBy says how the start page was found, such as outline.
StartPlacedBy string `json:"start_placed_by"`
// ChildKey is the key of the item made for a chapter, and nil where none
// was.
ChildKey *string `json:"child_key"`
CreatedTS string `json:"created_ts"`
}
Section is one entry of an item's sections, as sections holds it.
type Sighting ¶
type Sighting struct {
ItemKey string `json:"item_key"`
Connector string `json:"connector"`
Tags []string `json:"tags"`
// Fields hold the source payload's values by name, such as a Reddit
// save's subreddit, for a routing rule to match.
Fields map[string]string `json:"fields"`
Zone Zone `json:"zone"`
CursorPosition *string `json:"cursor_position"`
ExternalKey string `json:"external_key"`
FirstSeenTS string `json:"first_seen_ts"`
LastSeenTS string `json:"last_seen_ts"`
}
Sighting is one connector's arrival of an item.
type Span ¶
Span is the text one finding matched. An output's spans hold one per finding, in the findings' order.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the open database.
func Open ¶
Open opens the database at path, creating it and its directory where they are missing, and converges every schema file and every logged table's guard.
func (*Store) AppliedDeclarations ¶
AppliedDeclarations reads the set in force, the one applied last, and false where no set has been applied.
func (*Store) Claim ¶
Claim records the worker's heartbeat and leases it up to c.Max tasks whose capability it holds, the oldest first: each queued task past its backoff that no first fill holds, and each leased task whose lease lapsed. It leases no more of a capability than c.MaxByCapability names. Every claim runs through the one writer, so two workers asking at once never lease one task twice.
func (*Store) ConnectorCounts ¶
ConnectorCounts reads every connector's counts, by its name. A connector that sighted nothing is absent.
func (*Store) Deliveries ¶ added in v0.23.0
Deliveries reads each of the item's deliveries, one per destination.
func (*Store) Heartbeat ¶
func (s *Store) Heartbeat(ctx context.Context, id string, token int64, lease time.Duration) (Task, error)
Heartbeat extends the lease on task id that token holds by lease from now, and records its worker's heartbeat.
func (*Store) ItemRow ¶
ItemRow reads the item row under key alone, and false where the store holds none.
func (*Store) ItemZones ¶
ItemZones reads each of keys' zone, by key, and leaves out each key with no item.
func (*Store) Items ¶
Items reads a page of items, newest first, each with its records, and the cursor of the next page, which is "" where none is left.
func (*Store) ItemsWithNoSourceTime ¶
func (s *Store) ItemsWithNoSourceTime(ctx context.Context, mediaTypes []string, after string, limit int) ([]Item, error)
ItemsWithNoSourceTime reads up to limit items that hold bytes and no source time, of one of mediaTypes, whose key sorts after after, in key order.
func (*Store) KeepOutboxMark ¶
KeepOutboxMark writes m, under the release that moved it.
func (*Store) KeyedRequest ¶
KeyedRequest reads the request caller sent under key, and false where the store holds none.
func (*Store) Leased ¶
Leased reads task id where token holds its lease, so a worker reads the input of a task it holds and of no other. It answers ErrNoTask where there is no such task, and ErrStaleLease where token does not hold its lease.
func (*Store) LiveHomesAt ¶
LiveHomesAt reads every home at root and pathSHA256 that is not gone, whatever blob it names.
func (*Store) OutboxMarks ¶
OutboxMarks reads every table's mark. A table missing from the answer has shipped nothing.
func (*Store) Parse ¶
Parse reads the done parse of the item under key that pick names, with its units. It answers ErrNoItem where the store holds no such item, and ErrNoParse where no done parse matches. It reads in one transaction, so the units are the ones written with the output.
func (*Store) Reader ¶
Reader is the pool of read-only connections, for a reader such as the outbox that walks a table past a mark.
func (*Store) Replay ¶
Replay runs queue over each item that r covers, then records r with the count of items queue queued for, in one write. A replay already recorded under r.ID answers as recorded and queues nothing, and one recorded with another stage, connector, key or placed_by answers ErrReplayDiffers. The bool says whether this call queued.
func (*Store) ReplayItems ¶
ReplayItems reads the items that r covers, oldest first: each item that r's connector sighted and r's key names, or every item where neither is set, that takes says the stage runs on. It answers ErrNoItem where r's key names no item, and ErrNoSighting where r's connector sighted none.
func (*Store) Report ¶
func (s *Store) Report(ctx context.Context, id string, token int64, outcome Outcome, write func(*Tx, Task) error) (Task, error)
Report ends the lease that token holds on task id, with outcome. write runs in the same transaction before the lease ends, so a stage's records, such as a model stage's dispatch id, are stored exactly when the task ends. The store refuses a token that does not hold the lease with ErrStaleLease, and write never runs. A report repeated under the token that ended the task answers the task as it ended, and write never runs again, so a worker whose answer was lost can send its report again.
func (*Store) RetryTask ¶
RetryTask queues the failed task id again, with its attempts and backoff cleared, and answers it. A task that is queued or leased is answered as it is, so a retry sent twice queues it once. It answers ErrNoTask where there is no such task, and ErrTaskDone where it ended done.
func (*Store) ReviewPlacedItems ¶
func (s *Store) ReviewPlacedItems(ctx context.Context) ([]ItemRecords, error)
ReviewPlacedItems reads every labeled item, each one that a person placed after the gates sent it to review, with its records, oldest first.
func (*Store) ReviewQueue ¶
ReviewQueue reads every item that waits on a person's placement, the longest waiting first.
func (*Store) SettlePhases ¶
SettlePhases settles every item's phase, a batch to a write, and answers how many items it read and how many it moved. A store that an earlier release wrote holds no phase, or one that an earlier Phase decided, and each item it moves ships again. Other writes run between its batches.
func (*Store) StageTokens ¶
StageTokens reads the tokens by kind of up to limit of stage's outputs that hold any, the newest first, which a model stage's replay estimates from.
type Table ¶
type Table struct {
Name string
// Key names a row within the table. Its columns joined with a slash are
// the record's ingestion.record.id, and an upsert conflicts on them.
Key []string
// Stamp is the columns whose first non-null value says when the row was
// last written. Each write sets it from the transaction's stamp.
Stamp []string
// JSON names the columns holding JSON text.
JSON []string
// Text names the outsider-written columns, which ship as ingestion.text
// and never as ingestion.record.
Text []string
// Kept names the columns written once, on insert, and never by an upsert.
Kept []string
Writes Writes
}
Table is one table the outbox ships each row of, as the store writes it.
func TableNamed ¶
TableNamed is the table called name, and false where none is.
type Task ¶
type Task struct {
ID string `json:"id"`
ItemKey *string `json:"item_key"`
Connector *string `json:"connector"`
// Destination names the destination that a deliver task writes its item
// to, and is nil for every other task.
Destination *string `json:"destination"`
// Model names the model that a measurement arm's task asks its run for,
// and is nil for every other task.
Model *string `json:"model"`
Stage string `json:"stage"`
Capability string `json:"capability"`
State string `json:"state"`
// HeldBy names the connector whose first fill holds this model stage's
// task. No claim takes it until a person releases the fill.
HeldBy *string `json:"held_by"`
// LeaseHolder is the worker that claimed the task last.
LeaseHolder *string `json:"lease_holder"`
// LeaseToken is the fencing token of the last claim. Each claim takes one
// higher, so a report under an older token is refused.
LeaseToken *int64 `json:"lease_token"`
LeaseExpiresTS *string `json:"lease_expires_ts"`
Attempts int `json:"attempts"`
NotBeforeTS *string `json:"not_before_ts"`
Error *string `json:"error"`
CreatedTS string `json:"created_ts"`
UpdatedTS string `json:"updated_ts"`
}
Task is one stage's work on one item, or one poll of a connector, which a worker holding its capability leases. A task names its item or its connector, never both.
type TaskQuery ¶
type TaskQuery struct {
// States keeps tasks in these states, and every state but done where empty.
States []string
Limit int
}
TaskQuery selects tasks to list.
type Tokens ¶
type Tokens struct {
UncachedInput int64 `json:"uncached_input"`
CacheWrite int64 `json:"cache_write"`
CacheRead int64 `json:"cache_read"`
Output int64 `json:"output"`
}
Tokens is a model run's tokens by kind.
func MedianTokens ¶
MedianTokens is each kind's median over runs, each kind taken apart.
type Tx ¶
type Tx struct {
// contains filtered or unexported fields
}
Tx is one writing transaction. Every row it writes carries its stamp.
func (*Tx) AddDecision ¶
AddDecision appends a gate's decision on an item, numbered after the item's last at that gate, and answers it as written.
func (*Tx) AddKeyedRequest ¶
func (t *Tx) AddKeyedRequest(ctx context.Context, r KeyedRequest) error
AddKeyedRequest records a request and its answer. A key the caller already sent is left as it is.
func (*Tx) AppliedDeclarations ¶
AppliedDeclarations reads the set in force as this write sees it, and false where no set has been applied.
func (*Tx) ChapterSection ¶ added in v0.23.0
ChapterSection reads the newest section that names the chapter item under key, and false where none does.
func (*Tx) Chapters ¶ added in v0.20.0
Chapters reads the chapter items made from the book under key.
func (*Tx) Cursor ¶
Cursor reads connector's cursor as this write sees it, and false where the store holds none.
func (*Tx) Deliveries ¶ added in v0.23.0
Deliveries reads each of the item's deliveries, one per destination.
func (*Tx) Delivery ¶
Delivery reads the item's delivery to destination, and false where the store holds none.
func (*Tx) Enqueue ¶
Enqueue adds a queued task for task's item or connector, stage and capability, and answers it as written. A model stage's task for an item that a connector's first fill holds is held by that connector.
func (*Tx) Item ¶
Item reads the item under key as this write sees it, and false where the store holds none.
func (*Tx) KeyedRequest ¶
KeyedRequest reads the request caller sent under key, and false where the store holds none.
func (*Tx) LiveHomes ¶ added in v0.19.0
LiveHomes reads every home of the blob sum that is not gone, oldest first.
func (*Tx) LiveHomesAt ¶
LiveHomesAt reads every home at root and pathSHA256 that is not gone, whatever blob it names.
func (*Tx) LiveHomesUnder ¶
LiveHomesUnder reads every home at root that is not gone, in path order.
func (*Tx) NewestDecision ¶
NewestDecision reads the newest decision at gate on the item under key, and false where none is.
func (*Tx) OpenTask ¶
OpenTask reads the item under key's task at stage that is queued or leased, and false where none is.
func (*Tx) Outputs ¶
Outputs reads every output of the item under key, oldest first, in the order that Store.Outputs reads them.
func (*Tx) Parse ¶ added in v0.20.0
Parse reads the done parse of the item under key that pick names, with its units, as this write sees it. It answers ErrNoItem and ErrNoParse as Store.Parse does.
func (*Tx) PollInFlight ¶
PollInFlight is connector's poll task that is queued or leased, and false where none is.
func (*Tx) PutDeclarations ¶
func (t *Tx) PutDeclarations(ctx context.Context, d Declarations) error
PutDeclarations records one applied set of declarations, stamped now. A commit applied again is stamped again, so it is the set in force.
func (*Tx) PutDelivery ¶
PutDelivery writes one item's delivery to one destination.
func (*Tx) PutHome ¶
PutHome records where a file lives. gone marks it gone from its root, and the item stays.
func (*Tx) PutItem ¶
PutItem writes item, keeping the created stamp and flow of a row already there. An item new to the store starts a fresh flow where it names none.
func (*Tx) PutOutputWithUnits ¶
PutOutputWithUnits writes o, a stage's output, and the units that only a parse holds. A done output is kept against a later one that is not done and answers the same note, so a rerun that fails leaves the done output readable and fails only its task. A model read of a new note replaces it, so its dispatch is stored. A done parse is kept against any later one, output and units alike. A changed extractor takes a new version, which writes beside the old.
func (*Tx) PutSections ¶ added in v0.20.0
PutSections writes one producer version's sections of an item, once. Where that version already wrote sections, they stay as they are, and PutSections answers false.
func (*Tx) PutSighting ¶
PutSighting writes one connector's arrival of an item, keeping when it was first seen.
func (*Tx) QueueDelivery ¶
func (t *Tx) QueueDelivery(ctx context.Context, item Item, path *string, chapter *ChapterInBook, destination, deliverer string) (bool, error)
QueueDelivery queues the task that writes item to destination through deliverer, and records the delivery pending where it is new, with the item's title, URL and source time, path and chapter as every attempt sends them. path is the item's file below the deliverer's root, and nil for a deliverer that writes no file. chapter is where a book's chapter sits in its book's record, and nil for every other item. It queues nothing where the delivery is settled, because a destination can forget a record it held, so a second write could save the item again. It queues nothing where a deliver task for the item and destination is queued or leased. It answers whether it queued.
func (*Tx) RecordDelivery ¶
RecordDelivery writes how the deliver task's run ended into its delivery, counting the attempt. A pending attempt keeps the id an earlier one found.
func (*Tx) Records ¶ added in v0.21.0
Records reads the records of the item under key as this write sees them, and ErrNoItem where the store holds none.
func (*Tx) ReleaseFirstFill ¶
ReleaseFirstFill marks connector's first fill released, and returns to the claims every task it held whose item no other connector's fill holds. A task whose item another held fill sighted moves to that fill. It answers how many queued tasks it returned. A held task that a person's placement already finished loses its hold too, and is not counted.
func (*Tx) Sections ¶ added in v0.20.0
Sections reads every section of the item under key, each version's in order.
func (*Tx) Sighting ¶
Sighting reads connector's sighting of the item under key, and false where the store holds none.
func (*Tx) UndeliveredChapterKeys ¶ added in v0.23.0
UndeliveredChapterKeys reads the key of each book's chapter that holds no delivery while its book holds one delivered or delivered to existing, each book's chapters in their order.
func (*Tx) UnplacedScannedKeys ¶
UnplacedScannedKeys reads the key of each item with a done scan whose newest side decision is a review or a drop, or that holds none. The side gate decides again only a review or a model's drop, so it narrows these to those, and to the items whose newest parse is the one scanned.
func (*Tx) UnsettledKeysReadAs ¶
UnsettledKeysReadAs reads the key of each item whose newest read decision has verdict and that holds no settled delivery: each item that a changed set may now send to a destination. A book's chapters follow each other in their order, so #2 comes before #10.
func (*Tx) WithdrawDeliveries ¶
WithdrawDeliveries ends each queued deliver task of the item under key whose destination is not keep, and says on its pending delivery why it stopped. keep is the destination that the item's decisions now send it to, and "" for none, as after a drop. A task already leased runs on, and its report records what the destination answered.
type Waiting ¶
type Waiting struct {
ItemRecords
// Reason is why it waits, in the words of schemas/review-list.schema.json.
Reason string
// Since is when it began to wait.
Since string
}
Waiting is one item that waits on a person's placement.
type Worker ¶
type Worker struct {
ID string `json:"id"`
Capabilities []string `json:"capabilities"`
Version string `json:"version"`
StartedTS string `json:"started_ts"`
HeartbeatTS string `json:"heartbeat_ts"`
}
Worker is one worker process, as its claims and heartbeats record it.
type Writes ¶
type Writes int
Writes is how the store writes a table, which decides how the outbox reads it past its mark and how a row's version counts.