Documentation
¶
Overview ¶
Package device resolves the stable per-machine identity prosa uses for the sessions.device_id column and the future server-side device row. The id is hex(sha256(hostname + machineID))[:16] so it survives hostname renames as long as the machine-id stays put, and survives machine-id changes (rare) as long as the hostname stays put.
macOS: machineID = IOPlatformUUID parsed from `ioreg -rd1 -c IOPlatformExpertDevice`. Linux: machineID = /etc/machine-id (or /var/lib/dbus/machine-id fallback). Other: empty machineID; hostname alone still produces a stable id.
All public funcs return cached values after the first call so repeated importer invocations on the same process pay the cost once.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fingerprint ¶
Fingerprint computes hex(sha256(hostname + machineID))[:16]. Exposed so tests can reproduce the ID without going through the resolver.
func FriendlyName ¶
func FriendlyName() string
FriendlyName today is just the hostname; INTENT.md §6 promises a `prosa devices rename` flow in a later cut that overrides this.
func Hostname ¶
func Hostname() string
Hostname returns the machine hostname, with macOS' "<host>.local" suffix stripped for friendliness. Cached.
Types ¶
This section is empty.