common

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Client

func Client() *okms.Client

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 GetOkmsId added in v0.4.0

func GetOkmsId() uuid.UUID

func InitClient added in v0.6.0

func InitClient(cmd *cobra.Command)

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 CustomizeFunc

type CustomizeFunc func(c *cobra.Command) func(*okms.Client)

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.

Jump to

Keyboard shortcuts

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