Documentation
¶
Index ¶
- Constants
- func AbortUploadSession(ctx context.Context, c *client.Client, kind, sessionID string)
- func AllowPrompt(cmd *cobra.Command) bool
- func AppendQuery(path string, extra url.Values) string
- func ApplyPaginationParams(cmd *cobra.Command, path string, p ListParams) (string, error)
- func AssumeYes(cmd *cobra.Command) bool
- func ClientFromCommand(cmd *cobra.Command) (*client.Client, error)
- func ConfirmOrCancel(cmd *cobra.Command, opts ConfirmOptions) (bool, error)
- func DecodeJSON(resp *http.Response, out any) error
- func EffectiveLimit(cmd *cobra.Command, resource, flagName string, flagValue, fallbackDefault int) int
- func EnsureSuccessStatus(resp *http.Response) error
- func EnumVarP[T ~string](cmd *cobra.Command, flags *pflag.FlagSet, p *T, name, shorthand string, ...)
- func ExclusiveFlags(cmd *cobra.Command, names ...string) error
- func JSONOutputEnabled(cmd *cobra.Command) bool
- func LooksLikeIDPrefix(identifierLower string) bool
- func PrintJSON(v any) error
- func PrintRawJSON(body []byte) error
- func PrintTable(cmd *cobra.Command, headers []string, rows [][]string, ...) error
- func ReadJSONBody(resp *http.Response) ([]byte, error)
- func Run[T any](cmd *cobra.Command, c *client.Client, spec Spec[T]) error
- func RunDelete(cmd *cobra.Command, c *client.Client, spec DeleteSpec) error
- func RunEnvironments(cmd *cobra.Command, args []string, run func(*cobra.Command, []string) error, ...) error
- func RunList[T any](cmd *cobra.Command, c *client.Client, spec ListSpec[T]) error
- func RunMerged(cmd *cobra.Command, args []string, run func(*cobra.Command, []string) error) error
- func RunScoped(cmd *cobra.Command, args []string, run func(*cobra.Command, []string) error) error
- func Scope(cmd *cobra.Command) string
- func SetResource[D, S any](ref ResourceRef[D, S], commands ...*cobra.Command)
- func SetScope(scope string, commands ...*cobra.Command)
- func UnauthClientFromCommand(cmd *cobra.Command) (*client.Client, error)
- func UploadFileInChunks(ctx context.Context, c *client.Client, kind, filePath string, ...) (string, error)
- type ConfirmOptions
- type DeleteSpec
- type EnumValue
- type HTTPStatusError
- type ListParams
- type ListSpec
- type ResourceRef
- type Spec
- type TableSummary
Constants ¶
View Source
const ( ShowAllLimit = -1 AllFlagUsage = "Return every item, ignoring pagination" StartFlagUsage = "Offset for pagination (rounded down to a multiple of --limit on database-backed resources)" )
View Source
const ( ScopeRead = "read" ScopeMerged = "merged" ScopeAll = "all" ScopeDestination = "destination" ScopeResource = "resource" ScopeGlobal = "global" )
View Source
const (
MaxPromptOptions = 20
)
Variables ¶
This section is empty.
Functions ¶
func AbortUploadSession ¶
func AllowPrompt ¶
func ApplyPaginationParams ¶
func ConfirmOrCancel ¶
func ConfirmOrCancel(cmd *cobra.Command, opts ConfirmOptions) (bool, error)
func EffectiveLimit ¶
func EnsureSuccessStatus ¶
func EnumVarP ¶
func EnumVarP[T ~string](cmd *cobra.Command, flags *pflag.FlagSet, p *T, name, shorthand string, value T, usage string, allowed ...T)
The empty value is always allowed as unset; invalid nonempty defaults panic.
func JSONOutputEnabled ¶
Runtime JSON mode includes --output json, even when --json is explicitly false.
func LooksLikeIDPrefix ¶
func PrintRawJSON ¶
func PrintTable ¶
func RunEnvironments ¶
func SetResource ¶
func SetResource[D, S any](ref ResourceRef[D, S], commands ...*cobra.Command)
func UnauthClientFromCommand ¶
Types ¶
type ConfirmOptions ¶
type DeleteSpec ¶
type HTTPStatusError ¶
func (*HTTPStatusError) Error ¶
func (e *HTTPStatusError) Error() string
type ListParams ¶
type ResourceRef ¶
type ResourceRef[D any, S any] struct { GetPath func(envID, identifier string) string ListPath func(envID string) string SearchCandidates func(context.Context, *client.Client, string) ([]S, error) SelectCandidate func([]S, string, bool) (*S, error) Validate func(D, string) error Matches func(item S, identifierLower, original string) bool Label func(S) string Promote func(S) *D IDOf func(S) string IdentifierOf func(D) string Exact func(item S, identifierLower, original string) bool Singular string Plural string IDHint string ListCmd string EnvironmentScoped bool }
D is the detail shape and S is the list summary.
type TableSummary ¶
Click to show internal directories.
Click to hide internal directories.