ax(node): replace AddPeer prose comment with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

AX Principle 2: comments restate the signature — replace with a concrete
call showing realistic values and the debounce behaviour as a note.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 09:13:10 +01:00
parent 501d7ecf11
commit 39e0df4de3
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -232,9 +232,8 @@ func (r *PeerRegistry) ListAllowedPublicKeys() []string {
return keys
}
// AddPeer adds a new peer to the registry.
// Note: Persistence is debounced (writes batched every 5s). Call Close() to ensure
// all changes are flushed to disk before shutdown.
// registry.AddPeer(&Peer{ID: "abc123", Name: "worker-1", Address: "10.0.0.2:9090", Role: RoleWorker})
// Persistence is debounced — call Close() before shutdown to flush all pending writes.
func (r *PeerRegistry) AddPeer(peer *Peer) error {
r.mu.Lock()