Documentation
¶
Index ¶
- func Client() *okms.Client
- func CompleteKeyIDArgs(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func CompleteKeyIDAt(position int) cobra.CompletionFunc
- func CompleteKeyIDAtFiltered(position int, filter KeyFilter) cobra.CompletionFunc
- func CompleteKeyIDs(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func CompleteKeyIDsFiltered(filter KeyFilter) cobra.CompletionFunc
- func GetOkmsId() uuid.UUID
- func InitClient(cmd *cobra.Command)
- func SetupRestApiFlags(command *cobra.Command, cust CustomizeFunc)
- type CustomizeFunc
- type KeyFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompleteKeyIDArgs ¶ added in v0.6.0
func CompleteKeyIDArgs(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CompleteKeyIDArgs is like CompleteKeyIDs, but it does not suggest the key IDs already given in args. It is meant for commands accepting several KEY-ID arguments, such as `keys delete`.
func CompleteKeyIDAt ¶ added in v0.6.0
func CompleteKeyIDAt(position int) cobra.CompletionFunc
CompleteKeyIDAt returns a completion function suggesting key IDs only when completing the argument at the given position (0 based). The completion of the other arguments falls back to the default behavior (file completion).
func CompleteKeyIDAtFiltered ¶ added in v0.6.0
func CompleteKeyIDAtFiltered(position int, filter KeyFilter) cobra.CompletionFunc
CompleteKeyIDAtFiltered is like CompleteKeyIDAt, but only suggests the keys accepted by filter. It is meant for commands that only accept a subset of the keys, such as `keys export`, which exports public key material by default but requires an extractable key to export key material in wrapped form.
func CompleteKeyIDs ¶ added in v0.6.0
func CompleteKeyIDs(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
CompleteKeyIDs is a completion function suggesting the IDs of the domain keys. It can be used as a ValidArgsFunction, or registered as a flag completion function with RegisterFlagCompletionFunc.
func CompleteKeyIDsFiltered ¶ added in v0.6.0
func CompleteKeyIDsFiltered(filter KeyFilter) cobra.CompletionFunc
CompleteKeyIDsFiltered is like CompleteKeyIDs, but only suggests the keys accepted by filter.
func InitClient ¶ added in v0.6.0
InitClient makes sure the REST API client is initialized from the command flags and the configuration file. Shell completion functions are executed before the PersistentPreRun hook that normally builds the client, so they must call InitClient first.
func SetupRestApiFlags ¶
func SetupRestApiFlags(command *cobra.Command, cust CustomizeFunc)
Types ¶
type KeyFilter ¶ added in v0.6.0
type KeyFilter func(*types.GetServiceKeyResponse) bool
KeyFilter restricts the keys suggested by the key ID completion functions. A nil KeyFilter suggests all the keys.