Stable resource-limit contract for FerricStore control planes and write paths.
The public management commands use set_limit/3, get_limit/2, and
usage/2. Internal enforcement points can use check/4, reserve/4,
release/2, and record_activity/2 without coupling storage code to any
specific limit backend.
Summary
Types
@type amount() :: non_neg_integer()
@type command() :: binary()
@type command_args() :: [term()]
@type limit_spec() :: map()
@type reservation() :: term()
Callbacks
@callback check_command(command(), command_args(), [binary()], keyword()) :: :ok | {:error, term()}
@callback release( reservation(), keyword() ) :: :ok | {:error, term()}
@callback set_limit(scope(), limit_spec(), keyword()) :: result()
Functions
@spec check_command(command(), command_args(), [binary()], keyword()) :: :ok | {:error, term()}
@spec release( reservation(), keyword() ) :: :ok | {:error, term()}
@spec set_limit(scope(), limit_spec(), keyword()) :: result()