Spectre.GAM.Id (Spectre v0.4.0)

Copy Markdown View Source

Generates opaque identifiers for operational ledger records.

Operational identifiers answer which occurrence? and use UUIDv7. Semantic records answer which value? and therefore use their canonical content digest instead; those references are created by the record modules, not here.

The source is explicit so callers at a boundary can substitute a deterministic implementation in tests without making UUID generation part of the kernel.

Summary

Types

A module which supplies UUIDv7 values.

t()

A canonical lowercase RFC 9562 UUIDv7 string.

Functions

Generates and validates a UUIDv7 using source.

Returns whether value is a canonical lowercase RFC 9562 UUIDv7.

Types

source()

@type source() :: module()

A module which supplies UUIDv7 values.

t()

@type t() :: <<_::288>>

A canonical lowercase RFC 9562 UUIDv7 string.

Functions

generate(source \\ Spectre.GAM.Id.UUIDv7)

@spec generate(source()) :: t()

Generates and validates a UUIDv7 using source.

valid?(value)

@spec valid?(term()) :: boolean()

Returns whether value is a canonical lowercase RFC 9562 UUIDv7.