Documentation
¶
Overview ¶
Package hostid defines Epithet's stable, non-secret host identifiers.
Index ¶
Constants ¶
const ( // SchemeV1 identifies the first host-ID representation. It is part of the // canonical text stored on hosts and copied into inventory. SchemeV1 = "epithet-host-v1" )
Variables ¶
This section is empty.
Functions ¶
func DefaultPath ¶
DefaultPath returns the native system-wide host-ID path for this operating system. Callers may offer an explicit override for other layouts.
Types ¶
type ID ¶
type ID string
ID is a canonical Epithet host identifier. It identifies a logical host but is neither secret nor an authentication credential.
func EnsureFile ¶
EnsureFile returns the existing canonical host ID at path or creates a new one. It never replaces an existing directory entry. The parent directory must already exist with its final ownership and permissions.
func ReadFile ¶
ReadFile reads one canonical host ID. A file may omit its final newline or contain exactly one; all other surrounding whitespace and additional lines are rejected.
func (ID) MarshalText ¶
MarshalText implements encoding.TextMarshaler.
func (*ID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler.