BlogEngine.RouteRegistry behaviour (blog_engine v0.1.0)

Copy Markdown View Source

Validates route claims and delegates host route conflict checks.

Summary

Callbacks

Checks a route claim against host-owned routes outside BlogEngine.

Functions

Verifies and forwards a route claim to the context-selected registry.

Callbacks

validate(module, t, t, t)

@callback validate(
  module(),
  BlogEngine.Context.t(),
  String.t(),
  BlogEngine.RouteClaim.Verified.t()
) ::
  :ok | {:error, term()}

Checks a route claim against host-owned routes outside BlogEngine.

Functions

validate(repo, context, path, claim)

@spec validate(
  module(),
  BlogEngine.Context.t(),
  String.t(),
  BlogEngine.RouteClaim.t()
) ::
  :ok | {:error, BlogEngine.Error.t()}

Verifies and forwards a route claim to the context-selected registry.

The caller must already be inside a repository transaction so the verified owner and exclusion locks remain held through host validation. Calls outside a transaction fail with :transaction_required.