ax(mining): replace prose struct comments with usage examples

Four type comments in mining.go restated the type name in prose
("represents a ...", "provides ..."), violating AX Principle 2.
Replaced with concrete usage examples showing realistic field values.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 13:11:10 +01:00
parent 519cbca6de
commit 182a40d219
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -54,7 +54,7 @@ type InstallationDetails struct {
ConfigPath string `json:"config_path,omitempty"` // Add path to the miner-specific config
}
// SystemInfo provides general system and miner installation information.
// info := SystemInfo{OS: "linux", Architecture: "amd64", AvailableCPUCores: 8}
type SystemInfo struct {
Timestamp time.Time `json:"timestamp"`
OS string `json:"os"`
@ -246,20 +246,20 @@ type PerformanceMetrics struct {
ExtraData map[string]interface{} `json:"extraData,omitempty"`
}
// HashratePoint represents a single hashrate measurement at a specific time.
// point := HashratePoint{Timestamp: time.Now(), Hashrate: 1500}
type HashratePoint struct {
Timestamp time.Time `json:"timestamp"`
Hashrate int `json:"hashrate"`
}
// API represents the miner's API configuration.
// api := API{Enabled: true, ListenHost: "127.0.0.1", ListenPort: 18080}
type API struct {
Enabled bool `json:"enabled"`
ListenHost string `json:"listenHost"`
ListenPort int `json:"listenPort"`
}
// XMRigSummary represents the full JSON response from the XMRig API.
// summary := XMRigSummary{}; json.Unmarshal(body, &summary); fmt.Println(summary.Hashrate.Highest)
type XMRigSummary struct {
ID string `json:"id"`
WorkerID string `json:"worker_id"`
@ -337,7 +337,7 @@ type XMRigSummary struct {
Hugepages []int `json:"hugepages"`
}
// AvailableMiner represents a miner that is available for use.
// miner := AvailableMiner{Name: "xmrig", Description: "CPU/GPU miner for RandomX"}
type AvailableMiner struct {
Name string `json:"name"`
Description string `json:"description"`