ax(node): replace prose type comments with usage examples in bundle.go
BundleType, Bundle, and BundleManifest had comments restating what the type signature already says (AX Principle 2 violation). Replaced with concrete usage examples showing how each type is constructed and used. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
fe53e1fd4c
commit
53654cffbc
1 changed files with 7 additions and 3 deletions
|
|
@ -14,7 +14,9 @@ import (
|
|||
"forge.lthn.ai/Snider/Borg/pkg/tim"
|
||||
)
|
||||
|
||||
// BundleType defines the type of deployment bundle.
|
||||
// bundle.Type = BundleProfile // config/profile JSON only
|
||||
// bundle.Type = BundleMiner // miner binary + config
|
||||
// bundle.Type = BundleFull // miner binary + profiles + config
|
||||
type BundleType string
|
||||
|
||||
const (
|
||||
|
|
@ -23,7 +25,9 @@ const (
|
|||
BundleFull BundleType = "full" // Everything (miner + profiles + config)
|
||||
)
|
||||
|
||||
// Bundle represents a deployment bundle for P2P transfer.
|
||||
// bundle, err := CreateProfileBundle(profileJSON, "main", password)
|
||||
// bundle, err := CreateMinerBundle("/usr/bin/xmrig", nil, "xmrig-lthn", password)
|
||||
// if VerifyBundle(bundle) { conn.Send(bundle) }
|
||||
type Bundle struct {
|
||||
Type BundleType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
|
|
@ -31,7 +35,7 @@ type Bundle struct {
|
|||
Checksum string `json:"checksum"` // SHA-256 of Data
|
||||
}
|
||||
|
||||
// BundleManifest describes the contents of a bundle.
|
||||
// manifest := BundleManifest{Type: BundleMiner, Name: "xmrig-lthn", MinerType: "xmrig", CreatedAt: "2026-01-01T00:00:00Z"}
|
||||
type BundleManifest struct {
|
||||
Type BundleType `json:"type"`
|
||||
Name string `json:"name"`
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue