Files
mesh-delivery/modules/mesh-delivery-indexer/internal/index/domain.go
T
jschoubben 71a35a6376 MV1: move contracts and sdk under modules/, importers follow
The delivery repository's contracts and SDK live under modules/ as
mesh-delivery-contracts and mesh-delivery-sdk, their Go module paths
renamed to match the folders (the TypeScript names already did), and
every importer in mesh-delivery, mesh-catalog, mesh-host, mesh-tools
and mesh-sdk follows in the same group: a design as it should be, one
path per module, checked by the group's check building every importer.

Builds: design 47 G §427, §88

Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-12 05:09:56 +01:00

32 lines
1.2 KiB
Go

package index
// Where a seat of the mesh's own contracts may be defined (novox/hq ADR 0636 §5, ADR 0634 §7): the rule is the domain
// SDK's (mesh-delivery sdk/seatdefs), shared with the checker; here only how the indexer's kept entries meet it. A second
// definer is refused with a finding naming both, unless it is a handover to the seat's domain's module.
import (
"encoding/json"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-sdk/seatdefs"
"git.novox.be/novox/mesh-sdk/go/seatdef"
)
// domainOf is the domain a kept definition names ("" when it is none or does not decode).
func domainOf(raw json.RawMessage) string {
var d struct {
Domain string `json:"domain"`
}
_ = json.Unmarshal(raw, &d)
return d.Domain
}
// handsOver says a kept trunk entry is handed over to a definer (seatdefs.HandsOver).
func handsOver(cur SeatDefinitionEntry, module string, d seatdef.Definition) bool {
return seatdefs.HandsOver(cur.Module, module, d)
}
// handoverPending says a trunk entry its holder no longer defines waits for its domain's module (seatdefs.HandoverPending).
func handoverPending(cur SeatDefinitionEntry) bool {
return seatdefs.HandoverPending(cur.Module, domainOf(cur.Definition))
}