keydb.sc

keydb.sc

Module for working with key-value database.

Functions:

Keydb_clean

Removes partially stored keys from the database.

Detailed Description

Parameters

pattern

- operate only on keys matching to the pattern. The pattern is the same as accepted by Redis in the KEYS and SCAN command. (http://redis.io/commands/keys)

the result of consensus operation. True, when everything went fine, False on consensus error.

Function Overloads

bool keydb_clean(string pattern)

keydb_connect(string)

Connect to a Redis host.

Detailed Description

Parameters

host

- the name of the host to connect to. Must match one in the module configuration.

Function Overloads

void keydb_connect(string host)

keydb_del(string)

Delete a value from the database.

Detailed Description

Parameters

key

- the public key of the value to be deleted.

Function Overloads

void keydb_del(string key)

keydb_disconnect(void)

Disconnect from a Redis host.

Detailed Description

Function Overloads

void keydb_disconnect()

keydb_get(string)

Get value stored in database.

Detailed Description

T - any data type

Parameters

key

- the public key of the value.

the value stored in the database.

Function Overloads

T keydb_get(string key)

keydb_scan(string)

Start a scan of all the keys stored in the database.

Detailed Description

Parameters

pattern

- operate only on keys matching to the pattern. The pattern is the same as accepted by Redis in the KEYS and SCAN command. (http://redis.io/commands/keys)

a ScanCursor which holds the key and a cursor.

Internally this will call

keydb_clean to make sure only existing keys are returned from the scan.

Function Overloads

keydb_scan(string pattern)

keydb_scan_cursor_free(cursor)

Deallocates the given cursor without popping all the elements.

Detailed Description

Parameters

sc

- the cursor returned by previous call to keydb_scan or keydb_scan_next.

Function Overloads

void keydb_scan_cursor_free(ScanCursor sc)

keydb_scan_next(cursor)

Scan the next key from a database.

Detailed Description

Parameters

sc

the cursor returned by previous call to keydb_scan or keydb_scan_next.

a ScanCursor which holds the key and a cursor.

Function Overloads

keydb_scan_next(ScanCursor sc)

keydb_set(string, value)

Store a new value in the database.

Detailed Description

T - any data type

Parameters

key

- the public key of the value.

value

- the value to store.

Function Overloads

void keydb_set(string key, T value)

void keydb_set(string key, T[[1]] value)

ScanCursor

Structure for keydb_scan.

ScanCursor

uint64

cursor

uint64

nextKeySize

string

key

When non-zero, keydb_scan_next can be called.