Bargad v1.0.1 Storage behaviour View Source

Defines a general key-value storage for persisting and retrieval of the Merkle Tree Nodes Bargad.Types.tree_node/0. The tree nodes can be a part of either Bargad.Log or Bargad.Map. We define a callback that can be implemented by a number of potential backends.

Link to this section Summary

Functions

Deletes a node with the specified key from the given backend

Retrieves a node with the specified key from the given backend

Persists a node with the specified key, value in the given backend

Link to this section Functions

Link to this function delete_node(backend, key) View Source

Deletes a node with the specified key from the given backend.

Retrieves a node with the specified key from the given backend.

Link to this function set_node(backend, key, value) View Source

Persists a node with the specified key, value in the given backend.

Link to this section Callbacks

Link to this callback delete_node(term, term) View Source
delete_node(term(), term()) :: term()
Link to this callback get_node(term, term) View Source
get_node(term(), term()) :: term()
Link to this callback init_backend(term) View Source
init_backend(term()) :: term()
Link to this callback set_node(term, term, term) View Source
set_node(term(), term(), term()) :: term()