DripDrop.ShortLinks (DripDrop v0.1.0)

Copy Markdown View Source

Context for persisted short-link records.

The rewriting pipeline stays focused on URL parsing and provider calls while this context owns the DripDrop schema interactions for idempotent short-link lookup and persistence.

Summary

Functions

Returns an existing short-link row for an idempotency key.

Persists a provider result for a shortened URL.

Returns true when a provider result should not write a short-link row.

Functions

get_by_idempotency_key(idempotency_key)

@spec get_by_idempotency_key(binary()) :: Ecto.Schema.t() | nil

Returns an existing short-link row for an idempotency key.

persist_result(attrs)

@spec persist_result(map()) :: :ok | {:error, map()}

Persists a provider result for a shortened URL.

skipped_result?(result)

@spec skipped_result?(DripDrop.ShortLinks.Result.t()) :: boolean()

Returns true when a provider result should not write a short-link row.