Karta. Kantoor. Retention
(Karta v1.0.0)
The retention policy of the Kantoor interface (contract 3a, 3c.4): what
Kantoor asks Karta to do with a message's lifetime. Kantoor decides, Karta
only enforces it (Karta.Messages.Retention).
:keep- never expires by age, and is exempt from the size cap (retention_size_mb); counted as kept storage (Karta.Kantoor.KeptStorage);{:days, n}- expiresndays after the message was received or sent, instead of the server'sretention_days;nil- no policy: the server's settings apply, exactly as without Kantoor.
In JSON a policy is "keep" or a whole number of days (1 to
36500); null or absent is no policy.
Stored as two nullable columns, retention_keep (true or NULL) and
retention_days, on deliveries, routes and (outgoing) messages.
Summary
Functions
The columns that hold a policy.
The policy a row (a delivery, route or message) carries.
A policy from its JSON value: {:ok, policy} (nil for null), or :error.
A policy as JSON.
Types
@type t() :: :keep | {:days, pos_integer()} | nil
Functions
@spec columns(t()) :: [ retention_keep: boolean() | nil, retention_days: pos_integer() | nil ]
The columns that hold a policy.
The policy a row (a delivery, route or message) carries.
A policy from its JSON value: {:ok, policy} (nil for null), or :error.
@spec to_json(t()) :: String.t() | pos_integer() | nil
A policy as JSON.