openapi

package
v0.1.98 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(data map[string]interface{}, opts OutputOptions) error

Print applies --query then rows= (if set) and renders the result.

func RefreshServiceDescs

func RefreshServiceDescs(root *cobra.Command)

RefreshServiceDescs updates the Short description of every dynamically-registered API command to match the current language. Called from SetHelpFunc when --language overrides the active language at help-render time.

func RegisterCommands

func RegisterCommands(root *cobra.Command)

RegisterCommands dynamically adds one cobra.Command per service (from products.json), each with sub-commands for every API action found across all module JSON files.

Types

type Invoker

type Invoker struct {
	// contains filtered or unexported fields
}

Invoker executes a single BCE API call.

func NewInvoker

func NewInvoker(
	profile *config.Profile,
	api *meta.Api,
	params map[string]string,
	overrides *config.FlagOverrides,
	product *meta.Product,
) (*Invoker, error)

NewInvoker creates an Invoker, resolving the endpoint from overrides > profile > product metadata.

func (*Invoker) Call

func (inv *Invoker) Call() (map[string]interface{}, error)

Call executes the API request and returns the parsed JSON response.

type OutputFormat

type OutputFormat string
const (
	FormatJSON  OutputFormat = "json"
	FormatTable OutputFormat = "table"
	FormatText  OutputFormat = "text"
)

type OutputOptions

type OutputOptions struct {
	Format  OutputFormat
	Query   string   // --query: JMESPath applied first to the raw response
	Rows    string   // rows=: JMESPath applied after Query for table row extraction
	Cols    []string // column names for table output
	NoColor bool
}

OutputOptions configures response rendering.

Jump to

Keyboard shortcuts

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