ax(mining): replace prose type comments with usage examples in mining_profile.go

RawConfig and MiningProfile had description-style comments restating what
the types are rather than showing how to use them (AX Principle 2 violation).
Replaced with concrete call-site examples demonstrating real usage patterns.

Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
Claude 2026-04-02 13:15:17 +01:00
parent 5bf7509268
commit 5de656ff04
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -1,13 +1,12 @@
package mining
// RawConfig is a raw encoded JSON value.
// It implements Marshaler and Unmarshaler and can be used to delay JSON decoding or precompute a JSON encoding.
// We define it as []byte (like json.RawMessage) to avoid swagger parsing issues with the json package.
// var raw RawConfig
// _ = json.Unmarshal([]byte(`{"pool":"pool.lthn.io:3333"}`), &raw)
type RawConfig []byte
// MiningProfile represents a saved configuration for running a specific miner.
// It decouples the UI from the underlying miner's specific config structure.
// profile := MiningProfile{ID: "abc", Name: "LTHN RandomX", MinerType: "xmrig", Config: raw}
// manager.SaveProfile(profile)
type MiningProfile struct {
ID string `json:"id"`
Name string `json:"name"`