// Code generated by seatgen from the seat definitions; DO NOT EDIT. // Package nodeengine is the contract of the seat "node-engine", defined whole (seats/node-engine/seat.json): The node seat every node's engine holds (novox/hq ADR 0563, ADR 0618 §3, §4): its hand acts on the operator's warrant, its read-only judgements, its compositions and what it reads of a manifest. Each verb is answered on this node's subject, mesh.seat.node-engine.tool.., and each event is published on mesh.seat.node-engine.event.., the node's name its last token, or, for an event whose subject names , there (composed., running..): the grants part grants a node's account only its own node's subjects (ADR 0363 §2). package nodeengine import ( "encoding/json" "strings" "time" ) // Seat is the seat's name. const Seat = "node-engine" // Form is the form of the seat's values, events and answers this contract was generated at (design 47 H2 §780): // a reader of a value of another form says "form N, this reader knows M". const Form = 4 // The forms and the digest of the fields this contract was generated from: the generator's compare fails a definition // whose fields changed while its forms did not (design 47 H2 §780). const ( generatedForms = "4" generatedFieldsDigest = "AccessActAnswer=aba938323932 AccountsHanded=01f7505e0e41 Act=e6b24e6abd5f ActSaid=2bbc5ba1bb68 Acts=0f9a96c475ff ActsAnswer=ba7fb8de22ff Adoption=12d04d378fef ApplyOrderAnswer=24e631ec9059 ApplyOrderAnswerOrderItem=6cbde55cd9a7 Asked=9dc3b3e17562 AskedEvent=0e155c7e6cc6 AttachedNetwork=eb233c4eb030 BoundsByWhatIDValue=8fc4fb4c306c CandidateAdded=8a47761c2b87 CandidateAnswer=c4f359547d7c CandidateBodies=3212f3397a2f CandidateDiffers=eb09cbc3ccbd CandidateRefusal=e909c9f6cd19 ComposeAnswer=dc1b3a485ad8 ComposeAnswerPass=82e6b2612862 ComposeCandidateAnswer=dfbbe49d1170 Composed=a0496a1b4293 ComposedByNodeModuleFingerprintValue=c5232f26d312 ComposedByNodeNodeValue=92ce08a2aa61 ComposedEvent=c9a05c369a2d CompositionAnswer=47116fe980f9 CompositionAnswerAttempt=38f25294eb7f CompositionAnswerDriftItem=09b7f8553918 CompositionAnswerHave=2b07bbb37a49 CompositionAnswerJudged=ad566939781a CompositionAnswerOwn=a8154421db58 CompositionAnswerRuns=3a70c8e06e7e CompositionAnswerWant=aefc6253201d CompositionAnswerWithheldItem=28eae88e46de CompositionAnswerWithheldPartsItem=79f37133d5be CompositionDiffAnswer=b922d22f9cee CompositionDiffEntry=ac7c1fd3ea62 CompositionDiffResource=e31a58d6b2b5 ConvergedAnswer=378c6aea0436 DataByNodeModuleValue=155c8dd0a6e5 DeclaredGroup=22c955571ed0 DeclaredIdentity=442e5ea22995 DeclaredLibrary=234c8b6973d8 DoneEvent=0e155c7e6cc6 EntryAgainAnswer=1f1a24957164 EntryAgainAnswerAsked=bec32f015550 FailedUnit=4b7afe8c0f84 FindingAction=2bab6a7c8d3f FindingEvidence=f65231e1f862 FindingSubject=11e82b0a77d6 FindingsByKeyValue=41e93a483c67 FirstViewAgainAnswer=22627a4a4678 FirstViewAgainAnswerAsked=0fa827c2bc13 FirstViewsAnswer=3a1fe57c7be6 FirstViewsAnswerEntriesItem=8b117619ca3f FirstViewsAnswerWantsItem=d8cb80636647 HandOverAnswer=aba938323932 HaveByNodeModuleValue=b499318c2374 HaveByNodeNodeValue=9296a55d7aa6 HealthByNodeValue=03bfa8c83d5b JudgeDirectoriesAnswer=f590024f1e91 LoginFallback=78e280ece645 ManifestReadsAnswer=44ff978272b4 ManifestReadsChanged=fac832ea55d0 ManifestReadsChangedEvent=88e4af52759d Module=e604719b1fb3 NetworkHealth=3af75f8af8d7 NetworkPart=502939443fb6 NodeAccount=1faabd57fa41 NodeDirectory=12b7f58b657c NodeOwn=4fecee42b3c0 NodeRecord=13f2a683c1bf PackagesAnswer=e4128836129d PackagesAnswerKey=60572f6eefc3 PackagesAnswerKeyPackagesItem=955a58e4952f PackagesByNodeValue=4cdc8f8bdc58 PackagesByNodeValuePackagesItem=955a58e4952f PeerSeen=43e6f359f1aa PlacedDataItem=82d650fb9d31 ProcessBuild=133a0f6e81cf ProcessBuilds=32cfa418abfd ProcessBuildsAnswer=4ac4ce32fbeb PullWait=99288cc066ec RefusedEvent=0e155c7e6cc6 Revision=165e37beccf5 RootAccountVerdict=7a8c0d2e5b9a RootFreeAnswer=c83678c70792 RootVerdict=0855e131d15c Running=8a19fd7f6446 RunningEvent=f3d8fedcfd51 Said=634cca3367f2 SealedBox=2c687c69b978 SeatList=248a1dc3029b SeatListAgainAnswer=8eb7fbcb7018 SeatListAnswer=8eb7fbcb7018 SeatListHeld=6b5c0f8ddcc2 SeatListStatus=bfbb572c49dd SetuidSearchAnswer=f590024f1e91 UnitsHealth=0d9cf7be9bc7 UserListWritten=caae94077890 Wait=fc85cf95ac27 WaitEndedEvent=2bf6d38041c0 WaitHeldEvent=2bf6d38041c0" ) const ( VerbHandOver = "hand-over" VerbAccessAct = "access-act" VerbJudgeDirectories = "judge-directories" VerbSetuidSearch = "setuid-search" VerbRootFree = "root-free" VerbActs = "acts" VerbPackages = "packages" VerbComposition = "composition" VerbCompositionDiff = "composition-diff" VerbCompose = "compose" VerbComposeCandidate = "compose-candidate" VerbManifestReads = "manifest-reads" VerbApplyOrder = "apply-order" VerbSeatList = "seat-list" VerbSeatListAgain = "seat-list-again" VerbFirstViews = "first-views" VerbFirstViewAgain = "first-view-again" VerbEntryAgain = "entry-again" VerbProcessBuilds = "process-builds" VerbConverged = "converged" ) const ( EventAsked = "asked" EventDone = "done" EventRefused = "refused" EventManifestReadsChanged = "manifest-reads-changed" EventComposed = "composed" EventRunning = "running" EventWaitHeld = "wait-held" EventWaitEnded = "wait-ended" ) // Verbs is every verb the seat serves, in its definition's order: a new copy each call. func Verbs() []string { return []string{VerbHandOver, VerbAccessAct, VerbJudgeDirectories, VerbSetuidSearch, VerbRootFree, VerbActs, VerbPackages, VerbComposition, VerbCompositionDiff, VerbCompose, VerbComposeCandidate, VerbManifestReads, VerbApplyOrder, VerbSeatList, VerbSeatListAgain, VerbFirstViews, VerbFirstViewAgain, VerbEntryAgain, VerbProcessBuilds, VerbConverged} } // VerbDescription is a verb's description as the seat's definition says it, "" for a verb the seat does not serve or // does not describe (design 47 H2 H-A-449). func VerbDescription(verb string) string { switch verb { case VerbHandOver: return "Hand a directory this machine uses as found to the mesh (novox/hq ADR 0563 §3, §5): the engine judges the path as it does every hand-over (absolute, as it states it, used as found, reached through no link) and refuses in words, or asks the operator on their channel at the level approve, binding the owner, group and mode it will set. Nothing changes on the call: only the operator's yes hands it over. One ask is open per path; acts shows where it stands." case VerbAccessAct: return "Ask the operator for the take act on a library whose root holds data outside its group (novox/hq ADR 0328 §7, ADR 0563 §3, §4), on the library's home engine: the access as declared and its root as last declared, judged and refused in words or asked at the level approve. Only the operator's yes sets the library's group, group write and setgid under its root. One ask is open per access." case VerbJudgeDirectories: return "Which of this machine's declared directories the engine would refuse to make or keep, one line each (novox/hq ADR 0563 §2). Read-only: changes no owner or mode." case VerbSetuidSearch: return "Throw away the engine's last search for setuid programs and start a full one (novox/hq ADR 0563 §2); until it completes root-free answers that the machine is not judged yet. Refused while one runs, and when one was started within the hour, naming when the next may start." case VerbRootFree: return "Whether this machine is root-free (novox/hq ADR 0259 §8, ADR 0563 §6): free only on the engine's own verdict, at most fifteen minutes old, that the account agents run as cannot become root without a person, and the login shell's execute not served here. Anything else is no pass, and says why. Answered by this machine's engine alone." case VerbActs: return "Every act this machine's engine was asked through this seat (novox/hq ADR 0563 §9): each hand-over, access act and setuid search, open, done or refused, with who asked, the ask and the operator's warrant. Read-only." case VerbPackages: return "The packages this machine's compositions declare, present or absent, each with the modules that declare it, as the engine keeps them in its key of `packages`; until the controller hands its lease away, beside the controller's mirror for this machine and their difference. With write, the key written again from what the engine composed." case VerbComposition: return "One module's composition on this machine beside what runs of it, read-only: the composition its want's build has in the bucket composed- (the latest revision, or the one whose digest is given, from the revisions the bucket keeps), the digest of each kept revision, what runs (applied, its have, or the kept declaration), its want and have (phase running, failed, held or waiting-yes, and the digest that waits for a yes), and the move's judgement with its words: why a record module waits for a yes. With diff, every resource added, removed or changed, a provider's received file naming the consumers that join or leave." case VerbCompositionDiff: return "One module's composed values read by resource (design 47 H2 §813 (3), H-A-349 DQ-12b): given a module and a revision or a digest of its composition, the entries that differ between the composition that runs and that one, per resource, environment entries by name, a secret's value masked. Read-only. Answered by this machine's engine alone." case VerbCompose: return "Compose this machine's modules now and say how it went, so a composition that failed, or a module held, recovers without a restart: what the pass refused or held, each with why, and when the engine composes again on its own after a seat that did not answer (a deadline, no responders: retried with a growing wait; a refusal never). With module, that module's apply is also tried again. Changes only what a pass the engine makes on its own would change." case VerbComposeCandidate: return "Compose a check's candidate on this machine in shadow, with its own sealed values and the indexer's manifest verdicts, and say per module placed here whether it composes (with its digest and whether the candidate changes it), is refused by the candidate or is held without it, each with why, and the verdict of the machine's own composition (novox/hq ADR 0593 §7). Read-only: applies nothing and writes nothing. Answered by this machine's engine alone, within the asker's bound." case VerbManifestReads: return "The reader capabilities this machine's engine states (manifest words, forms and seat names it reads, novox/hq ADR 0618 §3) and when it last stated them. An engine built before it said them states none, which a reader takes as the baseline. Read-only. Answered by this machine's engine alone." case VerbApplyOrder: return "The order this machine's engine will apply its changed wants in, with why: one row per unapplied changed want, the bus module and the backup holder first, then each pipeline's wants by rank, then the rest by name, its own want last, a reverted module first (design 47 H 771, H-A-46). Read-only. Answered by this machine's engine alone." case VerbSeatList: return "The seat list this engine holds and what it waits for (novox/hq ADR 0636 §7): each seat's source (trunk or bootstrap) and digest, the seats held from the bootstrap alone, the definitions refused, the last error and whether the seat mesh-catalog has answered. Read-only." case VerbSeatListAgain: return "Make this engine read the seat list from the seat mesh-catalog now (novox/hq ADR 0636 §7), the recovery of a list unread; it answers what it holds afterwards, and the error when the read failed. A read that changed nothing still ends the engine's wait." case VerbFirstViews: return "The node-engine's first views of the owners' states it follows (design 47 G 422, 204): per owner and state, the tool it asks, the revision its picture holds and why it is behind, when it asked and was answered, how many asks and whether its condition is raised; served by mesh-sdk's runtime as the view's read tool; its entries and its kept wants beside (design 47 G 698)." case VerbFirstViewAgain: return "Ask the node-engine's first view of an owner's state again now, by hand (design 47 G 422, 204): a hand act, its caller and why kept in the status first-views reads; served by mesh-sdk's runtime as the view's again tool." case VerbEntryAgain: return "Ask the indexer's entry of a build again now, by hand (design 47 G 683, 698): a hand act, its caller and why kept; the answer says what was asked and the verb that reads it." case VerbProcessBuilds: return "The build each process on this node was started with (design 47 *The revision view*): per service and container the fingerprint the node-engine handed it in MESH_FINGERPRINT, or why it is unknown, and when it started. Narrowed by module. Reads only." case VerbConverged: return "The node's convergence state, which the node-engine keeps (ADR 0168, ADR 0683; design 33 control-verbs §10): adopted or converged, since when it became so, for an adopted node the kind of the firewall found, and the node's links as the engine classifies them: the tunnel's interface and the outward links (design 47 H-A-325). Read-only: the holder of node-packet-filter asks it at its start and at every allow and disallow, and refuses when it does not answer." } return "" } // Events is every event published on the seat's subject: a new copy each call. func Events() []string { return []string{EventAsked, EventDone, EventRefused, EventManifestReadsChanged, EventComposed, EventRunning, EventWaitHeld, EventWaitEnded} } // Family is where the seat's events are kept: the shared events stream, filtered to the seat's subjects. const ( Family = "node-engine.events" FamilyMaxAgeDays = 7 ) // SubjectAsked is where asked is published for one caller. func SubjectAsked(caller string) string { return "mesh.seat.node-engine.event.asked." + caller } // SubjectDone is where done is published for one caller. func SubjectDone(caller string) string { return "mesh.seat.node-engine.event.done." + caller } // SubjectRefused is where refused is published for one caller. func SubjectRefused(caller string) string { return "mesh.seat.node-engine.event.refused." + caller } // SubjectManifestReadsChanged is where manifest-reads-changed is published for one caller. func SubjectManifestReadsChanged(caller string) string { return "mesh.seat.node-engine.event.manifest-reads-changed." + caller } // SubjectComposed is where composed is published, on mesh.seat.node-engine.event.composed.. func SubjectComposed(node string) string { return "mesh.seat.node-engine.event.composed." + node } // SubjectComposedAll hears every composed. const SubjectComposedAll = "mesh.seat.node-engine.event.composed.*" // StreamRunning is the stream running is kept in. const StreamRunning = "SEAT_node-engine_running" // SubjectRunning is where running is published, on mesh.seat.node-engine.event.running... func SubjectRunning(node, module string) string { return "mesh.seat.node-engine.event.running." + node + "." + module } // SubjectRunningAll hears every running. const SubjectRunningAll = "mesh.seat.node-engine.event.running.*.*" // StreamWaitHeld is the stream wait-held is kept in. const StreamWaitHeld = "SEAT_node-engine_wait-held" // SubjectWaitHeld is where wait-held is published, on mesh.seat.node-engine.event.wait-held... func SubjectWaitHeld(node, module string) string { return "mesh.seat.node-engine.event.wait-held." + node + "." + module } // SubjectWaitHeldAll hears every wait-held. const SubjectWaitHeldAll = "mesh.seat.node-engine.event.wait-held.*.*" // StreamWaitEnded is the stream wait-ended is kept in. const StreamWaitEnded = "SEAT_node-engine_wait-ended" // SubjectWaitEnded is where wait-ended is published, on mesh.seat.node-engine.event.wait-ended... func SubjectWaitEnded(node, module string) string { return "mesh.seat.node-engine.event.wait-ended." + node + "." + module } // SubjectWaitEndedAll hears every wait-ended. const SubjectWaitEndedAll = "mesh.seat.node-engine.event.wait-ended.*.*" const ( StateHave = "have" StateComposed = "composed" StateData = "data" StatePackages = "packages" StateHealth = "health" StateFindings = "findings" StateBounds = "bounds" ) // HaveByNodeModuleKey is the key of one value of the state have under the form ".". func HaveByNodeModuleKey(node, module string) string { return node + "." + module } // ParseHaveByNodeModuleKey reads the parts of a key of the form ".", in the order of the form; the last result is false for a key of another form. func ParseHaveByNodeModuleKey(key string) (string, string, bool) { rest := key v0, after0, found0 := strings.Cut(rest, ".") if !found0 || v0 == "" { return "", "", false } rest = after0 if rest == "" { return "", "", false } v2 := rest rest = "" if rest != "" { return "", "", false } return v0, v2, true } // DecodeHaveByNodeModuleValue reads one value of the state have under the form "." as another part wrote it: a field HaveByNodeModuleValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeHaveByNodeModuleValue(raw []byte) (HaveByNodeModuleValue, int, error) { var v HaveByNodeModuleValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // HaveByNodeNodeKey is the key of one value of the state have under the form ".node". func HaveByNodeNodeKey(node string) string { return node + ".node" } // ParseHaveByNodeNodeKey reads the parts of a key of the form ".node", in the order of the form; the last result is false for a key of another form. func ParseHaveByNodeNodeKey(key string) (string, bool) { rest := key v0, after0, found0 := strings.Cut(rest, ".node") if !found0 || v0 == "" { return "", false } rest = after0 if rest != "" { return "", false } return v0, true } // DecodeHaveByNodeNodeValue reads one value of the state have under the form ".node" as another part wrote it: a field HaveByNodeNodeValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeHaveByNodeNodeValue(raw []byte) (HaveByNodeNodeValue, int, error) { var v HaveByNodeNodeValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // ComposedByNodeModuleFingerprintKey is the key of one value of the state composed under the form "..". func ComposedByNodeModuleFingerprintKey(node, module, fingerprint string) string { return node + "." + module + "." + fingerprint } // ParseComposedByNodeModuleFingerprintKey reads the parts of a key of the form "..", in the order of the form; the last result is false for a key of another form. func ParseComposedByNodeModuleFingerprintKey(key string) (string, string, string, bool) { rest := key v0, after0, found0 := strings.Cut(rest, ".") if !found0 || v0 == "" { return "", "", "", false } rest = after0 v2, after2, found2 := strings.Cut(rest, ".") if !found2 || v2 == "" { return "", "", "", false } rest = after2 if rest == "" { return "", "", "", false } v4 := rest rest = "" if rest != "" { return "", "", "", false } return v0, v2, v4, true } // DecodeComposedByNodeModuleFingerprintValue reads one value of the state composed under the form ".." as another part wrote it: a field ComposedByNodeModuleFingerprintValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeComposedByNodeModuleFingerprintValue(raw []byte) (ComposedByNodeModuleFingerprintValue, int, error) { var v ComposedByNodeModuleFingerprintValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // ComposedByNodeNodeKey is the key of one value of the state composed under the form ".node". func ComposedByNodeNodeKey(node string) string { return node + ".node" } // ParseComposedByNodeNodeKey reads the parts of a key of the form ".node", in the order of the form; the last result is false for a key of another form. func ParseComposedByNodeNodeKey(key string) (string, bool) { rest := key v0, after0, found0 := strings.Cut(rest, ".node") if !found0 || v0 == "" { return "", false } rest = after0 if rest != "" { return "", false } return v0, true } // DecodeComposedByNodeNodeValue reads one value of the state composed under the form ".node" as another part wrote it: a field ComposedByNodeNodeValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeComposedByNodeNodeValue(raw []byte) (ComposedByNodeNodeValue, int, error) { var v ComposedByNodeNodeValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DataByNodeModuleKey is the key of one value of the state data under the form ".". func DataByNodeModuleKey(node, module string) string { return node + "." + module } // ParseDataByNodeModuleKey reads the parts of a key of the form ".", in the order of the form; the last result is false for a key of another form. func ParseDataByNodeModuleKey(key string) (string, string, bool) { rest := key v0, after0, found0 := strings.Cut(rest, ".") if !found0 || v0 == "" { return "", "", false } rest = after0 if rest == "" { return "", "", false } v2 := rest rest = "" if rest != "" { return "", "", false } return v0, v2, true } // DecodeDataByNodeModuleValue reads one value of the state data under the form "." as another part wrote it: a field DataByNodeModuleValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeDataByNodeModuleValue(raw []byte) (DataByNodeModuleValue, int, error) { var v DataByNodeModuleValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // PackagesByNodeKey is the key of one value of the state packages under the form "". func PackagesByNodeKey(node string) string { return node } // ParsePackagesByNodeKey reads the parts of a key of the form "", in the order of the form; the last result is false for a key of another form. func ParsePackagesByNodeKey(key string) (string, bool) { rest := key if rest == "" { return "", false } v0 := rest rest = "" if rest != "" { return "", false } return v0, true } // DecodePackagesByNodeValue reads one value of the state packages under the form "" as another part wrote it: a field PackagesByNodeValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodePackagesByNodeValue(raw []byte) (PackagesByNodeValue, int, error) { var v PackagesByNodeValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // HealthByNodeKey is the key of one value of the state health under the form "". func HealthByNodeKey(node string) string { return node } // ParseHealthByNodeKey reads the parts of a key of the form "", in the order of the form; the last result is false for a key of another form. func ParseHealthByNodeKey(key string) (string, bool) { rest := key if rest == "" { return "", false } v0 := rest rest = "" if rest != "" { return "", false } return v0, true } // DecodeHealthByNodeValue reads one value of the state health under the form "" as another part wrote it: a field HealthByNodeValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeHealthByNodeValue(raw []byte) (HealthByNodeValue, int, error) { var v HealthByNodeValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // FindingsByKeyKey is the key of one value of the state findings under the form "". func FindingsByKeyKey(key string) string { return key } // ParseFindingsByKeyKey reads the parts of a key of the form "", in the order of the form; the last result is false for a key of another form. func ParseFindingsByKeyKey(key string) (string, bool) { rest := key if rest == "" { return "", false } v0 := rest rest = "" if rest != "" { return "", false } return v0, true } // DecodeFindingsByKeyValue reads one value of the state findings under the form "" as another part wrote it: a field FindingsByKeyValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeFindingsByKeyValue(raw []byte) (FindingsByKeyValue, int, error) { var v FindingsByKeyValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // BoundsByWhatIDKey is the key of one value of the state bounds under the form ".". func BoundsByWhatIDKey(what, id string) string { return what + "." + id } // ParseBoundsByWhatIDKey reads the parts of a key of the form ".", in the order of the form; the last result is false for a key of another form. func ParseBoundsByWhatIDKey(key string) (string, string, bool) { rest := key v0, after0, found0 := strings.Cut(rest, ".") if !found0 || v0 == "" { return "", "", false } rest = after0 if rest == "" { return "", "", false } v2 := rest rest = "" if rest != "" { return "", "", false } return v0, v2, true } // DecodeBoundsByWhatIDValue reads one value of the state bounds under the form "." as another part wrote it: a field BoundsByWhatIDValue does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeBoundsByWhatIDValue(raw []byte) (BoundsByWhatIDValue, int, error) { var v BoundsByWhatIDValue if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // AccountsHanded is the hashes of the users of the list, sealed to the vault. type AccountsHanded struct { // when At time.Time `json:"at"` Box SealedBox `json:"box"` From string `json:"from"` // the fingerprint of the vault's key To string `json:"to"` Users int64 `json:"users"` } // Act is one act asked through the seat, as acts reads it (ADR 0563 §9). type Act struct { // the act: hand-over, access-act, judge-directories or setuid-search Act string `json:"act"` // the operator's ask of a hand-over or an access act Ask string `json:"ask,omitempty"` // when it was asked, RFC 3339 At string `json:"at"` // the engine asked it itself, on finding a library's root holding data outside its group (ADR 0563 §4) Auto bool `json:"auto,omitempty"` // who answered, as the operator's warrant names them By string `json:"by,omitempty"` // the caller as the runtime proved it Caller string `json:"caller"` // what the engine read on disk when it judged Disk string `json:"disk,omitempty"` // when it ended, RFC 3339 Ended string `json:"ended,omitempty"` // when the ask ends unanswered, RFC 3339 Expires string `json:"expires,omitempty"` // the act's id ID string `json:"id"` // the directory the act changes Path string `json:"path,omitempty"` // the warrant's proofs Proofs []string `json:"proofs,omitempty"` // what the engine said of it: its outcome or why it was refused Said string `json:"said,omitempty"` // the owner, group and mode it sets, in words Sets string `json:"sets,omitempty"` // where it stands State string `json:"state"` // the path of a hand-over, or the access of an access act Subject string `json:"subject,omitempty"` // the channel the warrant came on Via string `json:"via,omitempty"` // why it was asked, in words Why string `json:"why,omitempty"` } // The values of Act's state. const ( ActStateAsked = "asked" ActStateDone = "done" ActStateRefused = "refused" ActStateAnswered = "answered" ) // ActSaid is what the seat says of an act: the act, the path or access, the caller as the runtime proved it and the ask (ADR 0563 §1). type ActSaid struct { // the act Act string `json:"act"` // the operator's ask Ask string `json:"ask,omitempty"` // the caller as the runtime proved it Caller string `json:"caller"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the node whose engine says it Node string `json:"node"` // what the engine said of it Said string `json:"said,omitempty"` // where the act stands State string `json:"state"` // the path or the access Subject string `json:"subject,omitempty"` } // The values of ActSaid's state. const ( ActSaidStateAsked = "asked" ActSaidStateDone = "done" ActSaidStateRefused = "refused" ) // Acts is the acts kept. type Acts struct { // the acts, newest first Acts []Act `json:"acts"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the node Node string `json:"node"` } // Adoption is the node is adopted and which of its modules are taken. type Adoption struct { // the modules taken Taken []string `json:"taken"` // by module, the resources left untaken Untaken map[string][]string `json:"untaken,omitempty"` } // Asked is the answer of an act the operator is asked. type Asked struct { // the ask's id: acts shows where it stands Asked string `json:"asked"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the node Node string `json:"node"` // what happens next, in words Says string `json:"says"` } // AttachedNetwork is a network attached to a link. type AttachedNetwork struct { Link string `json:"link"` Network string `json:"network"` } // CandidateAdded is a module the candidate adds. type CandidateAdded struct { Composed string `json:"composed,omitempty"` Module string `json:"module"` Unissued []string `json:"unissued,omitempty"` } // CandidateAnswer is the node's answer to one placement candidate naming it. type CandidateAnswer struct { Added []CandidateAdded `json:"added,omitempty"` Differs []CandidateDiffers `json:"differs,omitempty"` Held []CandidateRefusal `json:"held,omitempty"` Note string `json:"note,omitempty"` Proposal string `json:"proposal"` Refusals []CandidateRefusal `json:"refusals,omitempty"` // why the node cannot compose with the candidate at all Refused string `json:"refused,omitempty"` // modules the candidate removes Removed []string `json:"removed,omitempty"` Returns string `json:"returns,omitempty"` Revision int64 `json:"revision"` // modules whose composition is the one running Same []string `json:"same,omitempty"` ValuesDiffer int64 `json:"values_differ,omitempty"` // same, differs or refused Verdict string `json:"verdict"` } // The values of CandidateAnswer's verdict. const ( CandidateAnswerVerdictSame = "same" CandidateAnswerVerdictDiffers = "differs" CandidateAnswerVerdictRefused = "refused" ) // CandidateBodies is the bodies of one resource that differ. type CandidateBodies struct { Composed string `json:"composed,omitempty"` ID string `json:"id"` Paths []string `json:"paths,omitempty"` Running string `json:"running,omitempty"` Why string `json:"why"` } // CandidateDiffers is a module whose composition with the candidate differs from the one running. type CandidateDiffers struct { Bodies []CandidateBodies `json:"bodies,omitempty"` Composed string `json:"composed,omitempty"` Module string `json:"module"` Resource string `json:"resource,omitempty"` Running string `json:"running,omitempty"` Why string `json:"why"` } // CandidateRefusal is a module refused or held with the candidate. type CandidateRefusal struct { Module string `json:"module"` Today string `json:"today,omitempty"` Why string `json:"why"` } // Composed is an entry composed on a node (design 47 *What each step says*). type Composed struct { // when, RFC 3339 At time.Time `json:"at"` // the digest of the composition (design 47 G 404) Digest string `json:"digest"` // the fingerprint of the want composed Fingerprint string `json:"fingerprint"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the module Module string `json:"module"` // the node Node string `json:"node"` // the layout's version V int64 `json:"v"` } // CompositionDiffEntry is one entry that differs between the running composition and the other. type CompositionDiffEntry struct { // the value is a secret, so neither value is given Masked bool `json:"masked,omitempty"` // the entry: an environment entry by its name, else the part of the resource that differs Name string `json:"name"` // its value in the other composition; absent where the other lacks it or the value is a secret Other string `json:"other,omitempty"` // its value in the running composition; absent where the running one lacks it or the value is a secret Running string `json:"running,omitempty"` } // CompositionDiffResource is one resource with the entries of it that differ. type CompositionDiffResource struct { // the entries of the resource that differ Entries []CompositionDiffEntry `json:"entries"` // the resource, as the composition names it Resource string `json:"resource"` } // DeclaredGroup is a group. type DeclaredGroup struct { Gid int64 `json:"gid"` Name string `json:"name"` } // DeclaredIdentity is the identity of a module assigned to the node. type DeclaredIdentity struct { Gid int64 `json:"gid"` Groups []int64 `json:"groups,omitempty"` Module string `json:"module"` Name string `json:"name"` Runner string `json:"runner,omitempty"` Uid int64 `json:"uid"` } // DeclaredLibrary is a library the node is reached by. type DeclaredLibrary struct { Gid int64 `json:"gid"` Group string `json:"group"` Home bool `json:"home"` Library string `json:"library"` Paths []string `json:"paths,omitempty"` Root string `json:"root"` Runner string `json:"runner,omitempty"` Taken bool `json:"taken,omitempty"` } // FailedUnit is a unit that failed. type FailedUnit struct { Load string `json:"load,omitempty"` Resource string `json:"resource,omitempty"` Result string `json:"result,omitempty"` Scope string `json:"scope"` // since when Since time.Time `json:"since"` Unit string `json:"unit"` } // FindingAction is one answer the operator may give from a notification. type FindingAction struct { Arguments map[string]string `json:"arguments,omitempty"` Label string `json:"label"` Level string `json:"level,omitempty"` Machine string `json:"machine,omitempty"` // the seat verb the operator channel calls Verb string `json:"verb"` } // The values of FindingAction's level. const ( FindingActionLevelAcknowledge = "acknowledge" FindingActionLevelApprove = "approve" ) // FindingEvidence is one observation, as it was said. type FindingEvidence struct { At time.Time `json:"at"` Said string `json:"said"` } // FindingSubject is what the condition is about. type FindingSubject struct { // the other machines it concerns Also []string `json:"also,omitempty"` // its id within the scope ID string `json:"id"` // the machine it concerns, when there is one Machine string `json:"machine,omitempty"` // machine, plan, call, build, merge, provider, seat, bus, core, probe, mesh, delivery or module Scope string `json:"scope"` } // LoginFallback is a login that fell back to another node. type LoginFallback struct { // when At time.Time `json:"at"` From string `json:"from"` Node string `json:"node"` Why string `json:"why"` } // ManifestReadWord is the word a node-engine states in manifest-reads when it reads a want by version and not by digests (design 47 H 772, H-A-45); the assigner holds a node whose engine does not state it. Other words in manifest-reads are free. type ManifestReadWord = string // The values of ManifestReadWord. const ( ManifestReadWordWantVersion = "want:version" ) // ManifestReadsChanged is what a node-engine says when what it reads changed or its node returned (ADR 0618 §4). type ManifestReadsChanged struct { // when it says it, RFC 3339 At string `json:"at"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // what its engine states it reads now ManifestReads []string `json:"manifest-reads,omitempty"` // the node Node string `json:"node"` // the layout's version V int64 `json:"v"` // started: the engine started or what it states changed; returned: its node returned after being away Why string `json:"why"` } // The values of ManifestReadsChanged's why. const ( ManifestReadsChangedWhyStarted = "started" ManifestReadsChangedWhyReturned = "returned" ) // Module is one module's composition with the candidate. type Module struct { // the candidate changes it from the one composed without it Changed bool `json:"changed,omitempty"` // the composition's digest when composed Digest string `json:"digest,omitempty"` // the fingerprint it was composed at Fp string `json:"fp,omitempty"` // the module, node for the node's own composition Module string `json:"module"` // composed (digest set), refused by the candidate, or held without it too (words set) State string `json:"state"` // why, for a refused or held one Words string `json:"words,omitempty"` } // The values of Module's state. const ( ModuleStateComposed = "composed" ModuleStateRefused = "refused" ModuleStateHeld = "held" ) // NetworkHealth is the node's network. type NetworkHealth struct { Parts []NetworkPart `json:"parts"` // since when Since time.Time `json:"since"` // running, degraded or unknown State string `json:"state"` } // NetworkPart is one part of the node's network. type NetworkPart struct { Owner string `json:"owner,omitempty"` Part string `json:"part"` Reason string `json:"reason,omitempty"` Said string `json:"said,omitempty"` // since when Since time.Time `json:"since"` State string `json:"state"` Streak int64 `json:"streak,omitempty"` Targets []string `json:"targets,omitempty"` Toward []string `json:"toward,omitempty"` Writer string `json:"writer,omitempty"` } // NodeAccount is an account the node needs to log in again. type NodeAccount struct { Account string `json:"account"` Module string `json:"module,omitempty"` Reason string `json:"reason"` Resource string `json:"resource,omitempty"` // since when Since time.Time `json:"since"` } // NodeDirectory is a directory found where the node expected none. type NodeDirectory struct { Module string `json:"module"` Path string `json:"path"` Reason string `json:"reason"` Resource string `json:"resource"` // since when Since time.Time `json:"since"` } // NodeOwn is what a node's own composition carries beside its resources. type NodeOwn struct { Adoption *Adoption `json:"adoption,omitempty"` Groups []DeclaredGroup `json:"groups,omitempty"` Identities []DeclaredIdentity `json:"identities,omitempty"` Libraries []DeclaredLibrary `json:"libraries,omitempty"` // the account the provisioner's client runs as on the node ProvisionerAccount string `json:"provisioner_account,omitempty"` } // NodeRecord is what the machine observes of itself, for every node and composing part to read. type NodeRecord struct { Authority string `json:"authority,omitempty"` Capabilities []string `json:"capabilities,omitempty"` Certificate string `json:"certificate,omitempty"` Contract int64 `json:"contract,omitempty"` // the declaration Version its engine reads (design 47 H2 §813 (12), H-A-416 (2), H-A-419): the composer writes this node's declaration at the lower of its own Version and this one, 1 when none is stated DeclarationReads int64 `json:"declaration-reads,omitempty"` ManifestReads []string `json:"manifest-reads,omitempty"` Networks []AttachedNetwork `json:"networks,omitempty"` NetworksSaid bool `json:"networks-said,omitempty"` Node string `json:"node"` OutwardLinks []string `json:"outward-links,omitempty"` // the capabilities this node's tool runner states of the calls it answers, as its announcement carries them (design 46 approval mark 6) RunnerCapabilities []string `json:"runner-capabilities,omitempty"` // the fingerprint of the tool runner that stated runner-capabilities, as its announcement carries it; empty when it stated none RunnerFingerprint string `json:"runner-fingerprint,omitempty"` SealingKey string `json:"sealing-key,omitempty"` ServingKey string `json:"serving-key,omitempty"` Trusts []string `json:"trusts,omitempty"` TunnelKey string `json:"tunnel-key,omitempty"` V int64 `json:"v"` } // PeerSeen is a tunnel peer and whether it is seen. type PeerSeen struct { Addresses []string `json:"addresses,omitempty"` Key string `json:"key"` Seen bool `json:"seen"` } // PlacedDataItem is one data item a module declares, as placed on a node. type PlacedDataItem struct { Class string `json:"class"` // the path whose snapshot keeps it, empty when it is not backed up CoveredBy string `json:"covered_by,omitempty"` Item string `json:"item"` // walk, dataset or shallow Measure string `json:"measure,omitempty"` Module string `json:"module"` // the item's place on the node Path string `json:"path"` // backup, redundancy, both or none Protection string `json:"protection,omitempty"` } // ProcessBuild is the build one process of a module was started with. type ProcessBuild struct { // the fingerprint handed to it in MESH_FINGERPRINT; empty when it was started without one Fingerprint string `json:"fingerprint,omitempty"` // service or container Kind string `json:"kind"` // the module Module string `json:"module"` // the service's unit or the container's name Process string `json:"process"` // when it was started, RFC 3339 Started *time.Time `json:"started,omitempty"` // why its build is unknown: started before the node-engine handed MESH_FINGERPRINT, or the value could not be read Unknown string `json:"unknown,omitempty"` } // The values of ProcessBuild's kind. const ( ProcessBuildKindService = "service" ProcessBuildKindContainer = "container" ) // ProcessBuilds is what process-builds answers. type ProcessBuilds struct { // why they could not be read Error string `json:"error,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the node Node string `json:"node"` // every process the node-engine started, by module Processes []ProcessBuild `json:"processes"` } // PullWait is the pull from a store a failed apply waits on. type PullWait struct { // when the pull began Began time.Time `json:"began"` // that seat's holder, whose settling the apply waits for Holder string `json:"holder"` Image string `json:"image"` // what triggered the last try again, in words Retried string `json:"retried,omitempty"` // when the apply was last tried again RetriedAt *time.Time `json:"retried-at,omitempty"` // the seat the pull came through Seat string `json:"seat,omitempty"` } // Revision is one revision of a composition key. type Revision struct { // its digest Digest string `json:"digest,omitempty"` // the composition's key Key string `json:"key"` // the latest revision Latest bool `json:"latest,omitempty"` // why it cannot be read or trusted Refused string `json:"refused,omitempty"` // how many resources it names Resources int64 `json:"resources,omitempty"` // its revision Revision int64 `json:"revision,omitempty"` } // RootAccountVerdict is the engine's verdict of whether an account's resource is root-free, as the node's health lists it. type RootAccountVerdict struct { Account string `json:"account"` Module string `json:"module"` Reason string `json:"reason,omitempty"` Resource string `json:"resource"` // since when Since time.Time `json:"since"` State string `json:"state"` } // RootVerdict is the engine's root-free verdict (ADR 0563 §6). type RootVerdict struct { // the machine is root-free Free bool `json:"free"` // when the engine judged it, RFC 3339 Judged string `json:"judged"` // the machine Machine string `json:"machine"` // why, in words Why string `json:"why"` } // Running is a module's build running on a node, and its health: what the node-engines of other nodes and the grants part decide a seat's pass from (ADR 0660 §2), and the assigner reads a provider's and a canary's health and a put's end from (design 47 G 520); said again on the same subject each time healthy changes and for every module the have holds at the engine's start, kept last per subject with no age limit. type Running struct { // when it was said, RFC 3339 At time.Time `json:"at"` // the fingerprint of the build it runs; none with stopped Fingerprint string `json:"fingerprint,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the health of the build that runs, as the node-engine's have holds it from the module's declared check (ADR 0240); a running with none, said by a node-engine of before design 47 G, reads as healthy (design 47 G 520). SeatsToPassOn reads none of it: an unhealthy holder still holds its seat Healthy *bool `json:"healthy,omitempty"` // the digest of that build's manifest, the indexer's manifest of it, read by digest from the catalog half Manifest string `json:"manifest,omitempty"` // the module Module string `json:"module"` // the node Node string `json:"node"` // true when the have no longer holds the module on the node, never for an unhealthy build: no fingerprint or manifest then (design 47 G 365, 404, 520); mesh-sdk's SeatsToPassOn counts such a module as not running there Stopped bool `json:"stopped,omitempty"` // the layout's version V int64 `json:"v"` } // Said is the answer of a read-only judgement. type Said struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the node Node string `json:"node"` // the engine's judgement or search, one line per directory or program Said string `json:"said"` } // SealedBox is a value sealed to a key. type SealedBox struct { Ct string `json:"ct"` Eph string `json:"eph"` Iv string `json:"iv"` Tag string `json:"tag"` V int64 `json:"v"` } // SeatListStatus is a type of the contract. type SeatListStatus struct { // the seat mesh-catalog has answered Heard bool `json:"heard"` Held []SeatListHeld `json:"held"` LastError string `json:"last-error,omitempty"` // a trunk definition that does not parse, by seat: the one held stands Refused map[string]string `json:"refused,omitempty"` Revision int64 `json:"revision,omitempty"` // the seats held from the bootstrap alone Waiting []string `json:"waiting,omitempty"` } // SeatList is what an engine holds of the seat list (novox/hq ADR 0636 §7). type SeatList struct { // why the read failed, for seat-list-again Error string `json:"error,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the one line the engine says of it; empty when nothing waits Health string `json:"health"` Status SeatListStatus `json:"status"` } // SeatListHeld is a type of the contract. type SeatListHeld struct { // the digest of the definition held; empty for a bootstrapped one Digest string `json:"digest,omitempty"` Seat string `json:"seat"` Source string `json:"source"` } // The values of SeatListHeld's source. const ( SeatListHeldSourceTrunk = "trunk" SeatListHeldSourceBootstrap = "bootstrap" ) // UnitsHealth is the node's units. type UnitsHealth struct { Away []string `json:"away,omitempty"` Failed []FailedUnit `json:"failed"` State string `json:"state"` Unread []string `json:"unread,omitempty"` } // UserListWritten is the bus's user list as the engine of the bus node wrote it to the bus module's file. type UserListWritten struct { // when At time.Time `json:"at"` // the digest of the file on the machine after the write Digest string `json:"digest,omitempty"` // why a write failed Error string `json:"error,omitempty"` // which list the node follows now Follows string `json:"follows,omitempty"` Handed *AccountsHanded `json:"handed,omitempty"` // the bus node's sealing key, its public half Key string `json:"key,omitempty"` Revision int64 `json:"revision"` // the key the list was taken from Source string `json:"source"` // why the bus node does not watch the grants part's key now Unwatched string `json:"unwatched,omitempty"` Users int64 `json:"users"` // the digest of the list the source holds, sha256: Wanted string `json:"wanted"` } // Wait is a hold or wait a node-engine says, the fields of the seat mesh-wants' wait (design 47 G 498, 512, 629); in the have it also carries ask-at and act (design 47 G 560). type Wait struct { // in the have: the act the recovery module answered accepted with (design 47 G 560) Act string `json:"act,omitempty"` // in the have: the time of the first ask of the recovery module for this wait (design 47 G 560) AskAt *time.Time `json:"ask-at,omitempty"` // a duration such as 30m Bound string `json:"bound,omitempty"` // the time the bound counts from (design 47 G 266, 269, 498) ClockFrom *time.Time `json:"clock-from,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the node waited on: the build node for a kept build; the subject's is the node that says it Node string `json:"node,omitempty"` // what it waits on On string `json:"on,omitempty"` // the seat holding the wait: node-engine Owner string `json:"owner,omitempty"` // why it holds, such as restore point missing, entry-missing, parts-differ, node away or build no longer kept (design 47 G 541, 499) Reason string `json:"reason,omitempty"` Since time.Time `json:"since"` // compose: a hold of the composition (a restore point missing, an entry missing, parts that differ, a recovery that waits); kept-build: waiting for a kept build (design 47 G 499, 541); placing: a want of a higher rank held behind a lower one (design 47 H 771, H-A-67) Step string `json:"step"` // the wait said in words Words string `json:"words,omitempty"` } // The values of Wait's step. const ( WaitStepCompose = "compose" WaitStepKeptBuild = "kept-build" WaitStepPlacing = "placing" ) // HandOverInput is what hand-over takes. type HandOverInput struct { // the directory's absolute path, as the engine states it Path string `json:"path"` // why it is asked, in words the operator reads Why string `json:"why,omitempty"` } // HandOverAnswer is what hand-over answers. type HandOverAnswer = Asked // AccessActInput is what access-act takes. type AccessActInput struct { // the access, library: Access string `json:"access"` // the act: take Act string `json:"act"` // why it is asked, in words the operator reads Why string `json:"why,omitempty"` } // AccessActAnswer is what access-act answers. type AccessActAnswer = Asked // JudgeDirectoriesInput is what judge-directories takes. type JudgeDirectoriesInput struct { } // JudgeDirectoriesAnswer is what judge-directories answers. type JudgeDirectoriesAnswer = Said // SetuidSearchInput is what setuid-search takes. type SetuidSearchInput struct { // why it is asked, in words Why string `json:"why,omitempty"` } // SetuidSearchAnswer is what setuid-search answers. type SetuidSearchAnswer = Said // RootFreeInput is what root-free takes. type RootFreeInput struct { } // RootFreeAnswer is what root-free answers. type RootFreeAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // this machine's verdict Machines []RootVerdict `json:"machines"` } // ActsInput is what acts takes. type ActsInput struct { // one act, by its id ID string `json:"id,omitempty"` // at most this many, newest Limit string `json:"limit,omitempty"` } // ActsAnswer is what acts answers. type ActsAnswer = Acts // PackagesInput is what packages takes. type PackagesInput struct { // "true": write this machine's key again from what the engine composed Write string `json:"write,omitempty"` } // The values of PackagesInput's write. const ( PackagesInputWriteTrue = "true" PackagesInputWriteFalse = "false" ) // PackagesAnswerKeyPackagesItem is a type of the contract. type PackagesAnswerKeyPackagesItem struct { // declared absent Absent bool `json:"absent"` // the modules that declare it Modules []string `json:"modules"` // the package Package string `json:"package"` } // PackagesAnswerKey is the node's key as the bus holds it; absent when the engine wrote none. type PackagesAnswerKey struct { // the node Node string `json:"node"` // its packages sorted by name, absent after present Packages []PackagesAnswerKeyPackagesItem `json:"packages"` } // PackagesAnswer is what packages answers. type PackagesAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the node's key as the bus holds it; absent when the engine wrote none Key *PackagesAnswerKey `json:"key,omitempty"` // why the key could not be read KeyError string `json:"key_error,omitempty"` // the node Node string `json:"node"` // a note, such as that no key is written yet Note string `json:"note,omitempty"` // where the key is read: the engine's state packages Source string `json:"source"` // with write: the key was written again (false: it already held what the engine composed) Wrote bool `json:"wrote,omitempty"` } // CompositionInput is what composition takes. type CompositionInput struct { // "true": list the resources that differ from what runs Diff string `json:"diff,omitempty"` // a composition's digest (sha256:…), to read that revision rather than the latest Digest string `json:"digest,omitempty"` // the module, as placed on this machine; node for the node's own Module string `json:"module"` } // CompositionAnswerAttempt is the module's last apply that did not end running; absent when none. type CompositionAnswerAttempt struct { // the want's revision the hold took AnsweredRevision int64 `json:"answered_revision,omitempty"` // the digest tried Composed string `json:"composed,omitempty"` // the composition's revision it was tried at CompositionRevision int64 `json:"composition_revision"` // the fingerprint tried Fp string `json:"fp"` // held for a failed backup Held bool `json:"held,omitempty"` // it failed because the bus did not answer for a moment Transient bool `json:"transient,omitempty"` // the want's revision it was tried at WantRevision int64 `json:"want_revision"` } // CompositionAnswerDriftItem is a type of the contract. type CompositionAnswerDriftItem struct { // how its owner or mode on disk differ, in words Drift string `json:"drift"` // the directory entry's id in the composition ID string `json:"id"` // its path on the machine Path string `json:"path"` } // CompositionAnswerHave is what the module's have key says now; absent when it says nothing. type CompositionAnswerHave struct { // digest Composed string `json:"composed,omitempty"` // detail Detail string `json:"detail,omitempty"` // fingerprint Fp string `json:"fp,omitempty"` // judgement Judgement string `json:"judgement,omitempty"` // running, failed, held or waiting-yes Phase string `json:"phase"` // the digest that waits for a yes Waits string `json:"waits,omitempty"` } // CompositionAnswerJudged is the move from what runs to the composition read. type CompositionAnswerJudged struct { // the judgement Judgement string `json:"judgement"` // the agent would wait for a person's yes before applying it WaitsForYes bool `json:"waits_for_yes"` // its words Words string `json:"words"` } // CompositionAnswerOwn is of the node's own composition, its own fields beside what runs names. type CompositionAnswerOwn struct { // the revision's adoption; absent for a converged node Adoption map[string]any `json:"adoption,omitempty"` // groups Groups int64 `json:"groups,omitempty"` // each module the node's composer held in its last pass, with why Held map[string]string `json:"held,omitempty"` // identities the revision names Identities int64 `json:"identities,omitempty"` // libraries Libraries int64 `json:"libraries,omitempty"` // the account the provisioner's client runs as, as the revision names it ProvisionerAccount string `json:"provisioner_account"` // as what runs names it RunsProvisionerAccount string `json:"runs_provisioner_account,omitempty"` } // CompositionAnswerRuns is what runs of the module; absent when nothing runs. type CompositionAnswerRuns struct { // digest Composed string `json:"composed,omitempty"` // fingerprint Fp string `json:"fp,omitempty"` // applied, have or kept From string `json:"from"` // phase Phase string `json:"phase,omitempty"` // how many resources run Resources int64 `json:"resources"` } // CompositionAnswerWant is the module's want as the agent holds it; absent when it holds none. type CompositionAnswerWant struct { // the operator's answer to a failed backup, again or skip Backup string `json:"backup,omitempty"` // the composition's digest it names Composed string `json:"composed,omitempty"` // its build's fingerprint Fp string `json:"fp"` // the module is removed Removed bool `json:"removed,omitempty"` // the revision of the want's key read last Revision int64 `json:"revision"` // the node composes the module itself (ADR 0547 §2) Self bool `json:"self,omitempty"` // its words Words string `json:"words,omitempty"` // the digest a person said yes to Yes string `json:"yes,omitempty"` } // CompositionAnswerWithheldItem is a type of the contract. type CompositionAnswerWithheldItem struct { Subject string `json:"subject"` Why string `json:"why"` } // CompositionAnswerWithheldPartsItem is a type of the contract. type CompositionAnswerWithheldPartsItem struct { // the read asked, as . Part string `json:"part"` // why it did not answer, naming the holder asked Why string `json:"why"` } // CompositionAnswer is what composition answers. type CompositionAnswer struct { // the module's last apply that did not end running; absent when none Attempt *CompositionAnswerAttempt `json:"attempt,omitempty"` Composition Revision `json:"composition"` // every resource that differs from what runs, when asked Diff []map[string]any `json:"diff,omitempty"` // when the diff is asked, each directory entry of what runs that the mesh made, as its record holds, whose owner or mode on disk differ from it (H-A-392 (b), H-A-458 (2)): read-only; the engine sets it right at its next start or apply of the module Drift []CompositionAnswerDriftItem `json:"drift,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // what the module's have key says now; absent when it says nothing Have *CompositionAnswerHave `json:"have,omitempty"` // the move from what runs to the composition read Judged CompositionAnswerJudged `json:"judged"` // the module Module string `json:"module"` // the node Node string `json:"node"` // of the node's own composition, its own fields beside what runs names Own *CompositionAnswerOwn `json:"own,omitempty"` // the revisions of its key the bucket keeps, oldest first Revisions []Revision `json:"revisions,omitempty"` // what runs of the module; absent when nothing runs Runs *CompositionAnswerRuns `json:"runs,omitempty"` // the agent has looked at the module once since it started Started bool `json:"started"` // the module's want as the agent holds it; absent when it holds none Want *CompositionAnswerWant `json:"want,omitempty"` // the module's marked subjects the grants part withholds from this node's runtime, each with why, read through mesh-grants' verb withheld (design 46 approval mark 6) Withheld []CompositionAnswerWithheldItem `json:"withheld,omitempty"` // each part a compose kept because its read did not answer, with why (design 08 control-verbs §4, H-A-321): for the packet filter's holder the part node-packet-filter.allowed, its filter file kept as it runs WithheldParts []CompositionAnswerWithheldPartsItem `json:"withheld-parts,omitempty"` // withheld unknown: the grants part does not answer, when its verb withheld did not answer WithheldUnknown string `json:"withheld-unknown,omitempty"` } // CompositionDiffInput is what composition-diff takes. type CompositionDiffInput struct { // the digest (sha256:…) of the composition to compare with; give it or revision Digest string `json:"digest,omitempty"` // the module, as placed on this machine; node for the node's own Module string `json:"module"` // the revision of the module's composition key to compare with, from the revisions the bucket keeps; give it or digest Revision int64 `json:"revision,omitempty"` } // CompositionDiffAnswer is what composition-diff answers. type CompositionDiffAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the module Module string `json:"module"` // the node Node string `json:"node"` Other *Revision `json:"other,omitempty"` // each resource with an entry that differs; empty when none differs Resources []CompositionDiffResource `json:"resources"` // the digest of the composition that runs; absent when nothing runs Running string `json:"running,omitempty"` } // ComposeInput is what compose takes. type ComposeInput struct { // a module placed on this machine whose apply is also tried again (optional) Module string `json:"module,omitempty"` } // ComposeAnswerPass is how the pass went. type ComposeAnswerPass struct { // when the node composes again on its own, RFC 3339 Again string `json:"again,omitempty"` // when the pass ended, RFC 3339 At string `json:"at"` // the answer is the last pass, made moments ago Earlier bool `json:"earlier,omitempty"` // how many compositions the pass handed the agent that differ from before Handed int64 `json:"handed"` // each module refused alone, with why Held map[string]string `json:"held,omitempty"` // why the node composed none of its modules Refused string `json:"refused,omitempty"` } // ComposeAnswer is what compose answers. type ComposeAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // how the pass went Pass ComposeAnswerPass `json:"pass"` // the module whose apply was tried again Retried string `json:"retried,omitempty"` } // ComposeCandidateInput is what compose-candidate takes. type ComposeCandidateInput struct { // 128 random bits the caller chooses: the subject token of the chunks and acknowledgements the composition input is sent in, whatever its size (design 47 G A-237b); an ask with input and no call is answered inline, as before the checker goes (G-6 section 321) Call string `json:"call,omitempty"` // the key of the candidate to compose: a check's candidate in the indexer, .; a branch pipeline's catalog graph revision, . (the node-engine reads its entries through mesh-catalog.revision); or a run on request's, run-; built and read by the seat's client (nodeengineclient) Candidate string `json:"candidate"` // also answer the composition input the candidate was composed from, for the sandbox path Input bool `json:"input,omitempty"` } // ComposeCandidateAnswer is what compose-candidate answers. type ComposeCandidateAnswer struct { // the candidate's key Candidate string `json:"candidate"` // when asked with input and a call token: how many chunks of at most 512 KiB carry the composition input, sent on the chunk subject of the call, each acknowledged by the caller (design 47 G A-237b) Chunks int64 `json:"chunks,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // when asked without a call token: the composition input it composed from, inline, up to what one answer carries (the checker's form, kept until G removes the checker, G-6 section 321) Input map[string]any `json:"input,omitempty"` // every module placed on the node, sorted by name Modules []Module `json:"modules"` // the node Node string `json:"node"` Own Module `json:"own"` // why the node could not compose with the candidate at all Refused string `json:"refused,omitempty"` // how long the engine took, in milliseconds Took int64 `json:"took"` // the layout's version V int64 `json:"v"` // the node's verdict (ADR 0593 §7, §9) Verdict string `json:"verdict"` } // The values of ComposeCandidateAnswer's verdict. const ( ComposeCandidateAnswerVerdictComposed = "composed" ComposeCandidateAnswerVerdictRefused = "refused" ComposeCandidateAnswerVerdictUnready = "unready" ComposeCandidateAnswerVerdictNotJudged = "not-judged" ) // ManifestReadsInput is what manifest-reads takes. type ManifestReadsInput struct { } // ManifestReadsAnswer is what manifest-reads answers. type ManifestReadsAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the reader capabilities its engine states: the manifest words, forms and seat names it reads; empty for an engine built before it said them, read as the baseline ManifestReads []string `json:"manifest-reads,omitempty"` // the node Node string `json:"node"` // when the engine last stated them, RFC 3339 StatedAt string `json:"stated-at"` // the layout's version V int64 `json:"v"` } // ApplyOrderInput is what apply-order takes. type ApplyOrderInput struct { } // ApplyOrderAnswerOrderItem is a type of the contract. type ApplyOrderAnswerOrderItem struct { // the module whose want waits to be applied Module string `json:"module"` // the want's pipeline (its key); absent for a want in none Pipeline string `json:"pipeline,omitempty"` // its place in the order, the first applied being 1 Position int64 `json:"position"` // the mover's tier in its pipeline; absent for a want in none Rank int64 `json:"rank,omitempty"` // the modules it waits on; empty when it waits for nothing Waits []string `json:"waits"` // why it stands there, in one sentence Why string `json:"why"` } // ApplyOrderAnswer is what apply-order answers. type ApplyOrderAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // one row per unapplied changed want, in the order it will be applied Order []ApplyOrderAnswerOrderItem `json:"order"` } // SeatListInput is what seat-list takes. type SeatListInput struct { } // SeatListAnswer is what seat-list answers. type SeatListAnswer = SeatList // SeatListAgainInput is what seat-list-again takes. type SeatListAgainInput struct { } // SeatListAgainAnswer is what seat-list-again answers. type SeatListAgainAnswer = SeatList // FirstViewsInput is what first-views takes. type FirstViewsInput struct { } // FirstViewsAnswerEntriesItem is a type of the contract. type FirstViewsAnswerEntriesItem struct { // the build's fingerprint Fingerprint string `json:"fingerprint"` // since when it stands in that state, RFC 3339 Since time.Time `json:"since"` // asked of the indexer, answered, or not found by it State string `json:"state"` } // The values of FirstViewsAnswerEntriesItem's state. const ( FirstViewsAnswerEntriesItemStateAsked = "asked" FirstViewsAnswerEntriesItemStateAnswered = "answered" FirstViewsAnswerEntriesItemStateNotFound = "not-found" ) // FirstViewsAnswerWantsItem is a type of the contract. type FirstViewsAnswerWantsItem struct { // the fingerprint wanted Fingerprint string `json:"fingerprint"` // since when the want is kept, RFC 3339 KeptSince time.Time `json:"kept-since"` // the module the want is of Module string `json:"module"` } // FirstViewsAnswer is what first-views answers. type FirstViewsAnswer struct { // one row per entry the node-engine keeps of a module's build by its fingerprint: when it asked the indexer's entry and where that stands (design 47 G 698) Entries []FirstViewsAnswerEntriesItem `json:"entries"` // one status per owner and state followed, as mesh-sdk's views runtime keeps it FirstViews []map[string]any `json:"first-views"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the wants the node-engine keeps (design 47 G 683, 698) Wants []FirstViewsAnswerWantsItem `json:"wants"` } // FirstViewAgainInput is what first-view-again takes. type FirstViewAgainInput struct { // the owner module, as first-views names it Owner string `json:"owner"` // the owner's state, as first-views names it State string `json:"state"` // why it is asked again, in plain words Why string `json:"why"` } // FirstViewAgainAnswerAsked is the hand ask written. type FirstViewAgainAnswerAsked struct { // when it was asked, RFC 3339 At time.Time `json:"at"` // the caller the runtime proved By string `json:"by"` // the owner module Owner string `json:"owner"` // the owner's state State string `json:"state"` // the layout's version V int64 `json:"v"` // why it was asked again Why string `json:"why"` } // FirstViewAgainAnswer is what first-view-again answers. type FirstViewAgainAnswer struct { // the hand ask written Asked FirstViewAgainAnswerAsked `json:"asked"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the verb that reads the status, first-views Read string `json:"read"` } // EntryAgainInput is what entry-again takes. type EntryAgainInput struct { // the build's fingerprint, as first-views' entries name it Fingerprint string `json:"fingerprint"` // why it is asked again, in plain words Why string `json:"why"` } // EntryAgainAnswerAsked is the hand ask written. type EntryAgainAnswerAsked struct { // when it was asked, RFC 3339 At time.Time `json:"at"` // the caller the runtime proved By string `json:"by"` // the build's fingerprint Fingerprint string `json:"fingerprint"` // the layout's version V int64 `json:"v"` // why it was asked again Why string `json:"why"` } // EntryAgainAnswer is what entry-again answers. type EntryAgainAnswer struct { // the hand ask written Asked EntryAgainAnswerAsked `json:"asked"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the verb that reads the status, first-views Read string `json:"read"` } // ProcessBuildsInput is what process-builds takes. type ProcessBuildsInput struct { // only this module's processes Module string `json:"module,omitempty"` } // ProcessBuildsAnswer is what process-builds answers. type ProcessBuildsAnswer = ProcessBuilds // ConvergedInput is what converged takes. type ConvergedInput struct { } // ConvergedAnswer is what converged answers. type ConvergedAnswer struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the kind of the firewall found, for an adopted node Found string `json:"found,omitempty"` // the links of this node that face outside, as the engine classifies them for its filter render (ADR 0140); an allowance with no interface never opens one Outward []string `json:"outward"` // when the node became so, RFC 3339; absent where the engine recorded no time for it Since string `json:"since,omitempty"` // the node's mode: adopted (the found firewall's terms) or converged (the mesh's own filter) State string `json:"state"` // the private network's tunnel interface on this node, as the engine's filter render names it Tunnel string `json:"tunnel"` } // The values of ConvergedAnswer's state. const ( ConvergedAnswerStateAdopted = "adopted" ConvergedAnswerStateConverged = "converged" ) // AskedEvent is the body of the event asked. type AskedEvent = ActSaid // DoneEvent is the body of the event done. type DoneEvent = ActSaid // RefusedEvent is the body of the event refused. type RefusedEvent = ActSaid // ManifestReadsChangedEvent is the body of the event manifest-reads-changed. type ManifestReadsChangedEvent = ManifestReadsChanged // ComposedEvent is the body of the event composed. type ComposedEvent = Composed // RunningEvent is the body of the event running. type RunningEvent = Running // WaitHeldEvent is the body of the event wait-held. type WaitHeldEvent = Wait // WaitEndedEvent is the body of the event wait-ended. type WaitEndedEvent = Wait // HaveByNodeModuleValue is one value of the state have under the key .. type HaveByNodeModuleValue struct { Build string `json:"build,omitempty"` // the move changes the build alone BuildAlone bool `json:"build-alone,omitempty"` // the digest of the composition the node runs Composed string `json:"composed,omitempty"` Detail string `json:"detail,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` // the fingerprint held Fp string `json:"fp,omitempty"` Handed *AccountsHanded `json:"handed,omitempty"` // what the module's own check says Health string `json:"health"` // in phase waiting-yes, the judgement of the move Judgement string `json:"judgement,omitempty"` // what the node keeps of the module as it runs Kept []string `json:"kept,omitempty"` // how far it has come Phase string `json:"phase"` // the pipeline of the want the module was applied from, its key ., beside its run (H-A-429 (1), H-A-458 (1)): a want's run is compared with this run only when the want's branch is the same, the key without its last .; absent for a want in none Pipeline string `json:"pipeline,omitempty"` PullWait *PullWait `json:"pull-wait,omitempty"` // the composition run's pipeline sequence, in decimal, the module was applied from (design 47 H2 §813 (1), H-A-388): a restarted engine applies no older run again Run string `json:"run,omitempty"` // each value sealed to the node's key Sealed []string `json:"sealed,omitempty"` // the sealed values by slot SealedAt map[string]string `json:"sealed-at,omitempty"` UserList *UserListWritten `json:"user-list,omitempty"` V int64 `json:"v"` Wait *Wait `json:"wait,omitempty"` // in phase waiting-yes, the digest of the composition that waits Waits string `json:"waits,omitempty"` } // The values of HaveByNodeModuleValue's health. const ( HaveByNodeModuleValueHealthOk = "ok" HaveByNodeModuleValueHealthFailed = "failed" HaveByNodeModuleValueHealthWaits = "waits" HaveByNodeModuleValueHealthUnknown = "unknown" ) // The values of HaveByNodeModuleValue's judgement. const ( HaveByNodeModuleValueJudgementRecreates = "recreates" HaveByNodeModuleValueJudgementMovesData = "moves-data" HaveByNodeModuleValueJudgementCannotJudge = "cannot-judge" ) // The values of HaveByNodeModuleValue's phase. const ( HaveByNodeModuleValuePhaseBackingUp = "backing-up" HaveByNodeModuleValuePhaseApplying = "applying" HaveByNodeModuleValuePhaseChecking = "checking" HaveByNodeModuleValuePhaseRunning = "running" HaveByNodeModuleValuePhaseFailed = "failed" HaveByNodeModuleValuePhaseRemoved = "removed" HaveByNodeModuleValuePhaseHeld = "held" HaveByNodeModuleValuePhaseWaitingYes = "waiting-yes" ) // HaveByNodeNodeValue is one value of the state have under the key .node. type HaveByNodeNodeValue struct { Busy []map[string]any `json:"busy,omitempty"` // the node's answer to each placement candidate naming it, by proposal id Candidates map[string]CandidateAnswer `json:"candidates,omitempty"` // the digest of the node's own composition it runs Composed string `json:"composed,omitempty"` // own, or none (empty) Composes string `json:"composes,omitempty"` ComposesWhy string `json:"composes-why,omitempty"` Filters []map[string]any `json:"filters,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` Profile map[string]any `json:"profile,omitempty"` Record *NodeRecord `json:"record,omitempty"` Sealed []string `json:"sealed,omitempty"` SealedAt map[string]string `json:"sealed-at,omitempty"` Strays []map[string]any `json:"strays,omitempty"` V int64 `json:"v"` Windows []map[string]any `json:"windows,omitempty"` } // ComposedByNodeModuleFingerprintValue is one value of the state composed under the key ... type ComposedByNodeModuleFingerprintValue struct { // the module declares data Data bool `json:"data,omitempty"` // the files the provisioner fills FilledFiles []string `json:"filled_files,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` Fp string `json:"fp"` Module string `json:"module"` Node string `json:"node"` // the module's whole provisioning plan, catalogue.Plan, kept whole: it is the manifest layer's type Plan map[string]any `json:"plan,omitempty"` // why the module cannot be composed at this fingerprint Refused string `json:"refused,omitempty"` // the declaration resources, each saying its module Resources []map[string]any `json:"resources"` // the digests, sorted, of the templates archives the composition was rendered from Templates []string `json:"templates,omitempty"` V int64 `json:"v"` } // ComposedByNodeNodeValue is one value of the state composed under the key .node. type ComposedByNodeNodeValue struct { // the module declares data Data bool `json:"data,omitempty"` // the files the provisioner fills FilledFiles []string `json:"filled_files,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` Node string `json:"node"` Own *NodeOwn `json:"own,omitempty"` // the declaration resources, each saying its module Resources []map[string]any `json:"resources"` V int64 `json:"v"` } // DataByNodeModuleValue is one value of the state data under the key .. type DataByNodeModuleValue struct { Digest string `json:"digest"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` Items []PlacedDataItem `json:"items"` Module string `json:"module"` Node string `json:"node"` V int64 `json:"v"` } // PackagesByNodeValuePackagesItem is a type of the contract. type PackagesByNodeValuePackagesItem struct { Absent bool `json:"absent"` Modules []string `json:"modules"` Package string `json:"package"` } // PackagesByNodeValue is one value of the state packages under the key . type PackagesByNodeValue struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` Node string `json:"node"` Packages []PackagesByNodeValuePackagesItem `json:"packages"` } // HealthByNodeValue is one value of the state health under the key . type HealthByNodeValue struct { // when At time.Time `json:"at"` Contract int64 `json:"contract,omitempty"` Fallback *LoginFallback `json:"fallback,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` Found []NodeDirectory `json:"found,omitempty"` Network *NetworkHealth `json:"network,omitempty"` Node string `json:"node"` Peers []PeerSeen `json:"peers,omitempty"` Relogin []NodeAccount `json:"relogin,omitempty"` Root []RootAccountVerdict `json:"root,omitempty"` Units *UnitsHealth `json:"units,omitempty"` V int64 `json:"v"` } // FindingsByKeyValue is one value of the state findings under the key . type FindingsByKeyValue struct { Actions []FindingAction `json:"actions,omitempty"` At time.Time `json:"at"` // newest first, at most 10 Evidence []FindingEvidence `json:"evidence,omitempty"` Explanation string `json:"explanation,omitempty"` // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` Headline string `json:"headline,omitempty"` // scope.id.token Key string `json:"key"` Kind string `json:"kind"` Needs string `json:"needs,omitempty"` // the module that wrote it Observer string `json:"observer"` // the key's last part when it is not the kind Ref string `json:"ref,omitempty"` Resolved string `json:"resolved,omitempty"` // self, operator, agent or healer: Resolver string `json:"resolver,omitempty"` // what of its own saw it last Run string `json:"run,omitempty"` Severity string `json:"severity"` // the row, probe or event that saw it Source string `json:"source"` Subject FindingSubject `json:"subject"` // one line Summary string `json:"summary"` // layout version, 1 V int64 `json:"v"` } // The values of FindingsByKeyValue's severity. const ( FindingsByKeyValueSeverityUrgent = "urgent" FindingsByKeyValueSeverityWarning = "warning" ) // BoundsByWhatIDValue is one value of the state bounds under the key .. type BoundsByWhatIDValue struct { // is the form of what this value carries, left out while it is 1 (design 47 H2 §780). Form int64 `json:"form,omitempty"` Module string `json:"module,omitempty"` // when the wait began, RFC 3339 Since string `json:"since"` // layout version, 1 V int64 `json:"v"` } // DecodeHandOverAnswer reads a HandOverAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeHandOverAnswer(raw []byte) (HandOverAnswer, int, error) { var v HandOverAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeAccessActAnswer reads a AccessActAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeAccessActAnswer(raw []byte) (AccessActAnswer, int, error) { var v AccessActAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeJudgeDirectoriesAnswer reads a JudgeDirectoriesAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeJudgeDirectoriesAnswer(raw []byte) (JudgeDirectoriesAnswer, int, error) { var v JudgeDirectoriesAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeSetuidSearchAnswer reads a SetuidSearchAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeSetuidSearchAnswer(raw []byte) (SetuidSearchAnswer, int, error) { var v SetuidSearchAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeRootFreeAnswer reads a RootFreeAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeRootFreeAnswer(raw []byte) (RootFreeAnswer, int, error) { var v RootFreeAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeActsAnswer reads a ActsAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeActsAnswer(raw []byte) (ActsAnswer, int, error) { var v ActsAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodePackagesAnswer reads a PackagesAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodePackagesAnswer(raw []byte) (PackagesAnswer, int, error) { var v PackagesAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeCompositionAnswer reads a CompositionAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeCompositionAnswer(raw []byte) (CompositionAnswer, int, error) { var v CompositionAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeCompositionDiffAnswer reads a CompositionDiffAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeCompositionDiffAnswer(raw []byte) (CompositionDiffAnswer, int, error) { var v CompositionDiffAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeComposeAnswer reads a ComposeAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeComposeAnswer(raw []byte) (ComposeAnswer, int, error) { var v ComposeAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeComposeCandidateAnswer reads a ComposeCandidateAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeComposeCandidateAnswer(raw []byte) (ComposeCandidateAnswer, int, error) { var v ComposeCandidateAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeManifestReadsAnswer reads a ManifestReadsAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeManifestReadsAnswer(raw []byte) (ManifestReadsAnswer, int, error) { var v ManifestReadsAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeApplyOrderAnswer reads a ApplyOrderAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeApplyOrderAnswer(raw []byte) (ApplyOrderAnswer, int, error) { var v ApplyOrderAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeSeatListAnswer reads a SeatListAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeSeatListAnswer(raw []byte) (SeatListAnswer, int, error) { var v SeatListAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeSeatListAgainAnswer reads a SeatListAgainAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeSeatListAgainAnswer(raw []byte) (SeatListAgainAnswer, int, error) { var v SeatListAgainAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeFirstViewsAnswer reads a FirstViewsAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeFirstViewsAnswer(raw []byte) (FirstViewsAnswer, int, error) { var v FirstViewsAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeFirstViewAgainAnswer reads a FirstViewAgainAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeFirstViewAgainAnswer(raw []byte) (FirstViewAgainAnswer, int, error) { var v FirstViewAgainAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeEntryAgainAnswer reads a EntryAgainAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeEntryAgainAnswer(raw []byte) (EntryAgainAnswer, int, error) { var v EntryAgainAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeProcessBuildsAnswer reads a ProcessBuildsAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeProcessBuildsAnswer(raw []byte) (ProcessBuildsAnswer, int, error) { var v ProcessBuildsAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeConvergedAnswer reads a ConvergedAnswer as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeConvergedAnswer(raw []byte) (ConvergedAnswer, int, error) { var v ConvergedAnswer if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeAskedEvent reads a AskedEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeAskedEvent(raw []byte) (AskedEvent, int, error) { var v AskedEvent if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeDoneEvent reads a DoneEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeDoneEvent(raw []byte) (DoneEvent, int, error) { var v DoneEvent if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeRefusedEvent reads a RefusedEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeRefusedEvent(raw []byte) (RefusedEvent, int, error) { var v RefusedEvent if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeManifestReadsChangedEvent reads a ManifestReadsChangedEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeManifestReadsChangedEvent(raw []byte) (ManifestReadsChangedEvent, int, error) { var v ManifestReadsChangedEvent if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeComposedEvent reads a ComposedEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeComposedEvent(raw []byte) (ComposedEvent, int, error) { var v ComposedEvent if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeRunningEvent reads a RunningEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeRunningEvent(raw []byte) (RunningEvent, int, error) { var v RunningEvent if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeWaitHeldEvent reads a WaitHeldEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeWaitHeldEvent(raw []byte) (WaitHeldEvent, int, error) { var v WaitHeldEvent if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // DecodeWaitEndedEvent reads a WaitEndedEvent as another part wrote it: a field this reader does not know is left unread, never refused; the form read is answered, 1 when absent (design 47 H2 §780). func DecodeWaitEndedEvent(raw []byte) (WaitEndedEvent, int, error) { var v WaitEndedEvent if err := json.Unmarshal(raw, &v); err != nil { return v, 0, err } return v, formRead(raw), nil } // formRead is the form a value says on the wire: 1 when it says none, or is no object. func formRead(raw []byte) int { var f struct { Form int `json:"form"` } if json.Unmarshal(raw, &f) != nil || f.Form < 1 { return 1 } return f.Form }