Documentation
¶
Overview ¶
Package config resolves the runtime configuration for the `polycli heimdall` command tree.
Precedence (highest wins): explicit command-line flag > environment variable > config file (~/.polycli/heimdall.toml) > network preset > built-in default. A missing config file is not an error.
Index ¶
Constants ¶
View Source
const ( ExitOK = 0 ExitNodeErr = 1 ExitNetErr = 2 ExitUsageErr = 3 ExitSignErr = 4 )
Exit codes mirror cast conventions (see requirements §2.1).
View Source
const ( EnvNetwork = "HEIMDALL_NETWORK" EnvRESTURL = "HEIMDALL_REST_URL" EnvRPCURL = "HEIMDALL_RPC_URL" EnvChainID = "HEIMDALL_CHAIN_ID" EnvDenom = "HEIMDALL_FEE_DENOM" EnvTimeout = "HEIMDALL_TIMEOUT" EnvRPCHeaders = "HEIMDALL_RPC_HEADERS" EnvNoColor = "NO_COLOR" )
Environment-variable names (requirements §2.2).
Variables ¶
This section is empty.
Functions ¶
func PresetNames ¶
func PresetNames() []string
Preset names in stable order (used for error messages + help text).
Types ¶
type Config ¶
type Config struct {
Network string
RESTURL string
RPCURL string
ChainID string
Denom string
Timeout time.Duration
RPCHeaders map[string]string
Insecure bool
JSON bool
Curl bool
Color string // auto|always|never
Raw bool
}
Config holds the fully resolved runtime configuration.
type Flags ¶
type Flags struct {
Mainnet bool
Amoy bool
Network string
RESTURL string
RPCURL string
ChainID string
Denom string
TimeoutSec int
RPCHeaders string
Insecure bool
JSON bool
Curl bool
Color string
NoColor bool
Raw bool
ConfigPath string
}
Flags holds the raw command-line flag state before resolution. Persistent flags bind to the fields of this struct.
Click to show internal directories.
Click to hide internal directories.