Kantoor.Retention (Kantoor v1.0.0)

Decides the retention Kantoor asks Karta to apply to a delivery (contract 3a).

The decision is returned in the 2xx response to the inbound push. Today it is a per-domain setting (domain_settings.retention_days, edited in the admin UI), falling back to config :kantoor, Kantoor.Retention, default: "keep" | days (itself defaulting to "keep").

Summary

Functions

Returns "keep" or a positive number of days for the delivery of payload.

Converts a decision to the Kantoor.Ingest option value.

Converts an ingest retention back to the JSON value.

Types

decision()

@type decision() :: String.t() | pos_integer()

Functions

decide(payload)

Returns "keep" or a positive number of days for the delivery of payload.

to_ingest(days)

@spec to_ingest(decision()) :: :keep | {:days, pos_integer()}

Converts a decision to the Kantoor.Ingest option value.

to_json(arg1)

@spec to_json(:keep | {:days, pos_integer()}) :: decision()

Converts an ingest retention back to the JSON value.