ax(node): replace prose comments with usage examples on Controller
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:
parent
c7c2bd7df9
commit
f18991470d
1 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue