cmd

package
v0.18.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const Version = "0.18.0" // 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(out *os.File, stderr io.Writer, title string, res gjson.Result, format string, explicitFormat bool, transform string) error

Display JSON to the user in various different formats. The explicitFormat parameter indicates whether the format was explicitly set by the user (via --format), which controls whether we silently fall back to json when explore is requested on non-terminal output. Warnings are written to stderr.

func ShowJSONIterator

func ShowJSONIterator[T any](stdout *os.File, stderr io.Writer, title string, iter jsonview.Iterator[T], format string, explicitFormat bool, transform string, itemsToDisplay int64) error

For an iterator over different value types, display its values to the user in different formats. -1 is used to signal no limit of items to display

func ValidateBaseURL

func ValidateBaseURL(value, source string) error

ValidateBaseURL checks that a base URL is correctly prefixed with a protocol scheme and produces a better error message than the person would see otherwise if it doesn't.

Types

type BodyContentType

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

type FileEmbedStyle

type FileEmbedStyle int
const (
	EmbedText FileEmbedStyle = iota
	EmbedIOReader
)

type FilePathValue

type FilePathValue string

FilePathValue is a string wrapper that marks a value as a file path whose contents should be read and embedded in the request. Unlike a regular string, embedFilesValue always treats a FilePathValue as a file path without needing the "@" prefix.

Source Files

Jump to

Keyboard shortcuts

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