GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
store_key(3) Arcan Lua API store_key(3)

store_key - Store one or several key-value pairs in the database.

true or false
store_key( argtbl or [key, val], opttgt, optcfg )

There are multiple key- value stores that can be used for keeping track of specific key value pairs. The default one is bound to the currently running appl, but there is also one connected to each execution target that can be accessed by setting opttgt to any value returned from calling list_targets . There is also an execution target configuration specific key- value store if both opttgt and optcfg are set to a valid target- configuration pair. Only characters in the set [a-Z][0-9]_/+= are valid key values.

1
The /+= are allowed to support base64 encoded values.
2
If the string length of a value field is set to 0, the key will be deleted. To set multiple pairs at once, pack them in a key- indexed table.

function store_key0()
      tbl = {key_a = "ok", key_b = "ok"};
      store_key(tbl);
      store_key("key_c", "ok");
      print(get_key("key_a"));
      print(get_key("key_b"));
      print(get_key("key_c"));
      local tgtlist = list_targets();
      if (#tgtlist > 0) then
            store_key(tbl, tgtlist[1]);
            store_key(tbl, tgtlist[1], target_configurations(tgtlist[1])[1]);
      end
end

get_key(3) match_keys(3) list_targets(3) target_configurations(3)

June 2022 database

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.