Documentation
¶
Overview ¶
Package util provides shared utilities for provider implementations. Includes helpers for prompting users, checking environment variables, and validating token formats.
Index ¶
- func CheckEnvVarWithName(names ...string) (value, name string)
- func CheckEnvVars(names ...string) string
- func Confirm(prompt string) (bool, error)
- func PromptForChoice(prompt string, options []string) (int, error)
- func PromptForToken(prompt string) (string, error)
- func ValidateTokenLength(token string, minLen int, tokenType string) error
- func ValidateTokenPrefix(token, prefix, tokenType string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckEnvVarWithName ¶
CheckEnvVarWithName returns the value and name of the first non-empty env var. Returns empty strings if none are set.
func CheckEnvVars ¶
CheckEnvVars returns the value of the first non-empty environment variable. Returns empty string if none are set.
func PromptForChoice ¶
PromptForChoice displays options and returns the selected index (0-based). Returns -1 and error if input is invalid.
func PromptForToken ¶
PromptForToken prompts the user for a token with the given message. Input is hidden (not echoed to terminal).
func ValidateTokenLength ¶
ValidateTokenLength checks that a token has a minimum length.
func ValidateTokenPrefix ¶
ValidateTokenPrefix checks that a token has an expected prefix.
Types ¶
This section is empty.