docs(proxy): align AX usage comments

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-05 00:59:17 +00:00
parent e94616922d
commit f3c5175785
2 changed files with 7 additions and 4 deletions

View file

@ -7,7 +7,8 @@ type WorkerRow [13]any
type MinerRow [10]any
// doc := p.SummaryDocument()
// doc.Results.Accepted == 4821
// _ = doc.Results.Accepted
// _ = doc.Upstreams.Ratio
type SummaryDocument struct {
Version string `json:"version"`
Mode string `json:"mode"`
@ -52,14 +53,14 @@ type ResultsDocument struct {
}
// doc := p.WorkersDocument()
// doc.Workers[0][0] == "rig-alpha"
// _ = doc.Workers[0][0]
type WorkersDocument struct {
Mode string `json:"mode"`
Workers []WorkerRow `json:"workers"`
}
// doc := p.MinersDocument()
// doc.Miners[0][7] == "********"
// _ = doc.Miners[0][7]
type MinersDocument struct {
Format []string `json:"format"`
Miners []MinerRow `json:"miners"`

View file

@ -17,7 +17,7 @@ type CustomDiffBucketStats struct {
// CustomDiffBuckets records share totals grouped by miner custom difficulty.
//
// buckets := NewCustomDiffBuckets(true)
// buckets.OnAccept(proxy.Event{Miner: &proxy.Miner{}})
// buckets.OnAccept(Event{Miner: &Miner{customDiff: 50000}, Diff: 25000})
type CustomDiffBuckets struct {
enabled bool
buckets map[uint64]*CustomDiffBucketStats
@ -74,6 +74,8 @@ func (b *CustomDiffBuckets) OnReject(e Event) {
}
// Snapshot returns a copy of the current bucket totals.
//
// summary := buckets.Snapshot()
func (b *CustomDiffBuckets) Snapshot() map[uint64]CustomDiffBucketStats {
if b == nil {
return nil