Spikard.LifecycleHookPhase (spikard v0.17.0)

Copy Markdown

The five lifecycle phases a hook can be registered against.

Used to resolve a per-route named hook selection (LifecycleHooksConfig in spikard-core::http) against the hooks actually registered on the server: a name is looked up within one specific phase's registered hooks, not across all five, so a hook registered for on_response can never be silently picked up by a route asking for on_request.

Summary

Types

t()

The five lifecycle phases a hook can be registered against.

Functions

Returns the serde wire value this variant carries on the JSON boundary (see wire_variant_value in alef's naming module) -- distinct from the atom's Elixir spelling.

Types

t()

@type t() :: :on_request | :pre_validation | :pre_handler | :on_response | :on_error

The five lifecycle phases a hook can be registered against.

Functions

on_error()

@spec on_error() :: t()

on_request()

@spec on_request() :: t()

on_response()

@spec on_response() :: t()

pre_handler()

@spec pre_handler() :: t()

pre_validation()

@spec pre_validation() :: t()

wire_value(atom)

@spec wire_value(t()) :: String.t()

Returns the serde wire value this variant carries on the JSON boundary (see wire_variant_value in alef's naming module) -- distinct from the atom's Elixir spelling.