ArkEcosystem Elixir Crypto v0.1.1 ArkEcosystem.Crypto.Configuration.Configuration View Source

Link to this section Summary

Functions

Store this data, only if it does not already exist. If an item already exists and an add fails with a KVX.ConflictError exception

Deletes an entire bucket, if it exists

Removes an item from the bucket, if it exists

Returns all objects/tuples {key, value} that matches with the specified query. The query type/spec depends on each adapter implementation – :ets.match_spec in case of KVX.Bucket.ExShards

Invalidate all existing cache items

Get the value of key. If the key does not exist the special value nil is returned

Returns the values of all specified keys. For every key that does not hold a string value or does not exist, the special value nil is returned. Because of this, the operation never fails

Store this bulk data, possibly overwriting any existing data

Creates a new bucket if it doesn’t exist. If the bucket already exist, nothing happens – it works as an idempotent operation

Most common command. Store this data, possibly overwriting any existing data

Link to this section Functions

Link to this function add(bucket, key, value, ttl \\ :infinity) View Source

Store this data, only if it does not already exist. If an item already exists and an add fails with a KVX.ConflictError exception.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.add(:mybucket, "hello", "world")

Callback implementation for KVX.Bucket.add/4.

Deletes an entire bucket, if it exists.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.delete(:mybucket)

Callback implementation for KVX.Bucket.delete/1.

Removes an item from the bucket, if it exists.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.delete(:mybucket, "hello")

Callback implementation for KVX.Bucket.delete/2.

Link to this function find_all(bucket, query \\ nil) View Source

Returns all objects/tuples {key, value} that matches with the specified query. The query type/spec depends on each adapter implementation – :ets.match_spec in case of KVX.Bucket.ExShards.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.find_all(bucket, Ex2ms.fun do object -> object end)

Callback implementation for KVX.Bucket.find_all/2.

Invalidate all existing cache items.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.flush(:mybucket)

Callback implementation for KVX.Bucket.flush/1.

Get the value of key. If the key does not exist the special value nil is returned.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.get(:mybucket, "hello")

Callback implementation for KVX.Bucket.get/2.

Link to this function get_value(key, bucket \\ :ark_config) View Source

Returns the values of all specified keys. For every key that does not hold a string value or does not exist, the special value nil is returned. Because of this, the operation never fails.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.mget(:mybucket, ["hello", "world"])

Callback implementation for KVX.Bucket.mget/2.

Link to this function mset(bucket, kv_pairs, ttl \\ :infinity) View Source

Store this bulk data, possibly overwriting any existing data.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.mset(:mybucket, [{"a": 1}, {"b", "2"}])

Callback implementation for KVX.Bucket.mset/3.

Creates a new bucket if it doesn’t exist. If the bucket already exist, nothing happens – it works as an idempotent operation.

Example

MyBucket.new(:mybucket)

Callback implementation for KVX.Bucket.new/2.

Link to this function set(bucket, key, value, ttl \\ :infinity) View Source

Most common command. Store this data, possibly overwriting any existing data.

If bucket doesn’t exist, it will raise an argument error.

Example

MyBucket.set(:mybucket, "hello", "world")

Callback implementation for KVX.Bucket.set/4.

Link to this function set_value(key, value, bucket \\ :ark_config) View Source