Documentation
¶
Overview ¶
Package retention will be the retention module: cleanup policies, archive policies, the cold tier and restore jobs.
Role ¶
retention module, module root. Only app imports a module root; other modules reach retention through retention/api (decision 0044, dependency rules). Its storage skeleton (the module's ports, models and store adapters) sits in subpackages ahead of its phase; skeleton modules get no constructor until then (decision 0044, composition and HTTP).
Inputs ¶
None yet. Planned: the Deps that app passes to New. Cleanup and archive runs are scheduled (decision 0010), and archiving moves items to the cold tier (decision 0024).
Outputs ¶
None yet. Planned: module.go with New(Deps). The module's layers are its subpackages: api (P11, P16), core/cleanup (P11), core/archive and core/restore (P16), and adapters/http (P11, P16).
References ¶
- Context map, retention row, as https://github.com/weaveplatform/artifactweave/issues/958 records it: owns cleanup policies, archive policies, the cold tier and restore jobs; phases P11 and P16.
- Target layout: docs/research/architecture-options/5-modular-monolith.md, "Full package tree", lines 85-104 and 325-329.
- Decision 0044: docs/research/decisions/0044-modular-monolith-migration.md, "Placeholders" and "Composition and HTTP".
- Decision 0010: docs/research/decisions/0010-retention-trash-and-gc.md.
- Decision 0024: docs/research/decisions/0024-cold-storage-tier.md.
- Plan: docs/implementation/plan.md#p11-projects-webhooks-retention-replication, #p16-cold-storage-archive-and-retention.
Status ¶
Placeholder: implemented by P11, P16.
Directories
¶
| Path | Synopsis |
|---|---|
|
adapters
|
|
|
http
Package retentionhttp will serve the retention endpoints: cleanup and archive policies, their runs, and restores.
|
Package retentionhttp will serve the retention endpoints: cleanup and archive policies, their runs, and restores. |
|
inmem
Package inmem is the in-memory implementation of the retention module's stores: cleanup policies and runs, and archive policies and executions.
|
Package inmem is the in-memory implementation of the retention module's stores: cleanup policies and runs, and archive policies and executions. |
|
sql
Package sql is the SQL implementation of the retention module's stores: cleanup policies and runs, and archive policies and executions, with the module's registration with the SQL layer.
|
Package sql is the SQL implementation of the retention module's stores: cleanup policies and runs, and archive policies and executions, with the module's registration with the SQL layer. |
|
sql/migrations
Package migrations holds the retention module's migration stream: the SQLite and PostgreSQL schema of the tables the module's SQL adapter owns.
|
Package migrations holds the retention module's migration stream: the SQLite and PostgreSQL schema of the tables the module's SQL adapter owns. |
|
storetest
Package storetest is the contract suite of the retention module's stores: one set of expectations that every implementation of the cleanup and archive stores must meet.
|
Package storetest is the contract suite of the retention module's stores: one set of expectations that every implementation of the cleanup and archive stores must meet. |
|
Package api will be the retention module's published interface: cleanup policies, archive policies and restores.
|
Package api will be the retention module's published interface: cleanup policies, archive policies and restores. |
|
core
|
|
|
archive
Package archive will run the archive policies that move eligible items and package versions to the cold tier.
|
Package archive will run the archive policies that move eligible items and package versions to the cold tier. |
|
cleanup
Package cleanup will run package cleanup policies: scheduling, dry runs, run reports, enablement and force-disable.
|
Package cleanup will run package cleanup policies: scheduling, dry runs, run reports, enablement and force-disable. |
|
model
Package model holds the retention module's entity values: package and build cleanup policies and their runs, and the cold-storage tier's archive policies, executions and restore requests.
|
Package model holds the retention module's entity values: package and build cleanup policies and their runs, and the cold-storage tier's archive policies, executions and restore requests. |
|
port
Package port declares the retention module's store ports: the cleanup store, the archive store and Store, the part of the metadata store the module uses.
|
Package port declares the retention module's store ports: the cleanup store, the archive store and Store, the part of the metadata store the module uses. |
|
restore
Package restore will run the restore jobs that bring archived items back from the cold tier.
|
Package restore will run the restore jobs that bring archived items back from the cold tier. |