package catalogue import "encoding/json" // CatalogSeat is the seat of the catalog: what the mesh holds of every module (novox/hq ADR 0604 ยง1). Its states are // its holder's: the modules the trunk holds, their manifests by digest and the module graph (the indexer's states // `modules`, `manifests` and `graph`), announced with who may read them; a reader that only watches reads them and calls // no verb. It names no event. What must be built again is no verb: a module whose fingerprint differs from its newest // build, which the delivery view derives. The verbs' answers are CatalogModules, CatalogOne, CatalogProvides and // CatalogDependents, whose field names are those of the catalog module's tools they replace. // CatalogEntry is one module of the catalog: its repository, its directory there ("." for the root), the merge commit it // was last changed at, and its new-form fingerprint or why it has none. type CatalogEntry struct { Module string `json:"module"` Repository string `json:"repository"` Path string `json:"path"` Commit string `json:"commit"` FP string `json:"fp,omitempty"` None string `json:"none,omitempty"` } // CatalogModule is one module whole: its entry and its manifest as the trunk holds it. type CatalogModule struct { CatalogEntry Manifest json.RawMessage `json:"manifest"` } // CatalogEnd is a module that provides, requires or depends on something, with its commit; Scope is a provider's scope // (a module provides its own name at node scope). type CatalogEnd struct { Module string `json:"module"` Commit string `json:"commit"` Scope string `json:"scope,omitempty"` } // CatalogModules is the answer of the verb modules: every module the trunk holds, sorted by name. type CatalogModules struct { Modules []CatalogEntry `json:"modules"` } // CatalogOne is the answer of the verb module. type CatalogOne struct { Module CatalogModule `json:"module"` } // CatalogProvides is the answer of the verb provides: the modules that provide the provision and those that require it. type CatalogProvides struct { Provision string `json:"provision"` Provides []CatalogEnd `json:"provides"` Requires []CatalogEnd `json:"requires"` } // CatalogDependents is the answer of the verb dependents: the modules whose build edges reach the module. type CatalogDependents struct { Module string `json:"module"` Dependents []CatalogEnd `json:"dependents"` }