# Functions
AddAuth registers a new named auth handler.
AddContentType adds a new content type marshaller with the given default content type name and q factor (0-1.0, higher has priority).
AddEncoding adds a new content encoding with the given name.
AddGlobalFlag will make a new global flag on the root command.
AddLinkParser adds a new link parser to create standardized link relation objects on a parsed response.
AddLoader adds a new API spec loader to the CLI.
BestEffortSystemCertPool returns system cert pool as best effort, otherwise an empty cert pool.
CachedTransport returns an HTTP transport with caching abilities.
DecodeResponse will replace the response body with a decoding reader if needed.
Defaults adds the default encodings, content types, and link parsers to the CLI.
FixAddress can convert `:8000` or `example.com` to a full URL.
GetBody returns the request body if one was passed either as shorthand arguments or via stdin.
GetExitCode returns the exit code to use based on the last HTTP status code.
GetLastStatus returns the last HTTP status code returned by a request.
GetParsedResponse makes a request and gets the parsed response back.
Highlight a block of data with the given lexer.
IgnoreCLIParams only applies the profile, but ignores commandline and env params.
IgnoreStatus ignores the response status code.
Init will set up the CLI.
InvalidateCachedTransport returns an HTTP transport which will not read cached items (it deletes them) and then refreshes the cache when new items are fetched.
Load will hydrate the command tree for an API, possibly refreshing the API spec if the cache is out of date.
LogDebug logs a debug message if --rsh-verbose (-v) was passed.
LogDebugRequest logs the request in a debug message if verbose output is enabled.
LogDebugResponse logs the response in a debug message if verbose output is enabled.
LogError logs an error message.
LogInfo logs an info message.
LogWarning logs a warning message.
MakeRequest makes an HTTP request using the default client.
MakeRequestAndFormat is a convenience function for calling `GetParsedResponse` and then calling the default formatter's `Format` function with the parsed response.
Marshal a value to the given content type, e.g.
MarshalReadable marshals a value into a human-friendly readable format.
MarshalShort marshals a value given a short name, e.g.
MinCachedTransport returns an HTTP transport with caching abilities and a minimum cache duration for any responses if no cache headers are set.
NewDefaultFormatter creates a new formatted with autodetected TTY capabilities.
NewPathBuffer creates a new path buffer with the given underlying initial data loaded into it.
ParseLinks uses all registered LinkParsers to parse links for a response.
ParseResponse takes an HTTP response and tries to parse it using the registered content types.
Run the CLI! Parse arguments, make requests, print responses.
Unmarshal raw data from the given content type into a value.
WithClient sets the client to use for the request.
WithoutLog disabled debug logging for the given request/response.
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
StyleForm corresponds to OpenAPI 3 form parameters.
StyleSimple corresponds to OpenAPI 3 simple parameters.
# Variables
Cache is used to store temporary data between runs.
DisplayRanges includes all viewable Unicode characters along with white space.
Formatter is the currently configured response output formatter.
GlobalFlags contains all the fixed up front flags This allows us to parse them before we hand over control to cobra.
No description provided by the author
ReadableLexer colorizes the output of the Readable marshaller.
Root command (entrypoint) of the CLI.
SchemaLexer colorizes schema output.
Stderr is a cross-platform, color-safe writer if colors are enabled, otherwise it defaults to `os.Stderr`.
Stdin represents the command input, which defaults to os.Stdin.
Stdout is a cross-platform, color-safe writer if colors are enabled, otherwise it defaults to `os.Stdout`.
# Structs
API represents an abstracted API description used to build CLI commands around available resources, operations, and links.
APIAuth describes the auth type and parameters for an API.
APIConfig describes per-API configuration options like the base URI and auth scheme, if any.
APIProfile contains account-specific API information.
AuthParam describes an auth input parameter for an AuthHandler.
AutoConfig holds an API's automatic configuration settings for the CLI.
AutoConfigVar represents a variable given by the user when prompted during auto-configuration setup of an API.
BasicAuth implements HTTP Basic authentication.
BrotliEncoding supports RFC 7932 Brotli content encoding.
CBOR describes content types like `application/cbor` or `application/foo+cbor`.
DefaultFormatter can apply JMESPath queries and can output prettyfied JSON and YAML output.
DeflateEncoding supports gzip-encoded response content.
ExternalToolAuth defers authentication to a third party tool.
Gron describes an output format for easier grepping.
GzipEncoding supports gzip-encoded response content.
HALParser parses HAL hypermedia links.
Ion describes content types like `application/ion`.
JSON describes content types like `application/json` or `application/problem+json`.
JSONAPIParser parses JSON:API hypermedia links.
Link describes a hypermedia link to another resource.
LinkHeaderParser parses RFC 5988 HTTP link relation headers.
MsgPack describes content types like `application/msgpack` or `application/foo+msgpack`.
Operation represents an API action, e.g.
Param represents an API operation input parameter.
PathBuffer builds up a path string from multiple parts.
Readable describes a readable marshaller.
Request is used to exchange requests with the external tool.
Response describes a parsed HTTP response which can be marshalled to enable printing and filtering/projection.
SirenParser parses Siren hypermedia links.
Table describes an output format for terminal tables.
TerrificallySimpleJSONParser parses `self` links from JSON-like formats.
Text describes content types like `text/plain` or `text/html`.
TLSConfig contains the TLS setup for the HTTP client.
YAML describes content types like `application/yaml` or `application/foo+yaml`.
# Interfaces
AuthHandler is used to register new authentication handlers that will apply auth to an outgoing request as needed.
ContentEncoding is used to encode/decode content for transfer over the wire, for example with gzip.
ContentType is used to marshal/unmarshal data to various formats.
LinkParser parses link relationships in a response.
Loader is used to detect and load an API spec, turning it into CLI commands.
PrettyMarshaller describes an optional method that ContentTypes can implement to provide nicer output for humans.
ResponseFormatter will filter, prettify, and print out the results of a call.