docs(proxy): align AX comments

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-05 02:06:24 +00:00
parent 356eb9cec1
commit 5d8d82b9b5
4 changed files with 9 additions and 9 deletions

View file

@ -1,6 +1,6 @@
package proxy package proxy
// Config is the top-level proxy configuration. // Config is the top-level proxy configuration used by `proxy.New`.
// //
// cfg := &proxy.Config{ // cfg := &proxy.Config{
// Mode: "nicehash", // Mode: "nicehash",

View file

@ -14,7 +14,7 @@ type CustomDiffBucketStats struct {
HashesTotal uint64 `json:"hashes_total"` HashesTotal uint64 `json:"hashes_total"`
} }
// CustomDiffBuckets records share totals grouped by miner custom difficulty. // CustomDiffBuckets groups share totals by the miner's resolved custom difficulty.
// //
// buckets := NewCustomDiffBuckets(true) // buckets := NewCustomDiffBuckets(true)
// buckets.OnAccept(Event{Miner: &Miner{customDiff: 50000}, Diff: 25000}) // buckets.OnAccept(Event{Miner: &Miner{customDiff: 50000}, Diff: 25000})

View file

@ -6,11 +6,11 @@ import (
"time" "time"
) )
// Stats tracks the proxy-wide counters and rolling hashrate windows. // Stats tracks proxy-wide counters and rolling hashrate windows.
// //
// stats := proxy.NewStats() // stats := proxy.NewStats()
// bus.Subscribe(proxy.EventAccept, stats.OnAccept) // bus.Subscribe(proxy.EventAccept, stats.OnAccept)
// bus.Subscribe(proxy.EventReject, stats.OnReject) // bus.Subscribe(proxy.EventReject, stats.OnReject)
type Stats struct { type Stats struct {
accepted atomic.Uint64 accepted atomic.Uint64
rejected atomic.Uint64 rejected atomic.Uint64
@ -50,7 +50,7 @@ type tickWindow struct {
// StatsSummary is the serialisable snapshot returned by Stats.Summary(). // StatsSummary is the serialisable snapshot returned by Stats.Summary().
// //
// summary := proxy.NewStats().Summary() // summary := proxy.NewStats().Summary()
type StatsSummary struct { type StatsSummary struct {
Accepted uint64 `json:"accepted"` Accepted uint64 `json:"accepted"`
Rejected uint64 `json:"rejected"` Rejected uint64 `json:"rejected"`

View file

@ -5,7 +5,7 @@ import (
"time" "time"
) )
// Workers tracks per-identity aggregates derived from miner login fields. // Workers tracks per-worker aggregates derived from miner login fields.
// //
// workers := proxy.NewWorkers(proxy.WorkersByRigID, bus) // workers := proxy.NewWorkers(proxy.WorkersByRigID, bus)
// workers.OnLogin(proxy.Event{Miner: &proxy.Miner{rigID: "rig-alpha", user: "WALLET", ip: "10.0.0.1"}}) // workers.OnLogin(proxy.Event{Miner: &proxy.Miner{rigID: "rig-alpha", user: "WALLET", ip: "10.0.0.1"}})
@ -18,7 +18,7 @@ type Workers struct {
mu sync.RWMutex mu sync.RWMutex
} }
// WorkerRecord is the aggregate row returned by Workers.List(). // WorkerRecord is the aggregate row returned by `Workers.List()`.
// //
// record := proxy.WorkerRecord{Name: "rig-alpha"} // record := proxy.WorkerRecord{Name: "rig-alpha"}
// _ = record.Hashrate(60) // _ = record.Hashrate(60)