namedargs

package
v3.28.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get added in v3.19.0

func Get[T any](provider resolver.CachingResolutionProvider[T], exec commands.Executor, arg string) (T, error)

Resolve initializes given resolution provider, uses it to resolve given argument, and returns the cached resource.

func GetStorage added in v3.19.0

func GetStorage(exec commands.Executor, arg string) (upcloud.Storage, error)

GetStorage finds storage based on values provided to named args (e.g., --storage storage-name)

func Resolve

func Resolve(provider resolver.ResolutionProvider, exec commands.Executor, arg string) (string, error)

Resolve initializes given resolution provider and uses it to resolve given argument

func ResolveNetwork

func ResolveNetwork(exec commands.Executor, arg string) (string, error)

ResolveNetwork resolves network UUID from values provided to named args (e.g., --network net-name)

func ResolveServer

func ResolveServer(exec commands.Executor, arg string) (string, error)

ResolveServer resolves server UUID from values provided to named args (e.g., --server server-name)

func ValidValuesHelp added in v3.16.0

func ValidValuesHelp(values ...string) string

ValidValuesHelp wraps values in backticks and adds human readable separators. For example, "`one`, `two` and `three`".

func ZoneDescription

func ZoneDescription(resource string) string

Returns description for --zone argument, e.g. "Zone where to create the resource...".

Types

type CompleteFunc

type CompleteFunc func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

func CompletionFunc

func CompletionFunc(provider completion.Provider, cfg *config.Config) CompleteFunc

CompletionFunc creates a flag completion function from given completion provider and config to be passed to Cobra via Command.RegisterFlagCompletionFunc

Jump to

Keyboard shortcuts

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