Documentation
¶
Index ¶
- Constants
- Variables
- func CheckIfEmpty(parameter string) error
- func CheckIfNilOrEmpty(parameter *string) bool
- func ConfigureLogging(logLevel string, logFormat string)
- func ConfigureLoggingFromEnvOnce()
- func ConfirmAction(message string) (bool, error)
- func CrashLogPath() string
- func CutString(str string, length int) string
- func EnsureCursorRestoration()
- func FormatJSON(data interface{}) (string, error)
- func FromInt64Ptr(val *int64) *int
- func FromPtr[T any](ref *T) T
- func FromPtrOrDefault[T any](ref *T, defaultVal T) T
- func GetFirstDifferentSegmentInFilePaths(targetPath string, comparisonPaths []string) string
- func GetSupportedFilterKeys[T any](obj T) (supportedFilterKeys []string)
- func HandlePanic()
- func HandleSpinnerError(spinner *Spinner, sm SpinnerManager, err error)
- func HandleSpinnerSuccess(spinner *Spinner, sm SpinnerManager, message string)
- func HashSha256(source string) (hash string)
- func MatchesFilters[T any](obj T, filterMaps []map[string]string) (matches bool, err error)
- func ParseCommaSeparatedList(input string) []string
- func ParseDeploymentTarget(text string) (provider, region string, ok bool)
- func ParseFilters(filters []string, supportedFilterKeys []string) (filterMaps []map[string]string, err error)
- func PrintError(err error)
- func PrintInfo(msg string)
- func PrintJSON(res interface{})
- func PrintSuccess(msg string)
- func PrintTable(jsonData []string) (err error)
- func PrintText(data []string) (err error)
- func PrintTextTableJsonArrayOutput[T any](output string, objects []T) error
- func PrintTextTableJsonOutput[T any](output string, object T) error
- func PrintTextTableYamlOutput[T any](object T) error
- func PrintURL(label, url string)
- func PrintWarning(msg string)
- func PromptInput(title, placeholder string, validate func(string) error) (string, error)
- func PromptPassword(title, placeholder string) (string, error)
- func PromptSelect(title string, options []string) (string, error)
- func ReadFile(filePath string) ([]byte, error)
- func RenderRegionGlobe(region string, width int, blinkOn bool) string
- func RenderRegionGlobeWithProvider(provider, region string, width int, blinkOn bool) string
- func ReplaceBuildContext(input string, dockerPathsToImageUrls map[string]string) string
- func ToPtr[T any](value T) *T
- func TruncateString(str string, num int) string
- func ValidateEmail(input string) error
- func WriteYAMLToFile[T any](filePath string, object T) error
- type InteractiveListConfig
- type InteractiveListItem
- type Spinner
- type SpinnerManager
- type Table
Constants ¶
const (
// RegionGlobePulseFrames controls how many spinner ticks pass before the marker changes intensity.
RegionGlobePulseFrames = 8
)
Variables ¶
var (
LastPrintedString string
)
Functions ¶
func CheckIfEmpty ¶
func CheckIfNilOrEmpty ¶
func ConfigureLogging ¶
func ConfigureLoggingFromEnvOnce ¶
func ConfigureLoggingFromEnvOnce()
func ConfirmAction ¶ added in v0.14.18
ConfirmAction displays a Yes/No confirmation prompt and returns true if the user selects Yes.
func CrashLogPath ¶ added in v1.2.16
func CrashLogPath() string
CrashLogPath returns the path to the crash log file.
func EnsureCursorRestoration ¶ added in v1.0.34
func EnsureCursorRestoration()
EnsureCursorRestoration forces cursor restoration - should be called in cleanup
func FormatJSON ¶ added in v0.14.18
FormatJSON formats an interface{} as pretty-printed JSON
func FromInt64Ptr ¶
FromInt64Ptr converts int64 pointer to int pointer
func FromPtrOrDefault ¶
func FromPtrOrDefault[T any](ref *T, defaultVal T) T
func GetFirstDifferentSegmentInFilePaths ¶
GetFirstDifferentSegmentInFilePaths finds the first different segment between targetPath and each path in comparisonPaths. If no difference is found, it returns the last segment of targetPath.
func GetSupportedFilterKeys ¶
func HandlePanic ¶ added in v1.2.16
func HandlePanic()
HandlePanic should be deferred at the top of the program entry point. It recovers from panics, writes a crash log, restores the terminal, and exits.
func HandleSpinnerError ¶
func HandleSpinnerError(spinner *Spinner, sm SpinnerManager, err error)
func HandleSpinnerSuccess ¶
func HandleSpinnerSuccess(spinner *Spinner, sm SpinnerManager, message string)
func HashSha256 ¶ added in v0.14.27
HashSha256 returns the SHA256 hash of the given string. This is used to hash file contents or other strings for integrity checks. Not used for password hashing.
func MatchesFilters ¶
func ParseCommaSeparatedList ¶ added in v0.14.18
ParseCommaSeparatedList parses a comma-separated string into a slice of strings
func ParseDeploymentTarget ¶ added in v1.6.8
ParseDeploymentTarget extracts cloud provider and region from deploy progress text.
func ParseFilters ¶
func PrintError ¶
func PrintError(err error)
func PrintSuccess ¶
func PrintSuccess(msg string)
func PrintTable ¶
func PrintTextTableYamlOutput ¶ added in v0.14.18
func PrintWarning ¶
func PrintWarning(msg string)
func PromptInput ¶ added in v1.2.7
PromptInput displays a text input prompt with optional validation.
func PromptPassword ¶ added in v1.2.7
PromptPassword displays a masked password input prompt.
func PromptSelect ¶ added in v1.2.7
PromptSelect displays a selection prompt and returns the chosen option.
func RenderRegionGlobe ¶ added in v1.6.8
RenderRegionGlobe renders a compact globe with a highlighted deployment region.
func RenderRegionGlobeWithProvider ¶ added in v1.6.8
RenderRegionGlobeWithProvider renders a compact globe with cloud provider and deployment region labels.
func ReplaceBuildContext ¶
func TruncateString ¶
func ValidateEmail ¶ added in v1.2.7
ValidateEmail returns a validation function that checks for a valid email address.
func WriteYAMLToFile ¶ added in v0.14.18
Types ¶
type InteractiveListConfig ¶ added in v1.2.7
type InteractiveListConfig struct {
Title string
Items []InteractiveListItem
OnSelect func(item InteractiveListItem) error
ShowJSON bool
}
InteractiveListConfig configures the interactive list behavior.
type InteractiveListItem ¶ added in v1.2.7
type InteractiveListItem struct {
// contains filtered or unexported fields
}
InteractiveListItem represents a single item in the interactive list.
func NewInteractiveListItem ¶ added in v1.2.7
func NewInteractiveListItem(name, description, id, status string, rawJSON json.RawMessage) InteractiveListItem
NewInteractiveListItem creates a new list item from structured data.
func RunInteractiveList ¶ added in v1.2.7
func RunInteractiveList(cfg InteractiveListConfig) (*InteractiveListItem, error)
RunInteractiveList launches an interactive list TUI. Returns the selected item or nil if cancelled.
func (InteractiveListItem) Description ¶ added in v1.2.7
func (i InteractiveListItem) Description() string
func (InteractiveListItem) FilterValue ¶ added in v1.2.7
func (i InteractiveListItem) FilterValue() string
func (InteractiveListItem) ID ¶ added in v1.2.7
func (i InteractiveListItem) ID() string
func (InteractiveListItem) JSONData ¶ added in v1.2.7
func (i InteractiveListItem) JSONData() string
func (InteractiveListItem) Status ¶ added in v1.2.7
func (i InteractiveListItem) Status() string
func (InteractiveListItem) Title ¶ added in v1.2.7
func (i InteractiveListItem) Title() string
type Spinner ¶ added in v1.2.7
type Spinner struct {
// contains filtered or unexported fields
}
Spinner is a handle to a single spinner entry in a SpinnerManager.
func (*Spinner) Complete ¶ added in v1.2.7
func (s *Spinner) Complete()
Complete marks the spinner as successfully completed.
func (*Spinner) Error ¶ added in v1.2.7
func (s *Spinner) Error()
Error marks the spinner as failed.
func (*Spinner) UpdateMessage ¶ added in v1.2.7
UpdateMessage changes the spinner's display message.
type SpinnerManager ¶ added in v1.2.7
SpinnerManager manages one or more spinners rendered inline in the terminal.
func NewSpinnerManager ¶ added in v1.2.7
func NewSpinnerManager() SpinnerManager
NewSpinnerManager creates a new SpinnerManager backed by a bubbletea program.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table wraps a bubbles table for rendering structured data.
func NewTableFromJSONTemplate ¶
func NewTableFromJSONTemplate(data json.RawMessage) (t *Table, err error)
func (*Table) AddRowFromJSON ¶
func (t *Table) AddRowFromJSON(data json.RawMessage) error