feat(events): deliver state changes to the configurable operator event center

This commit is contained in:
DCCONSTRUCTIONS
2026-11-21 20:58:27 +03:00
parent d4ed96f3cd
commit 1b67d5f7df
35 changed files with 2058 additions and 8 deletions
+2
View File
@@ -44,6 +44,7 @@ type PairState struct {
Revocations []CoreBinding `json:"revocations,omitempty"`
}
type Pairing struct {
operatorEvents *operatorOutbox
Power *NodePower
Budget *LinkBudget
Routers *routers.Collector
@@ -74,6 +75,7 @@ func OpenPairing(store *Store, dir, version string, inventory func() Inventory)
p := &Pairing{store: store, path: filepath.Join(dir, "core-binding.json"), now: time.Now, inventory: inventory, version: version, connection: "offline", clients: make(map[string]*http.Client), state: PairState{Schema: PairSchema, Phase: "unpaired"}}
id, name := store.Public()
p.RoverConfiguration = OpenRoverConfiguration(dir, id, name)
p.operatorEvents = openOperatorOutbox(filepath.Join(dir, "operator-events.json"))
data, e := os.ReadFile(p.path)
if os.IsNotExist(e) {
return p, nil