ids

package
v0.4.20 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package ids provides identifier helpers shared across SDK packages. It is a leaf package with no internal imports so any SDK package can use it without creating a cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalModuleID

func CanonicalModuleID(value string) (string, bool)

CanonicalModuleID converts an identifier-safe module ID back to the canonical UUID carried in broker claims. Canonical UUID input is returned unchanged so callers can compare identities without depending on transport representation.

func FormatUUID

func FormatUUID(b [16]byte) string

FormatUUID renders the 16-byte binary form Postgres returns for a `uuid` column as the canonical 8-4-4-4-12 hyphenated text form. pgx decodes an unregistered `uuid` into [16]byte, so a raw row map hands the consumer something whose fmt.Sprint is "[202 60 140 239 ...]" — a silently corrupted join key. Same %x idiom NewUUID already uses, so the two can never disagree on the text shape.

func NewUUID

func NewUUID() string

NewUUID returns a random UUID v4 string (version 4, variant RFC 4122). Panics if crypto/rand.Read fails — callers cannot recover from entropy exhaustion on this path.

func NormalizeModuleID

func NormalizeModuleID(value string) (string, bool)

NormalizeModuleID converts the platform's canonical UUID identity to the identifier-safe m<32hex> form used by module schemas and manifests. It also accepts that compact form unchanged. Other legacy/dev IDs are deliberately outside this helper even though Config still accepts them for compatibility.

Types

This section is empty.

Jump to

Keyboard shortcuts

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