Documentation
¶
Overview ¶
Package clikit introduces the runtime that GSI-HPC's command-line tools share. It holds no API: each part of the kit is a package of its own, imported by its path:
github.com/GSI-HPC/go-clikit/termtext escaping untrusted text for a terminal, and display width github.com/GSI-HPC/go-clikit/progress spans carried in a context.Context, the JSONL event log, TRACEPARENT github.com/GSI-HPC/go-clikit/progress/display the live tree, the counter, plain lines for CI, the summary github.com/GSI-HPC/go-clikit/progress/cliprogress the words of --progress, a command's display, summary and event log github.com/GSI-HPC/go-clikit/progress/progresstest capturing and checking the events a command reports github.com/GSI-HPC/go-clikit/fanout bounded worker pools that report their targets as progress
A library package reports what it does through progress, which costs nothing when no command is listening, and runs work for many targets with fanout. A command decides how the work is shown: it creates a progress.Bus, attaches a display from progress/display and, if asked, an event log, and passes the Bus down in its context.Context, or has progress/cliprogress do so from its flags. The kit knows no program: a program's name, the noun for its targets and its rule for exit codes are parameters.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fanout works on many items at once, a bounded number at a time.
|
Package fanout works on many items at once, a bounded number at a time. |
|
Package progress reports what a command is doing while it runs.
|
Package progress reports what a command is doing while it runs. |
|
cliprogress
Package cliprogress is the command line's side of progress: the words a flag such as --progress takes, the rule that picks a display from them and from what the program found out about its streams, and a Run, which makes the Bus, the display, the summary and the event log of one command and takes them down again, in order, once the command has ended.
|
Package cliprogress is the command line's side of progress: the words a flag such as --progress takes, the rule that picks a display from them and from what the program found out about its streams, and a Run, which makes the Bus, the display, the summary and the event log of one command and takes them down again, in order, once the command has ended. |
|
display
Package display shows the progress of a command on its standard error, from the events of its progress.Bus: the live tree, a few rows at the bottom of a terminal that show the work under way and what of it failed; the counter, one line there that says how far the work has got; plain lines, one for each thing worth a line, for a log as much as a terminal; and the summary a display leaves behind once the command has ended.
|
Package display shows the progress of a command on its standard error, from the events of its progress.Bus: the live tree, a few rows at the bottom of a terminal that show the work under way and what of it failed; the counter, one line there that says how far the work has got; plain lines, one for each thing worth a line, for a log as much as a terminal; and the summary a display leaves behind once the command has ended. |
|
progresstest
Package progresstest captures the progress events of a test, draws them as a tree that does not depend on the order concurrent work happened in, and checks that they keep the promises the progress package makes to every sink.
|
Package progresstest captures the progress events of a test, draws them as a tree that does not depend on the order concurrent work happened in, and checks that they keep the promises the progress package makes to every sink. |
|
Package termtext makes untrusted text safe to write to a terminal, and measures how many columns text takes there.
|
Package termtext makes untrusted text safe to write to a terminal, and measures how many columns text takes there. |
Click to show internal directories.
Click to hide internal directories.