
instanceid
Package instanceid produces a stable per-process identifier that the cleanup worker writes into cleanup_queue.claimed_by for operator visibility into which orchestrator process is currently holding a row.
Index
type ID
ID is the resolved instance identifier in the form hostname-XXXXXXXX.
func New
New builds a fresh instance identifier. The hostname is taken from os.Hostname() and falls back to “unknown” when the OS call fails (rare, but the identifier is observability-only so a soft fallback is safer than a startup failure). The 8-hex suffix comes from crypto/rand so two processes on the same host get distinct identifiers; if rand.Read ever fails the function returns the error - the caller decides whether to fail-fast or carry on with a non-unique identifier.
func (ID) String
String returns the identifier as a plain string for stamping into SQL parameters and log/audit fields.
Generated by gomarkdoc