Documentation
¶
Overview ¶
Package cli is the wctr command: subcommands in the familiar container CLI grammar (pull, run, ps, logs, rm, rmi, inspect, images) speaking the engine's API, which is compatible with the Docker Engine API.
It is a package so that the command runs anywhere a client can reach a daemon: cmd/wctr over a unix socket, the browser playground in-process through an in-memory transport. It imports no runtime and nothing native, so it also builds for GOOS=wasip1 and GOOS=js.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exit ¶
Exit is a status RunE wants the process to end with (`wctr run` returns the container's).
Types ¶
type Candidate ¶ added in v0.3.0
type Candidate struct {
Value string `json:"value"`
Description string `json:"description,omitempty"`
}
Candidate is one completion choice.
type Completion ¶ added in v0.3.0
type Completion struct {
Candidates []Candidate
Directive cobra.ShellCompDirective
}
Completion is what cobra's __complete answered.
func Complete ¶ added in v0.3.0
Complete runs the hidden __complete command in-process for words (the arguments after "wctr"; the last one is the word being completed, "" for a new word) and parses its output: one "value[\tdescription]" per line, then ":<directive>". This is what a shell's completion script does by running the binary; the playground's line editor does it here.
func (Completion) Failed ¶ added in v0.3.0
func (c Completion) Failed() bool
Failed reports the Error directive (ignore the candidates).
func (Completion) NoSpace ¶ added in v0.3.0
func (c Completion) NoSpace() bool
NoSpace reports the NoSpace directive (no space after a unique match).
type Options ¶
type Options struct {
// Version is what --version and `wctr version` print (default "dev").
Version string
// DefaultHost is the -H default (default api.DefaultHost()).
DefaultHost string
// Client connects to a host; nil means api.NewClient.
Client func(host string) (*api.Client, error)
// LookupEnv resolves `-e KEY` (default os.LookupEnv).
LookupEnv func(string) (string, bool)
// PullCandidates, when set, adds pullable images to the completion of
// pull and run (the playground's mirror catalogue).
PullCandidates func(context.Context) []cobra.Completion
// RunArgs, when set, completes the arguments after the image of run
// (the playground knows its lab image's subcommands).
RunArgs func(image string, args []string) []cobra.Completion
// NoCompletionCommand removes cobra's `completion` command (scripts
// for a shell the host does not have, as in the browser).
NoCompletionCommand bool
}
Options configure a command tree.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package lineedit is wctr's interactive line editor, as a pure model: key events in, the line, the cursor, candidate listings and submitted lines out.
|
Package lineedit is wctr's interactive line editor, as a pure model: key events in, the line, the cursor, candidate listings and submitted lines out. |