LemonCore. Id
(lemon_core v0.1.0)
View Source
ID generation utilities for Lemon.
Provides consistent ID generation for runs, sessions, and other entities.
Summary
Functions
Generate an approval ID.
Generate a cron job ID.
Generate an idempotency key for a scope and operation.
Generate a run ID.
Generate a session ID.
Generate a skill ID.
Generate a time-ordered UUID v7.
Generate a random UUID v4.
Functions
@spec approval_id() :: binary()
Generate an approval ID.
@spec cron_id() :: binary()
Generate a cron job ID.
Generate an idempotency key for a scope and operation.
Examples
iex> key = LemonCore.Id.idempotency_key("messages", "send")
iex> String.starts_with?(key, "messages:send:")
true
@spec run_id() :: binary()
Generate a run ID.
Run IDs are UUID v4 with a "run_" prefix for easy identification.
Examples
iex> id = LemonCore.Id.run_id()
iex> String.starts_with?(id, "run_")
true
@spec session_id() :: binary()
Generate a session ID.
Session IDs are UUID v4 with a "sess_" prefix for easy identification.
Examples
iex> id = LemonCore.Id.session_id()
iex> String.starts_with?(id, "sess_")
true
@spec skill_id() :: binary()
Generate a skill ID.
@spec uuid7() :: binary()
Generate a time-ordered UUID v7.
Sorts lexicographically by creation time, unlike uuid/0.
@spec uuid() :: binary()
Generate a random UUID v4.