feat(events): deliver state changes to the configurable operator event center
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user