Documentation
¶
Overview ¶
Package cli is the la command tree as a library. The la binary runs it as its root; a host such as Outcome mounts it under its own name (`out la`) by calling Main with a Config that says how to re-invoke itself.
Index ¶
Constants ¶
const ContainerName = "laforge"
ContainerName is the one forge container per machine.
const DefaultPort = 4646
DefaultPort is where the forge listens when it is free.
const LocalImage = "laforge:local"
LocalImage is what `make image` builds.
const PublishedImage = "ghcr.io/runoutcome/laforge"
PublishedImage is where release images are published.
Variables ¶
var Version = "dev"
Version is set at build time (-ldflags "-X .../cli.Version=v0.1.0").
Functions ¶
func DefaultImage ¶
func DefaultImage() string
DefaultImage is the image `la up --container` runs ($LAFORGE_IMAGE to change): a release build runs the image of its own version, a development build the locally built one.
Types ¶
type Config ¶
type Config struct {
// Prog is the name shown in usage and messages: "la" or "out la".
Prog string
// Reexec is the argument prefix that reaches this tree when the current
// executable is run again: nil for la, []string{"la"} for out.
Reexec []string
// Stdout and Stderr default to the process's own.
Stdout, Stderr io.Writer
}
Config says who is running the command tree.
type ContainerState ¶
type ContainerState struct {
Image string `json:"image"`
Port int `json:"port"`
Token string `json:"token"`
Workspace string `json:"workspace"`
Runtime string `json:"runtime"`
StartedAt time.Time `json:"startedAt"`
}
ContainerState is what the host keeps about the forge container in <home>/container.json: enough to give a link without asking the container.