Documentation
¶
Index ¶
- Constants
- Variables
- func Blue(value string) string
- func BoolPointerToString(value *bool) string
- func BuildURL(basePath, relativePath string, params map[string]string) string
- func CliError(msg string, args ...interface{})
- func CliInfo(msg string, args ...interface{})
- func CliInfoWithExit(msg string, args ...interface{})
- func CliWarning(msg string, args ...interface{})
- func CommandConfirm() bool
- func CreateAndEditTempFile(data []byte) (string, error)
- func DeleteFile(path string) error
- func ExtractWorkspaceName(workspaceURL string) string
- func FormatSSHTarget(target SSHTarget) string
- func GetCLIVersion() string
- func GetUserAgent() string
- func Green(value string) string
- func IsInteractiveShell() bool
- func IsLocalTarget(target string) bool
- func IsRemoteTarget(target string) bool
- func IsUUID(str string) bool
- func ParseErrorResponse(err error) (code, source string)
- func PrettyJSON(data []byte) (*bytes.Buffer, error)
- func PrintHeader(header string)
- func PrintJson(body []byte)
- func PrintTable(slice interface{})
- func ProcessEditedData(originalData []byte) (interface{}, error)
- func PromptForBool(prompt string) bool
- func PromptForInput(promptText string) string
- func PromptForIntInput(promptText string, defaultValue int) int
- func PromptForListInput(promptText string) []string
- func PromptForPassword(promptText string) string
- func PromptForRequiredInput(promptText string) string
- func PromptForRequiredIntInput(promptText string) int
- func PromptForRequiredListInput(promptText string) []string
- func ReadFileFromPath(filePath string) ([]byte, error)
- func Red(value string) string
- func RemovePrefixBeforeAPI(url string) string
- func SaveFile(fileName string, data []byte) error
- func ShowLogo()
- func SplitAndParseInt(input string) []int
- func SplitPath(path string) (string, string)
- func TimeFormat(value int) *string
- func TimeUtils(t time.Time) string
- func TruncateString(str string, num int) string
- func Unzip(src string, dest string) error
- func Yellow(value string) string
- func Zip(folderPath string) ([]byte, error)
- type ErrorResponse
- type SSHTarget
Constants ¶
const (
CodeAuthMFARequired = "auth_mfa_required"
)
Variables ¶
var Version string = "dev"
Functions ¶
func BoolPointerToString ¶
func CliError ¶
func CliError(msg string, args ...interface{})
CliError handles all error messages in the CLI.
func CliInfo ¶
func CliInfo(msg string, args ...interface{})
CliInfo handles all informational messages in the CLI.
func CliInfoWithExit ¶
func CliInfoWithExit(msg string, args ...interface{})
CliInfoWithExit prints an informational message to stderr and exits the program with a status code of 0
func CliWarning ¶
func CliWarning(msg string, args ...interface{})
CliWarning handles all warning messages in the CLI.
func CommandConfirm ¶ added in v0.4.4
func CommandConfirm() bool
CommandConfirm prompts the user for confirmation to continue executing a command. It returns true if the user enters "y" or "yes" (case-insensitive), and false otherwise.
func CreateAndEditTempFile ¶
func DeleteFile ¶
func ExtractWorkspaceName ¶ added in v0.4.0
ExtractWorkspaceName extracts workspace name from workspace URL
func FormatSSHTarget ¶ added in v0.4.0
FormatSSHTarget formats an SSHTarget back into a string representation
func GetCLIVersion ¶
func GetCLIVersion() string
func GetUserAgent ¶
func GetUserAgent() string
func IsInteractiveShell ¶ added in v0.4.4
func IsInteractiveShell() bool
IsInteractiveShell checks if the current program is running in an interactive terminal.
func IsLocalTarget ¶ added in v0.4.0
IsLocalTarget checks if a target string represents a local location
func IsRemoteTarget ¶ added in v0.4.0
IsRemoteTarget checks if a target string represents a remote location A target is considered remote if it contains a colon (:)
func ParseErrorResponse ¶ added in v0.4.0
func PrintHeader ¶
func PrintHeader(header string)
func PrintTable ¶
func PrintTable(slice interface{})
func ProcessEditedData ¶
ProcessEditedData facilitates user modifications to original data, formats it, supports editing via a temp file, compares the edited data against the original, and parses it into JSON. If no changes are made, the update is aborted and an error is returned.
func PromptForBool ¶
func PromptForInput ¶
func PromptForIntInput ¶
func PromptForListInput ¶
func PromptForPassword ¶
func PromptForRequiredInput ¶
func ReadFileFromPath ¶
func RemovePrefixBeforeAPI ¶
func SplitAndParseInt ¶
func TimeFormat ¶
func TruncateString ¶
Types ¶
type ErrorResponse ¶ added in v0.4.0
type SSHTarget ¶ added in v0.4.0
type SSHTarget struct {
User string // Username (empty if not specified)
Host string // Hostname/server name
Path string // Path (empty if not specified)
}
SSHTarget represents a parsed SSH-like target with user, host, and path components
func ParseSSHTarget ¶ added in v0.4.0
ParseSSHTarget parses SSH-like target strings and returns the components Supports formats: - host - user@host - host:path - user@host:path