exd_streams v0.0.2 ExdStreams.Store.KeyValueStore behaviour

A behaviour for key-value based state stores

Link to this section Summary

Callbacks

Return an iterator over all keys in this store

Delete the value from the store if one is present

Get the value corresponding to this key

Update the value associated with this key

Update all the given key/value pairs

Link to this section Callbacks

Link to this callback

all()
all() :: {:ok, Stream.t()}

Return an iterator over all keys in this store.

Link to this callback

delete(key)
delete(key()) :: :ok | {:error, term()}

Delete the value from the store if one is present

Link to this callback

get(key)
get(key()) :: {:ok, value()}

Get the value corresponding to this key.

Link to this callback

put(key, value)
put(key(), value()) :: :ok | {:error, term()}

Update the value associated with this key

Link to this callback

put_all(list)
put_all([{key(), value()}]) :: :ok | {:error, term()}

Update all the given key/value pairs