Documentation
¶
Overview ¶
Package internal provides shared utilities for CLI commands.
Index ¶
- Constants
- func AzureAppConfigParamStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
- func AzureAppConfigStagingScopeResolver(ctx context.Context) (staging.ResolvedScope, error)
- func AzureAppConfigStore(ctx context.Context) (provider.Store, error)
- func AzureKeyVaultSecretStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
- func AzureKeyVaultStagingScopeResolver(ctx context.Context) (staging.ResolvedScope, error)
- func AzureKeyVaultStore(ctx context.Context) (provider.Store, error)
- func CommandNotFound(_ context.Context, cmd *cli.Command, command string)
- func GoogleCloudSecretStore(ctx context.Context) (provider.Store, error)
- func GoogleCloudSecretStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
- func GoogleCloudStagingScopeResolver(ctx context.Context) (staging.ResolvedScope, error)
- func ParamStore(ctx context.Context) (provider.Store, error)
- func ParamStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
- func SecretStore(ctx context.Context) (provider.Store, error)
- func SecretStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
- func WithAzureStoreName(ctx context.Context, storeName string) context.Context
- func WithAzureVaultName(ctx context.Context, vaultName string) context.Context
- func WithGoogleCloudProject(ctx context.Context, project string) context.Context
- func WithPager(cmd *cli.Command, noPager bool, fn func(stdout, stderr io.Writer) error) error
Constants ¶
const CommandNotFoundExitCode = 1
CommandNotFoundExitCode is the process exit code produced for an unknown command. urfave/cli's CommandNotFound hook is a void func, so Command.Run returns nil after it runs and the process would otherwise exit 0 — making scripts/CI treat typos as success. The handlers exit non-zero explicitly.
Variables ¶
This section is empty.
Functions ¶
func AzureAppConfigParamStrategyFactory ¶ added in v0.8.1
func AzureAppConfigParamStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
AzureAppConfigParamStrategyFactory builds a staging FullStrategy for Azure App Configuration, wrapping a provider.Store resolved for the context's store. It satisfies staging.StrategyFactory.
func AzureAppConfigStagingScopeResolver ¶ added in v0.8.1
func AzureAppConfigStagingScopeResolver(ctx context.Context) (staging.ResolvedScope, error)
AzureAppConfigStagingScopeResolver resolves the Azure App Configuration staging scope from the store name stashed in the context (see WithAzureStoreName). It performs no network calls.
func AzureAppConfigStore ¶ added in v0.8.0
AzureAppConfigStore resolves a provider.Store for the Azure App Configuration (param) service. The store name is read from the context (see WithAzureStoreName); it returns a clear error when no store name was resolved.
func AzureKeyVaultSecretStrategyFactory ¶ added in v0.8.1
func AzureKeyVaultSecretStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
AzureKeyVaultSecretStrategyFactory builds a staging FullStrategy for Azure Key Vault secrets, wrapping a provider.Store resolved for the context's vault. It satisfies staging.StrategyFactory.
func AzureKeyVaultStagingScopeResolver ¶ added in v0.8.1
func AzureKeyVaultStagingScopeResolver(ctx context.Context) (staging.ResolvedScope, error)
AzureKeyVaultStagingScopeResolver resolves the Azure Key Vault staging scope from the vault name stashed in the context (see WithAzureVaultName). It performs no network calls.
func AzureKeyVaultStore ¶ added in v0.8.0
AzureKeyVaultStore resolves a provider.Store for the Azure Key Vault (secret) service. The vault name is read from the context (see WithAzureVaultName); it returns a clear error when no vault name was resolved.
func CommandNotFound ¶
CommandNotFound is a shared handler for unknown subcommands. It displays the command help and an error message, then exits non-zero.
func GoogleCloudSecretStore ¶ added in v0.8.1
GoogleCloudSecretStore resolves a provider.Store for the Google Cloud Secret Manager service. The project id is read from the context (see WithGoogleCloudProject); it returns a clear error when no project could be resolved.
func GoogleCloudSecretStrategyFactory ¶ added in v0.8.1
func GoogleCloudSecretStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
GoogleCloudSecretStrategyFactory builds a staging FullStrategy for Google Cloud Secret Manager, wrapping a provider.Store resolved for the context's project. It satisfies staging.StrategyFactory.
func GoogleCloudStagingScopeResolver ¶ added in v0.8.1
func GoogleCloudStagingScopeResolver(ctx context.Context) (staging.ResolvedScope, error)
GoogleCloudStagingScopeResolver resolves the Google Cloud staging scope from the project stashed in the context (see WithGoogleCloudProject). It performs no network calls. It satisfies staging.ScopeResolver.
func ParamStore ¶ added in v0.8.0
ParamStore resolves a provider.Store for the parameter service via the registry (AWS by default).
func ParamStrategyFactory ¶ added in v0.8.0
func ParamStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
ParamStrategyFactory builds a staging FullStrategy for the parameter service, wrapping a provider.Store resolved through the registry. It satisfies staging.StrategyFactory.
func SecretStore ¶ added in v0.8.0
SecretStore resolves a provider.Store for the secret service via the registry (AWS by default).
func SecretStrategyFactory ¶ added in v0.8.0
func SecretStrategyFactory(ctx context.Context) (staging.FullStrategy, error)
SecretStrategyFactory builds a staging FullStrategy for the secret service, wrapping a provider.Store resolved through the registry. It satisfies staging.StrategyFactory.
func WithAzureStoreName ¶ added in v0.8.0
WithAzureStoreName returns a context carrying the resolved Azure App Configuration store name, merged onto any base scope already present. The azure param subgroup's Before hook sets it (from --store-name or its env fallback).
func WithAzureVaultName ¶ added in v0.8.0
WithAzureVaultName returns a context carrying the resolved Azure Key Vault name, merged onto any base scope already present. The azure secret subgroup's Before hook sets it (from --vault-name or its env fallback).
func WithGoogleCloudProject ¶ added in v0.8.1
WithGoogleCloudProject returns a context carrying the resolved Google Cloud project id. The gcloud command group sets it once (from --project or the GOOGLE_CLOUD_PROJECT env) so every gcloud subcommand can resolve a store without threading the flag through the generic command Config.
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package apptest provides helpers for constructing the CLI app with a deterministic provider-detection result, so command tests do not depend on the ambient environment (which decides the top-level param/secret aliases).
|
Package apptest provides helpers for constructing the CLI app with a deterministic provider-detection result, so command tests do not depend on the ambient environment (which decides the top-level param/secret aliases). |