Documentation
¶
Overview ¶
Package cli is the podium command-line client. It talks to the control plane over Connect and never touches Docker: everything it knows comes from the server.
Index ¶
Constants ¶
const ( // ExitInfra is anything that stopped the task from producing an exit code: the // server was unreachable, the image would not pull, the node failed the task. ExitInfra = 125 // ExitCancelled is a task that was cancelled, matching the shell's 128+SIGINT. ExitCancelled = 130 // ExitUsage is a bad invocation or a rejected request. ExitUsage = 1 )
Exit codes the CLI is contractual about; see docs/cli.md.
const DefaultServer = "http://127.0.0.1:8080"
DefaultServer is what the CLI dials when nothing says otherwise.
Variables ¶
This section is empty.
Functions ¶
func ConfigPath ¶
func ConfigPath() string
ConfigPath is the file the CLI reads, honouring XDG_CONFIG_HOME.
func NewRootCommand ¶
NewRootCommand builds the whole CLI. The global --server and --token flags win over PODIUM_SERVER/PODIUM_TOKEN, which win over ~/.config/podium/config.yaml.
Types ¶
type Config ¶
type Config struct {
Server string `yaml:"server"`
// SENSITIVE: never printed. Under the local transport this is PODIUM_LOCAL_TOKEN.
Token string `yaml:"token"`
}
Config is ~/.config/podium/config.yaml. Environment variables override it and flags override them, so a scripted invocation never depends on what is on the developer's disk.
func LoadConfig ¶
LoadConfig resolves the effective configuration: the file, then PODIUM_SERVER and PODIUM_TOKEN (or PODIUM_LOCAL_TOKEN, which is the same secret under the server's name for it), then the --server and --token flags. A missing file is not an error.