GenServer that periodically evaluates lifecycle rules for buckets.
Lifecycle rules support object expiration and internal transition to packed storage for cold objects.
Rules are stored in Concord under "lifecycle:{bucket}" as a list of rule maps.
Rule format: %{
id: "rule-id",
prefix: "logs/", # optional prefix filter
status: "Enabled", # "Enabled" or "Disabled"
expiration_days: 30, # delete objects older than N days
transition_days: 7, # pack objects older than N days
transition_storage_class: "PACKED"}
Summary
Functions
Returns a specification to start this module under a supervisor.
Delete lifecycle rules for a bucket.
Evaluate rules for a specific bucket. Can be called directly without GenServer.
Evaluate lifecycle rules now (for testing or manual trigger).
Get lifecycle rules for a bucket.
Set lifecycle rules for a bucket.
Check if an object matches any lifecycle expiration rule. Exported for testing.
Check if an object matches any lifecycle transition rule. Exported for testing.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec delete_rules(String.t()) :: :ok
Delete lifecycle rules for a bucket.
@spec evaluate_bucket(String.t()) :: {:ok, non_neg_integer()}
Evaluate rules for a specific bucket. Can be called directly without GenServer.
Evaluate lifecycle rules now (for testing or manual trigger).
Get lifecycle rules for a bucket.
Set lifecycle rules for a bucket.
@spec should_expire?(String.t(), map(), [map()], DateTime.t()) :: boolean()
Check if an object matches any lifecycle expiration rule. Exported for testing.
@spec should_transition?(String.t(), map(), [map()], DateTime.t()) :: boolean()
Check if an object matches any lifecycle transition rule. Exported for testing.