utils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForExit

func CheckForExit() bool

CheckForExit checks if the user wants to exit (simplified)

func ClearScreen

func ClearScreen()

ClearScreen clears the terminal screen

func Colorize

func Colorize(text string, colorType string) string

Colorize adds color to text based on type

func ConfirmAction

func ConfirmAction(message string) bool

ConfirmAction asks for user confirmation

func Contains

func Contains(slice []string, item string) bool

Contains checks if a slice contains a string

func CreateTable

func CreateTable(headers []string, rows [][]string)

CreateTable creates a formatted table

func DisplayResponse

func DisplayResponse(data interface{}, format string) error

DisplayResponse displays a response in the specified format

func FormatBytes

func FormatBytes(bytes int64) string

FormatBytes formats bytes into human-readable format

func FormatDuration

func FormatDuration(d time.Duration) string

FormatDuration formats duration into human-readable format

func GetEnvWithDefault

func GetEnvWithDefault(key, defaultValue string) string

GetEnvWithDefault gets an environment variable with a default value

func GetUserInput

func GetUserInput(prompt string) (string, error)

GetUserInput gets user input with a prompt

func InitializeLogging

func InitializeLogging(verbose bool) error

InitializeLogging initializes the logging system

func IsValidURL

func IsValidURL(url string) bool

IsValidURL checks if a string is a valid URL

func JoinArgs

func JoinArgs(args []string) string

JoinArgs joins command line arguments into a single string

func LogDebug

func LogDebug(message string)

LogDebug logs a debug message

func LogError

func LogError(message string)

LogError logs an error message

func LogInfo

func LogInfo(message string)

LogInfo logs an info message

func LogWarning

func LogWarning(message string)

LogWarning logs a warning message

func NewSpinner

func NewSpinner(message string) *spinner.Spinner

NewSpinner creates a new spinner with the given message

func ParseKeyValue

func ParseKeyValue(input string) []string

ParseKeyValue parses a key=value string

func PrintBanner

func PrintBanner()

PrintBanner prints the AlloraCLI banner

func RemoveFromSlice

func RemoveFromSlice(slice []string, item string) []string

RemoveFromSlice removes an item from a string slice

func TruncateString

func TruncateString(s string, maxLength int) string

TruncateString truncates a string to a maximum length

Types

This section is empty.

Jump to

Keyboard shortcuts

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