Tell a bundle the kinds its membership names

This commit is contained in:
jochen
2026-10-09 10:12:39 +02:00
committed by jschoubben
parent 7b4428c510
commit c6087129ce
3 changed files with 28 additions and 1 deletions
+21
View File
@@ -31,6 +31,27 @@ type SeatTraffic struct {
Answers []string `json:"answers,omitempty"`
Workers []SeatWorker `json:"workers,omitempty"`
Records []string `json:"records,omitempty"`
// Kinds are the holders of every kinded bench the module uses or watches, with what each promises: the
// controller's record of their claims (novox/hq ADR 0259 §5).
Kinds []KindHeld `json:"kinds,omitempty"`
}
// KindHeld is one kind of a kinded bench and who holds it.
type KindHeld struct {
Seat string `json:"seat"`
Kind string `json:"kind"`
Module string `json:"module"`
Node string `json:"node"`
Capabilities []string `json:"capabilities,omitempty"`
}
// SeatKinds is the kinds the module's membership names, as the controller issued them.
func (c *Conn) SeatKinds(module string) ([]KindHeld, error) {
t, err := c.trafficOf(module)
if err != nil {
return nil, err
}
return append([]KindHeld{}, t.Kinds...), nil
}
// SeatWorker is one work queue a holder takes from.