internal

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package internal provides shared utilities for CLI commands.

Index

Constants

View Source
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

func AzureAppConfigStore(ctx context.Context) (provider.Store, error)

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

func AzureKeyVaultStore(ctx context.Context) (provider.Store, error)

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

func CommandNotFound(_ context.Context, cmd *cli.Command, command string)

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

func GoogleCloudSecretStore(ctx context.Context) (provider.Store, error)

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

func ParamStore(ctx context.Context) (provider.Store, error)

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

func SecretStore(ctx context.Context) (provider.Store, error)

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

func WithAzureStoreName(ctx context.Context, storeName string) context.Context

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

func WithAzureVaultName(ctx context.Context, vaultName string) context.Context

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

func WithGoogleCloudProject(ctx context.Context, project string) context.Context

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.

func WithPager added in v0.8.0

func WithPager(cmd *cli.Command, noPager bool, fn func(stdout, stderr io.Writer) error) error

WithPager runs fn with the root command's stdout routed through the pager (unless noPager is set) and the root command's stderr. It centralizes the writer wiring shared by the paging commands so call sites only construct their Runner and invoke it.

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).

Jump to

Keyboard shortcuts

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