Documentation
¶
Overview ¶
Package fixturecommand is the command-line client fixture of the API at /api/v1 (D19, D20), on github.com/urfave/cli/v3, generated from its livewire registry: one command per declaration and read kind, the parameters as flags, a body as --body or on stdin, the answers as JSON on stdout and the diagnostics on stderr. The API's URL with its base path comes from --base-url or FIXTURE_BASE_URL, the API key from --api-key or FIXTURE_API_KEY. A binary's main is
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt) defer stop() os.Exit(fixturecommand.Run(ctx, os.Args, os.Stdin, os.Stdout, os.Stderr))
Index ¶
Constants ¶
const ( ExitSuccess = 0 // the command did what it says ExitFailure = 1 // the server failed (5xx) or could not be reached ExitUsage = 2 // the command line is wrong ExitRefused = 3 // the server refused the request (4xx), or the API key's identity is gone )
The exit codes of Run.
Variables ¶
This section is empty.
Functions ¶
func Command ¶
Command is the root command fixture; Run runs it with the given streams. A command line mistake is returned without urfave's help text, which would land on stdout: the diagnostic goes to stderr, explicit --help to stdout.
func Run ¶
func Run(ctx context.Context, arguments []string, input io.Reader, output, diagnostics io.Writer) int
Run runs the command line arguments (as os.Args, the program's name first): a body is read from input when --body is absent, every answer is written to output as JSON and every diagnostic to diagnostics. It answers the exit code.
Types ¶
This section is empty.