Polyjuice Client v0.4.4 Polyjuice.Client.Storage protocol View Source

Persistent storage for the Matrix client

Link to this section Summary

Types

t()

Safe values to use for key-value storage. All storage must support at least these types.

Functions

Close the storage.

Get the ID stored for a filter, or nil if no ID has been stored.

Get the latest sync token, or nil if no sync token has been set.

Delete the data for a specific key.

Get the data for a specific key.

Store data for a specific key.

Store the ID for a filter.

Set the sync token.

Link to this section Types

Link to this type

value()

View Source
value() ::
  true
  | false
  | nil
  | String.t()
  | float()
  | [value(), ...]
  | %{optional(String.t()) => value()}

Safe values to use for key-value storage. All storage must support at least these types.

Link to this section Functions

Link to this function

close(storage)

View Source
close(storage :: t()) :: any()

Close the storage.

Link to this function

get_filter_id(storage, filter)

View Source
get_filter_id(storage :: t(), filter :: map()) :: String.t() | nil

Get the ID stored for a filter, or nil if no ID has been stored.

Link to this function

get_sync_token(storage)

View Source
get_sync_token(storage :: t()) :: String.t() | nil

Get the latest sync token, or nil if no sync token has been set.

Link to this function

kv_del(storage, namespace, key)

View Source
kv_del(t(), String.t(), String.t()) :: any()

Delete the data for a specific key.

Link to this function

kv_get(storage, namespace, key, default \\ nil)

View Source
kv_get(t(), String.t(), String.t(), value()) :: value()

Get the data for a specific key.

Link to this function

kv_put(storage, namespace, key, value)

View Source
kv_put(t(), String.t(), String.t(), value()) :: any()

Store data for a specific key.

Link to this function

set_filter_id(storage, filter, filter_id)

View Source
set_filter_id(storage :: t(), filter :: map(), filter_id :: String.t()) ::
  any()

Store the ID for a filter.

Link to this function

set_sync_token(storage, token)

View Source
set_sync_token(storage :: t(), token :: String.t()) :: any()

Set the sync token.