Help us shape the future of Go! Take the 2026 Go Developer Survey

fixturecommand

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

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

View Source
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

func Command() *cli.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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL