Grizzly.Storage.Adapter behaviour (grizzly v8.15.3)

View Source

Behaviour for Grizzly storage adapters.

Implementations should be compatible with PropertyTable.

Summary

Types

The argument passed to the storage adapter. See Grizzly.Options.

Callbacks

Delete keys matching a pattern.

Get a value from storage by key.

Match keys in storage against a pattern.

Put a key-value pair into storage.

Put multiple key-value pairs into storage.

Types

adapter_options()

@type adapter_options() :: any()

The argument passed to the storage adapter. See Grizzly.Options.

Callbacks

delete_matches(adapter_options, pattern)

@callback delete_matches(adapter_options(), Grizzly.Storage.pattern()) :: :ok

Delete keys matching a pattern.

get(adapter_options, key)

Get a value from storage by key.

match(adapter_options, pattern)

Match keys in storage against a pattern.

put(adapter_options, key, value)

Put a key-value pair into storage.

put_many(adapter_options, list)

@callback put_many(adapter_options(), [{Grizzly.Storage.key(), Grizzly.Storage.value()}]) ::
  :ok

Put multiple key-value pairs into storage.