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

cmd

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const Version = "0.13.3" // x-release-please-version

Variables

View Source
var (
	Command            *cli.Command
	CommandErrorBuffer bytes.Buffer
)
View Source
var OutputFormats = []string{"auto", "explore", "json", "jsonl", "pretty", "raw", "yaml"}

Functions

func ShowJSON

func ShowJSON(res gjson.Result, opts ShowJSONOpts) error

ShowJSON displays a single JSON result to the user.

func ShowJSONIterator

func ShowJSONIterator[T any](iter jsonview.Iterator[T], itemsToDisplay int64, opts ShowJSONOpts) error

ShowJSONIterator displays streamed values. Use -1 for no limit.

func ValidateBaseURL added in v0.3.0

func ValidateBaseURL(value, source string) error

ValidateBaseURL requires an HTTP or HTTPS scheme.

Types

type BodyContentType

type BodyContentType int
const (
	EmptyBody BodyContentType = iota
	MultipartFormEncoded
	ApplicationJSON
	ApplicationOctetStream
)

type FileEmbedStyle

type FileEmbedStyle int
const (
	// EmbedText loads files inline. It base64-encodes binary data.
	EmbedText FileEmbedStyle = iota

	// EmbedIOReader streams binary request bodies through io.Reader.
	EmbedIOReader
)

type FilePathValue added in v0.3.0

type FilePathValue string

FilePathValue marks a path for expansion without an @ prefix.

type ShowJSONOpts added in v0.4.0

type ShowJSONOpts struct {
	ExplicitFormat bool      // true if the user explicitly passed --format
	Format         string    // output format (auto, explore, json, jsonl, pretty, raw, yaml)
	RawOutput      bool      // like jq -r: print strings without JSON quotes
	Stderr         io.Writer // stderr for warnings; injectable for testing; defaults to os.Stderr
	Stdout         *os.File  // stdout (or pager); injectable for testing; defaults to os.Stdout
	Title          string    // display title
	Transform      string    // GJSON path to extract before displaying
}

ShowJSONOpts configures how JSON output is displayed.

Jump to

Keyboard shortcuts

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