util

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package util provides shared utilities for provider implementations. Includes helpers for prompting users, checking environment variables, and validating token formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckEnvVarWithName

func CheckEnvVarWithName(names ...string) (value, name string)

CheckEnvVarWithName returns the value and name of the first non-empty env var. Returns empty strings if none are set.

func CheckEnvVars

func CheckEnvVars(names ...string) string

CheckEnvVars returns the value of the first non-empty environment variable. Returns empty string if none are set.

func Confirm

func Confirm(prompt string) (bool, error)

Confirm prompts for yes/no confirmation. Returns true for yes.

func PromptForChoice

func PromptForChoice(prompt string, options []string) (int, error)

PromptForChoice displays options and returns the selected index (0-based). Returns -1 and error if input is invalid.

func PromptForToken

func PromptForToken(prompt string) (string, error)

PromptForToken prompts the user for a token with the given message. Input is hidden (not echoed to terminal).

func ValidateTokenLength

func ValidateTokenLength(token string, minLen int, tokenType string) error

ValidateTokenLength checks that a token has a minimum length.

func ValidateTokenPrefix

func ValidateTokenPrefix(token, prefix, tokenType string) error

ValidateTokenPrefix checks that a token has an expected prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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