Revisionair v0.13.1 Revisionair.Storage.Agent
A simple implementation of the Revisionair.Storage protocol that builds on the Agent module.
This is thus a very ephemeral persistence layer, which, though paradoxical and maybe not very practical in real-life applications, is at least very useful as a simple example and for testing.
Summary
Functions
Deletes all revisions for the given {item_type, item_id}
Callback implementation for Revisionair.Storage.get_revision/4
Returns a {structure, metadata}-list of all revisions of the given struture, newest-to-oldest
Returns the newest revision for the given {item_type, item_id} combination
Stores a new revision for the given map, uniquely identified by the {item_type, item_id} combination
Functions
Deletes all revisions for the given {item_type, item_id}
Callback implementation for Revisionair.Storage.delete_all_revisions_of/3
.
Callback implementation for Revisionair.Storage.get_revision/4
.
Returns a {structure, metadata}-list of all revisions of the given struture, newest-to-oldest.
The metadata field is required to be a map, which has to include a :revision
field.
Callback implementation for Revisionair.Storage.list_revisions/3
.
Returns the newest revision for the given {item_type, item_id} combination.
This callback is supplied decoupled from list_revisions
for efficiency,
because it is very common to check only the newest revision.
Callback implementation for Revisionair.Storage.newest_revision/3
.
Stores a new revision for the given map, uniquely identified by the {item_type, item_id} combination.
Callback implementation for Revisionair.Storage.store_revision/5
.