Polyjuice Client v0.2.1 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.

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

Close the storage.

Link to this function

get_filter_id(storage, filter)

View Source

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.

Link to this function

kv_get(storage, key, default \\ nil)

View Source

Get the data for a specific key.

Link to this function

kv_put(storage, key, value)

View Source

Store data for a specific key.

Link to this function

set_filter_id(storage, filter, filter_id)

View Source

Store the ID for a filter.

Link to this function

set_sync_token(storage, token)

View Source

Set the sync token.