type hostIDProvider … var defaultHostIDProvider … var hostID … type hostIDReader … type fileReader … type commandExecutor … type hostIDReaderBSD … // read attempts to read the machine-id from /etc/hostid. If not found it will // execute `kenv -q smbios.system.uuid`. If neither location yields an id an // error will be returned. func (r *hostIDReaderBSD) read() (string, error) { … } type hostIDReaderDarwin … // read executes `ioreg -rd1 -c "IOPlatformExpertDevice"` and parses host id // from the IOPlatformUUID line. If the command fails or the uuid cannot be // parsed an error will be returned. func (r *hostIDReaderDarwin) read() (string, error) { … } type hostIDReaderLinux … // read attempts to read the machine-id from /etc/machine-id followed by // /var/lib/dbus/machine-id. If neither location yields an ID an error will // be returned. func (r *hostIDReaderLinux) read() (string, error) { … } type hostIDDetector … // Detect returns a *Resource containing the platform specific host id. func (hostIDDetector) Detect(ctx context.Context) (*Resource, error) { … }