Documentation
¶
Index ¶
- func Confirm(prompt string) bool
- func ConfirmExact(prompt, expected string) bool
- func FormatBytes(bytes int64) string
- func FormatSize(mb float64) string
- func FormatUptime(seconds float64) string
- func GetAPIURL() string
- func GetAuthToken() (string, error)
- func PrintJSON(data interface{})
- func RequireRoot()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfirmExact ¶
ConfirmExact prompts the user to type an exact string to confirm. Returns true if matched.
func FormatBytes ¶
FormatBytes formats a byte count into a human-readable string (KB, MB, GB, etc.)
func FormatSize ¶
FormatSize formats a megabyte value into a human-readable string.
func FormatUptime ¶
FormatUptime formats seconds into a human-readable uptime string.
func GetAPIURL ¶
func GetAPIURL() string
GetAPIURL returns the gateway/API URL from env var or active environment config.
func GetAuthToken ¶
GetAuthToken returns an auth token from env var or the credentials store.
func PrintJSON ¶
func PrintJSON(data interface{})
PrintJSON pretty-prints data as indented JSON to stdout.
func RequireRoot ¶
func RequireRoot()
RequireRoot exits with an error if the current user is not root.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.