shared

package
v0.115.0-nightly Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Confirm

func Confirm(prompt string) bool

Confirm prompts the user for yes/no confirmation. Returns true if user confirms.

func ConfirmExact

func ConfirmExact(prompt, expected string) bool

ConfirmExact prompts the user to type an exact string to confirm. Returns true if matched.

func FormatBytes

func FormatBytes(bytes int64) string

FormatBytes formats a byte count into a human-readable string (KB, MB, GB, etc.)

func FormatSize

func FormatSize(mb float64) string

FormatSize formats a megabyte value into a human-readable string.

func FormatUptime

func FormatUptime(seconds float64) string

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

func GetAuthToken() (string, error)

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.

Jump to

Keyboard shortcuts

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