Documentation
¶
Index ¶
- Variables
- func Get(key string) string
- func GetCacheDir() string
- func GetConfigDir() string
- func GetDataDir() string
- func GetDatabasePath() string
- func GetDownloadsDir() string
- func GetFSToolName(tool, backend string) string
- func GetGlobalConfigPath() string
- func GetInstallsDir() string
- func GetLockFilePath() string
- func GetPluginsDir() string
- func GetShimsDir() string
- func RandomString(n int) (string, error)
Constants ¶
This section is empty.
Variables ¶
var ( //ProjectName Project Name ProjectName string = "unirtm" //Author Author Author string = "Snowdream Tech <snowdreamtech@qq.com>" //BuildTime Build Time BuildTime string = "N/A" //GitTag Git Tag GitTag string = "N/A" //CommitHash Commit Hash CommitHash string = "N/A" //CommitHashFull Commit Hash CommitHashFull string = "N/A" //COPYRIGHT COPYRIGHT COPYRIGHT string = "Copyright (c) 2023-present SnowdreamTech Inc." //LICENSE LICENSE LICENSE string = "MIT <https://github.com/snowdreamtech/unirtm/blob/main/LICENSE>" //Config Config File Path Config string = "unirtm.toml" // Debug indicates whether the application should run in debug mode. Debug bool // Trace indicates whether the application should run in trace mode. Trace bool // Quiet indicates whether the application should run in quiet mode. Quiet bool // Cwd specifies the current working directory for the application. Cwd string // EnvName specifies the environment name for loading environment-specific configs. EnvName string // Jobs specifies the number of parallel jobs to run. Jobs int // Yes indicates whether to automatically answer yes to all confirmation prompts. Yes bool // Locked indicates whether to require lockfile URLs to be present during installation. Locked bool // Silent indicates whether to suppress all output and non-error messages. Silent bool CryptoRandRead = rand.Read )
var ( OsUserHomeDir = os.UserHomeDir OsUserConfigDir = os.UserConfigDir OsGetwd = os.Getwd RuntimeGOOS = runtime.GOOS )
Exported for testing override
Functions ¶
func Get ¶
Get returns the value of the environment variable with the given key, searching with prefixes in order: UNIRTM_, MISE_, and then the raw key. Note: PATH is retrieved directly to avoid pollution from UNIRTM_PATH/MISE_PATH.
func GetCacheDir ¶
func GetCacheDir() string
GetCacheDir returns the directory where cache files are stored. It follows XDG Base Directory Specification for cache home.
func GetConfigDir ¶
func GetConfigDir() string
GetConfigDir returns the root configuration directory for UniRTM. It uses UNIRTM_CONFIG_DIR if set, otherwise falls back to XDG config directory.
func GetDataDir ¶
func GetDataDir() string
GetDataDir returns the root data directory for UniRTM. It uses UNIRTM_DATA_DIR if set, otherwise falls back to appropriate OS directories.
func GetDatabasePath ¶
func GetDatabasePath() string
GetDatabasePath returns the path to the UniRTM SQLite database.
func GetDownloadsDir ¶
func GetDownloadsDir() string
GetDownloadsDir returns the directory where artifacts are downloaded before extraction.
func GetFSToolName ¶
GetFSToolName returns a sanitized tool name for use in filesystem paths. It implements Scheme B: provider-tool-name, replacing colons and slashes with hyphens.
func GetGlobalConfigPath ¶
func GetGlobalConfigPath() string
GetGlobalConfigPath returns the path to the global unirtm.toml configuration file. This is the file edited by `unirtm set --global` / `unirtm unset --global`.
func GetInstallsDir ¶
func GetInstallsDir() string
GetInstallsDir returns the directory where tools are installed.
func GetLockFilePath ¶
func GetLockFilePath() string
GetLockFilePath returns the path of the unirtm.lock file. It respects the UNIRTM_LOCK_FILE environment variable for custom locations (useful in CI or monorepo setups), falling back to "unirtm.lock" in the current working directory — mirroring how mise.lock sits next to mise.toml.
func GetPluginsDir ¶
func GetPluginsDir() string
GetPluginsDir returns the directory where plugins (e.g., asdf plugins) are stored.
func GetShimsDir ¶
func GetShimsDir() string
GetShimsDir returns the directory where UniRTM shims are stored.
func RandomString ¶
RandomString returns a random string of the specified length.
Types ¶
This section is empty.