fix(api): align response type aliases with RFC
Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
parent
af96bfce94
commit
686f4ea54f
1 changed files with 15 additions and 0 deletions
15
api_rows.go
15
api_rows.go
|
|
@ -20,17 +20,26 @@ type SummaryDocument struct {
|
|||
CustomDiffStats map[uint64]CustomDiffBucketStats `json:"custom_diff_stats,omitempty"`
|
||||
}
|
||||
|
||||
// SummaryResponse is the RFC name for SummaryDocument.
|
||||
type SummaryResponse = SummaryDocument
|
||||
|
||||
// HashrateDocument{Total: [6]float64{12345.67, 11900.00, 12100.00, 11800.00, 12000.00, 12200.00}}
|
||||
type HashrateDocument struct {
|
||||
Total [6]float64 `json:"total"`
|
||||
}
|
||||
|
||||
// HashrateResponse is the RFC name for HashrateDocument.
|
||||
type HashrateResponse = HashrateDocument
|
||||
|
||||
// MinersCountDocument{Now: 142, Max: 200}
|
||||
type MinersCountDocument struct {
|
||||
Now uint64 `json:"now"`
|
||||
Max uint64 `json:"max"`
|
||||
}
|
||||
|
||||
// MinersCountResponse is the RFC name for MinersCountDocument.
|
||||
type MinersCountResponse = MinersCountDocument
|
||||
|
||||
// UpstreamDocument{Active: 1, Sleep: 0, Error: 0, Total: 1, Ratio: 142.0}
|
||||
type UpstreamDocument struct {
|
||||
Active uint64 `json:"active"`
|
||||
|
|
@ -40,6 +49,9 @@ type UpstreamDocument struct {
|
|||
Ratio float64 `json:"ratio"`
|
||||
}
|
||||
|
||||
// UpstreamResponse is the RFC name for UpstreamDocument.
|
||||
type UpstreamResponse = UpstreamDocument
|
||||
|
||||
// ResultsDocument{Accepted: 4821, Rejected: 3, Invalid: 0, Expired: 12}
|
||||
type ResultsDocument struct {
|
||||
Accepted uint64 `json:"accepted"`
|
||||
|
|
@ -52,6 +64,9 @@ type ResultsDocument struct {
|
|||
Best [10]uint64 `json:"best"`
|
||||
}
|
||||
|
||||
// ResultsResponse is the RFC name for ResultsDocument.
|
||||
type ResultsResponse = ResultsDocument
|
||||
|
||||
// doc := p.WorkersDocument()
|
||||
// _ = doc.Workers[0][0]
|
||||
type WorkersDocument struct {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue