Documentation
¶
Index ¶
- func MarshalCompact(v any) ([]byte, error)
- func Products() []string
- type APICall
- type Capabilities
- type CommandSchema
- type CommandSchemaMode
- type Contract
- type ErrorContract
- type Filter
- type IdempotencyContract
- type OutputShape
- type Param
- type PositionalParam
- type ProductSummary
- type ProductSurface
- type ResourceSurface
- type Risk
- type SchemaCapability
- type Support
- type WaitContract
- type WaiterContract
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalCompact ¶
Types ¶
type APICall ¶
type APICall struct {
API string `json:"api"`
Phase string `json:"phase"`
Condition string `json:"condition,omitempty"`
ConditionDescription string `json:"condition_description,omitempty"`
Purpose string `json:"purpose"`
Repeated bool `json:"repeated,omitempty"`
Cached bool `json:"cached,omitempty"`
}
type Capabilities ¶
type Capabilities struct {
SchemaVersion int `json:"schema_version"`
CLI string `json:"cli"`
Surface string `json:"surface"`
OutputModes []string `json:"output_modes"`
Schema SchemaCapability `json:"schema"`
Errors ErrorContract `json:"errors"`
Products []ProductSurface `json:"products"`
}
func CapabilitiesForLanguage ¶
func CapabilitiesForLanguage(lang string) (Capabilities, bool)
type CommandSchema ¶
type CommandSchema struct {
SchemaVersion int `json:"schema_version"`
Command string `json:"command"`
SchemaID string `json:"schema_id,omitempty"`
CLI string `json:"cli,omitempty"`
Usage string `json:"usage,omitempty"`
Kind string `json:"kind"`
Risk Risk `json:"risk"`
Description string `json:"description"`
Positionals []PositionalParam `json:"positionals,omitempty"`
Params map[string]Param `json:"params"`
Filters map[string]Filter `json:"filters,omitempty"`
Examples []string `json:"examples,omitempty"`
Output *OutputShape `json:"output,omitempty"`
Contract *Contract `json:"contract,omitempty"`
APICalls []APICall `json:"api_calls,omitempty"`
}
func Command ¶
func Command(name string) (CommandSchema, bool)
func CommandForLanguage ¶
func CommandForLanguage(name string, lang string) (CommandSchema, bool)
func CommandForLanguageMode ¶
func CommandForLanguageMode(name string, lang string, mode CommandSchemaMode) (CommandSchema, bool)
type CommandSchemaMode ¶
type CommandSchemaMode string
const ( CommandSchemaBrief CommandSchemaMode = "brief" CommandSchemaFull CommandSchemaMode = "full" )
type Contract ¶
type Contract struct {
DryRun Support `json:"dry_run"`
Idempotency IdempotencyContract `json:"idempotency"`
Wait *WaitContract `json:"wait,omitempty"`
}
type ErrorContract ¶
type IdempotencyContract ¶
type OutputShape ¶
type Param ¶
type Param struct {
Type string `json:"type"`
Description string `json:"description,omitempty"`
Required bool `json:"required,omitempty"`
Repeatable bool `json:"repeatable,omitempty"`
Positional bool `json:"positional,omitempty"`
PositionalMany bool `json:"positional_many,omitempty"`
Default any `json:"default,omitempty"`
Input string `json:"input,omitempty"`
Items *Param `json:"items,omitempty"`
Fields map[string]Param `json:"fields,omitempty"`
}
type PositionalParam ¶
type ProductSummary ¶
type ProductSummary struct {
Name string `json:"name"`
Description string `json:"description,omitempty"`
}
func ProductsForLanguage ¶
func ProductsForLanguage(lang string) []ProductSummary
type ProductSurface ¶
type ProductSurface struct {
Product string `json:"product"`
Description string `json:"description,omitempty"`
Resources []ResourceSurface `json:"resources"`
}
func ProductList ¶
func ProductList(product string) (ProductSurface, bool)
func ProductListForLanguage ¶
func ProductListForLanguage(product string, lang string) (ProductSurface, bool)
type ResourceSurface ¶
type ResourceSurface struct {
Product string `json:"product,omitempty"`
Name string `json:"name"`
Parent string `json:"parent,omitempty"`
SchemaID string `json:"schema_id"`
Description string `json:"description,omitempty"`
Actions []string `json:"actions"`
}
func ResourceForLanguage ¶
func ResourceForLanguage(product string, requested string, lang string) (ResourceSurface, bool)
func ResourceForLanguageName ¶
func ResourceForLanguageName(name string, lang string) (ResourceSurface, bool)
type SchemaCapability ¶
type WaitContract ¶
type WaitContract struct {
Waitable bool `json:"waitable"`
NoWaitFlag string `json:"no_wait_flag,omitempty"`
TimeoutFlag string `json:"timeout_flag,omitempty"`
PollCommand string `json:"poll_command,omitempty"`
Waiters []WaiterContract `json:"waiters,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.