Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigDir ¶
ConfigDir returns the directory for cloudstic configuration and state files. Resolution order:
- override, when non-empty (the -config-dir flag)
- CLOUDSTIC_CONFIG_DIR environment variable
- os.UserConfigDir()/cloudstic (platform default)
Resolution performs no filesystem access. The directory is created, with 0700 permissions, by whoever writes into it — SaveAtomic and profile.Save both do — so asking where configuration *would* live never creates it. That matters because the answer is needed on paths that must not have side effects: rendering help, generating completions, and previewing a setup with -dry-run all resolve this path without any intent to write.
func MachineID ¶ added in v1.14.0
func MachineID() string
MachineID returns a unique identifier for the current machine. It tries to read from common system files.
func SaveAtomic ¶ added in v1.14.0
SaveAtomic writes data to a temporary file in the target directory and atomically renames it to path to prevent file corruption during crashes. It ensures 0600 permissions on the final file.
Types ¶
This section is empty.