identity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package identity provides machine identity resolution for the agent, including machine ID and hostname discovery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDarwinMachineID

func GetDarwinMachineID() (string, error)

GetDarwinMachineID retrieves the machine ID on macOS by parsing the IOPlatformUUID from ioreg output.

func GetMachineIDFromFS

func GetMachineIDFromFS(
	fs avfs.VFS,
) (string, error)

GetMachineIDFromFS reads the machine ID from /etc/machine-id using the provided filesystem. Returns an error if the file is missing or empty.

Types

type Identity

type Identity struct {
	// MachineID is the unique machine identifier, typically from
	// /etc/machine-id on Linux or IOPlatformUUID on macOS.
	MachineID string `json:"machine_id"`

	// Hostname is the resolved hostname, either from configuration
	// or system detection.
	Hostname string `json:"hostname"`
}

Identity holds the resolved machine identity for an agent.

func GetIdentity

func GetIdentity(
	fs avfs.VFS,
	configHostname string,
) (*Identity, error)

GetIdentity resolves the machine identity by reading the machine ID and hostname. The agent must refuse to start without a machine ID; this function returns an error rather than a fallback value.

Jump to

Keyboard shortcuts

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