ax(node): replace prose comments with usage examples on Controller
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

Controller type and sendRequest had comments that restated the type
signature in prose. RFC-025 §2: if a comment restates what the type
signature says, delete it; show a concrete call instead.

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

View file

@ -10,7 +10,9 @@ import (
"forge.lthn.ai/Snider/Mining/pkg/logging"
)
// Controller manages remote peer operations from a controller node.
// ctrl := node.NewController(nodeManager, peerRegistry, transport)
// rtt, _ := ctrl.PingPeer("abc123def456")
// stats, _ := ctrl.GetRemoteStats("abc123def456")
type Controller struct {
node *NodeManager
peers *PeerRegistry
@ -59,7 +61,8 @@ func (c *Controller) handleResponse(conn *PeerConnection, msg *Message) {
}
}
// sendRequest sends a message and waits for a response.
// resp, err := c.sendRequest("abc123def456", msg, 10*time.Second)
// if err != nil { return nil, err }
func (c *Controller) sendRequest(peerID string, msg *Message, timeout time.Duration) (*Message, error) {
actualPeerID := peerID