C++ edjLibrary SDK
Functions
edjx::kv Namespace Reference

APIs for interacting with EDJX KV-Store. More...

Functions

edjx::error::KVError get (std::vector< uint8_t > &result, const std::string &key)
 Returns the value associated with the provided key. More...
 
edjx::error::KVError put (const std::string &key, const std::vector< uint8_t > &val)
 Inserts a key-value pair into the KV store. More...
 
edjx::error::KVError put (const std::string &key, const std::string &val)
 Inserts a key-value pair into the KV store. More...
 
edjx::error::KVError put (const std::string &key, const std::vector< uint8_t > &val, uint64_t ttl)
 Inserts a key-value pair into the KV store. More...
 
edjx::error::KVError put (const std::string &key, const std::string &val, uint64_t ttl)
 Inserts a key-value pair into the KV store. More...
 
edjx::error::KVError remove (const std::string &key)
 Removes an entry from the KV store. More...
 

Detailed Description

APIs for interacting with EDJX KV-Store.

Function Documentation

◆ get()

edjx::error::KVError edjx::kv::get ( std::vector< uint8_t > &  result,
const std::string &  key 
)

Returns the value associated with the provided key.

Parameters
resultReturned value associated with the key
keyKey
Returns
Returns edjx::error::KVError::Success on success, some other value on failure

◆ put() [1/4]

edjx::error::KVError edjx::kv::put ( const std::string &  key,
const std::string &  val 
)

Inserts a key-value pair into the KV store.

Parameters
keyKey
valValue to be inserted for the corresponding key
Returns
Returns edjx::error::KVError::Success on success, some other value on failure

◆ put() [2/4]

edjx::error::KVError edjx::kv::put ( const std::string &  key,
const std::string &  val,
uint64_t  ttl 
)

Inserts a key-value pair into the KV store.

Parameters
keyKey
valValue to be inserted for the corresponding key
ttlTime to live (TTL) value in seconds
Returns
Returns edjx::error::KVError::Success on success, some other value on failure

◆ put() [3/4]

edjx::error::KVError edjx::kv::put ( const std::string &  key,
const std::vector< uint8_t > &  val 
)

Inserts a key-value pair into the KV store.

Parameters
keyKey
valValue to be inserted for the corresponding key
Returns
Returns edjx::error::KVError::Success on success, some other value on failure

◆ put() [4/4]

edjx::error::KVError edjx::kv::put ( const std::string &  key,
const std::vector< uint8_t > &  val,
uint64_t  ttl 
)

Inserts a key-value pair into the KV store.

Parameters
keyKey
valValue to be inserted for the corresponding key
ttlTime to live (TTL) value in seconds
Returns
Returns edjx::error::KVError::Success on success, some other value on failure

◆ remove()

edjx::error::KVError edjx::kv::remove ( const std::string &  key)

Removes an entry from the KV store.

Parameters
keyKey
Returns
Returns edjx::error::KVError::Success on success, some other value on failure