Authorizes proactive delivery without performing transport I/O.
Summary
Functions
Decides whether event may be proactively delivered to destination under policy.
Promotes a due deferred or digest receipt back to :authorized.
Marks an authorized receipt as delivered, recording the external receipt and time.
Marks an authorized receipt as failed with the given reason.
Functions
@spec authorize( Spectre.Operation.Event.t(), Spectre.Operation.Loop.t(), term(), Spectre.Operation.Delivery.Policy.t() | map() | keyword(), [Spectre.Operation.Delivery.Receipt.t()], keyword() ) :: {:ok, Spectre.Operation.Delivery.Receipt.t()} | {:duplicate, Spectre.Operation.Delivery.Receipt.t()} | {:error, Spectre.Operation.Delivery.Receipt.t()}
Decides whether event may be proactively delivered to destination under policy.
Returns {:ok, receipt} when delivery is authorized, deferred (quiet hours) or
routed to a digest, {:duplicate, receipt} when a prior receipt in history
matches the dedupe key within its TTL, and {:error, receipt} when delivery is
denied; the receipt records the decision and its reason. No transport I/O occurs.
@spec authorized(Spectre.Operation.Delivery.Receipt.t(), non_neg_integer()) :: {:ok, Spectre.Operation.Delivery.Receipt.t()} | {:error, term()}
Promotes a due deferred or digest receipt back to :authorized.
@spec delivered(Spectre.Operation.Delivery.Receipt.t(), term(), non_neg_integer()) :: {:ok, Spectre.Operation.Delivery.Receipt.t()} | {:error, term()}
Marks an authorized receipt as delivered, recording the external receipt and time.
Returns {:ok, receipt} with the updated receipt, or {:error, reason} when the
transition is not allowed from the receipt's current status.
@spec failed(Spectre.Operation.Delivery.Receipt.t(), term()) :: {:ok, Spectre.Operation.Delivery.Receipt.t()} | {:error, term()}
Marks an authorized receipt as failed with the given reason.
Returns {:ok, receipt} with the updated receipt, or {:error, reason} when the
transition is not allowed from the receipt's current status.