View Source SuperCache.KeyValue (SuperCache v0.6.0)

Key-Value(KV) database in memory. Can use multiple KV cache by using different KV name. This is global KV cache any process can access. The KV is store in with cache. Need to start SuperCache.start!/1 before using this module.

Summary

Functions

Add key-value to cache. Key is used to get target partition to store data. Use can use multiple kv cache by using different kv_name.

Get value by key. Key is belong wit kv_name.

Get all keys in kv_name cache.

Get all values in kv_name cache.

Functions

add(kv_name, key, value)

@spec add(atom(), any(), any()) :: true

Add key-value to cache. Key is used to get target partition to store data. Use can use multiple kv cache by using different kv_name.

get(kv_name, key, default \\ nil)

@spec get(any(), any(), any()) :: any()

Get value by key. Key is belong wit kv_name.

keys(kv_name)

@spec keys(any()) :: [any()]

Get all keys in kv_name cache.

remove(kv_name, key)

values(kv_name)

@spec values(any()) :: [any()]

Get all values in kv_name cache.