cli

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: MIT Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(in io.Reader, out, errOut io.Writer) int

func ExecuteArgs

func ExecuteArgs(args []string, in io.Reader, out, errOut io.Writer) int

func NewRoot

func NewRoot(app *App) *cobra.Command

func Version

func Version() string

Types

type App

type App struct {
	In      io.Reader
	Out     io.Writer
	Err     io.Writer
	Start   time.Time
	Version string
	// contains filtered or unexported fields
}

func NewApp

func NewApp(in io.Reader, out, errOut io.Writer, version string) *App

func (*App) Client

func (a *App) Client(requireAuth bool) (*transport.Client, error)

func (*App) Confirm

func (a *App) Confirm(identifier string) error

func (*App) IdentifierRenderer

func (a *App) IdentifierRenderer() output.Renderer

IdentifierRenderer is the renderer for a create or update: terse identifiers in the default table output, the complete resource under --output json|yaml.

An explicit --query is honoured as written. The operator has already said which fields they want; silently reducing the response first would drop the very keys their expression addresses.

func (*App) Load

func (a *App) Load(requireAuth bool) error

func (*App) Render

func (a *App) Render(value any, response *transport.Response) error

func (*App) RenderMutation

func (a *App) RenderMutation(value any, response *transport.Response) error

RenderMutation renders a create or update response through the identifier renderer.

A --dry-run response is the request envelope, not a resource, so it never goes through the identifier reduction; see render for how the envelope is printed.

func (*App) Renderer

func (a *App) Renderer() output.Renderer

func (*App) Request

func (a *App) Request(ctx context.Context, request transport.Request) (any, *transport.Response, error)

func (*App) ResolvedAPIURL

func (a *App) ResolvedAPIURL() string

ResolvedAPIURL is the base URL requests are actually sent to, after normalization.

It is what `whoami` and `doctor` report, because the value in the profile is what the operator typed and the resolved value is what the client calls. QA lost time to a profile that displayed one host while requests went to another.

Jump to

Keyboard shortcuts

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