Revisionair v0.10.0 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 {structure_type, unique_identifier}
Callback implementation for Revisionair.Storage.get_revision/3
Returns a {structure, metadata}-list of all revisions of the given struture, newest-to-oldest
Returns the newest revision for the given {structure_type, unique_identifier} combination
Stores a new revision for the given map, uniquely identified by the {structure_type, unique_identifier} combination
Functions
Deletes all revisions for the given {structure_type, unique_identifier}
Callback implementation for Revisionair.Storage.delete_all_revisions_of/2
.
Callback implementation for Revisionair.Storage.get_revision/3
.
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/2
.
Returns the newest revision for the given {structure_type, unique_identifier} 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/2
.
Stores a new revision for the given map, uniquely identified by the {structure_type, unique_identifier} combination.
Callback implementation for Revisionair.Storage.store_revision/4
.