<divclass="headertitle"><divclass="title">KeyValue store management<divclass="ingroups"><aclass="el"href="group__func_group.html">Functions</a>»<aclass="el"href="group__kv_group.html">KeyValue store</a></div></div></div>
<trclass="memdesc:gabc445bfe87112e56a6c73872fec6893e"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Creates a KeyValue store with a given configuration. <br/></td></tr>
<trclass="memdesc:ga54e6c109a7c633e431b3eded286e00f6"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Looks-up and binds to an existing KeyValue store. <br/></td></tr>
<trclass="memdesc:gab0d6bdbfabd27af67eaeb36cec0787da"><tdclass="mdescLeft"> </td><tdclass="mdescRight">Destroys a KeyValue store object. <br/></td></tr>
<p>These functions allow to create, get or delete a KeyValue store.</p>
<dlclass="section warning"><dt>Warning</dt><dd>EXPERIMENTAL FEATURE! We reserve the right to change the API without necessarily bumping the major version of the library. </dd></dl>
<p>Use this before setting specific <aclass="el"href="structkv_config.html">kvConfig</a> options and passing it to <aclass="el"href="group__kv_group_mgt.html#gabc445bfe87112e56a6c73872fec6893e"title="Creates a KeyValue store with a given configuration.">js_CreateKeyValue</a>.</p>
<dlclass="section see"><dt>See also</dt><dd><aclass="el"href="group__kv_group_mgt.html#gabc445bfe87112e56a6c73872fec6893e"title="Creates a KeyValue store with a given configuration.">js_CreateKeyValue</a></dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">cfg</td><td>the pointer to the stack variable <aclass="el"href="structkv_config.html">kvConfig</a> to initialize. </td></tr>
<p>Creates a KeyValue store with a given configuration.</p>
<p>Bucket names are restricted to this set of characters: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code>.</p>
<dlclass="section note"><dt>Note</dt><dd>The return <aclass="el"href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object needs to be destroyed using <aclass="el"href="group__kv_group_mgt.html#gab0d6bdbfabd27af67eaeb36cec0787da"title="Destroys a KeyValue store object.">kvStore_Destroy</a> when no longer needed to free allocated memory. This is different from deleting a KeyValue store from the server using the <aclass="el"href="group__kv_group_mgt.html#ga6bc715319560bc28359679fcdcead937"title="Deletes a KeyValue store.">js_DeleteKeyValue</a> API.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">new_kv</td><td>the location where to store the newly created <aclass="el"href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object. </td></tr>
<tr><tdclass="paramname">js</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> object. </td></tr>
<tr><tdclass="paramname">cfg</td><td>the pointer to the <aclass="el"href="structkv_config.html">kvConfig</a> configuration information used to create the <aclass="el"href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object. </td></tr>
<p>This call is when the user wants to use an existing KeyValue store. If the store does not already exists, an error is returned.</p>
<p>Bucket names are restricted to this set of characters: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code>.</p>
<dlclass="section note"><dt>Note</dt><dd>The return <aclass="el"href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object needs to be destroyed using <aclass="el"href="group__kv_group_mgt.html#gab0d6bdbfabd27af67eaeb36cec0787da"title="Destroys a KeyValue store object.">kvStore_Destroy</a> when no longer needed to free allocated memory. This is different from deleting a KeyValue store from the server using the <aclass="el"href="group__kv_group_mgt.html#ga6bc715319560bc28359679fcdcead937"title="Deletes a KeyValue store.">js_DeleteKeyValue</a> API.</dd></dl>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">new_kv</td><td>the location where to store the newly created <aclass="el"href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object. </td></tr>
<tr><tdclass="paramname">js</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> object. </td></tr>
<tr><tdclass="paramname">bucket</td><td>the name of the bucket of the existing KeyValue store. </td></tr>
<p>This will delete the KeyValue store with the <code>bucket</code> name.</p>
<p>Bucket names are restricted to this set of characters: <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, <code>_</code> and <code>-</code>.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">js</td><td>the pointer to the <aclass="el"href="group__types_group.html#gaaf12cdd24c6cc23a57c20466c92ff8c1">jsCtx</a> object. </td></tr>
<tr><tdclass="paramname">bucket</td><td>the name of the bucket of the existing KeyValue store. </td></tr>
<p>This will simply free memory resources in the library for this <aclass="el"href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a>, but does not delete the KeyValue store in the server.</p>
<dlclass="params"><dt>Parameters</dt><dd>
<tableclass="params">
<tr><tdclass="paramname">kv</td><td>the pointer to the <aclass="el"href="group__types_group.html#ga054c05493dd3cfc5c3e7a665a424e54a">kvStore</a> object. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- HTML footer for doxygen 1.8.10-->
<!-- start footer part -->
<divid="nav-path"class="navpath"><!-- id is needed for treeview function! -->
<ul>
<liclass="footer">NATS.IO Supported By Synadia Communications Inc.