| 1 |
|
| 2 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 6 |
<meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 7 |
<meta name="generator" content="Doxygen 1.9.8"/> |
| 8 |
<title>NATS C Client with JetStream and Streaming support: Object Stores</title> |
| 9 |
<link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 |
<script type="text/javascript" src="jquery.js"></script> |
| 11 |
<script type="text/javascript" src="dynsections.js"></script> |
| 12 |
<link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 13 |
<script type="text/javascript" src="resize.js"></script> |
| 14 |
<script type="text/javascript" src="navtreedata.js"></script> |
| 15 |
<script type="text/javascript" src="navtree.js"></script> |
| 16 |
<link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 17 |
<script type="text/javascript" src="search/searchdata.js"></script> |
| 18 |
<script type="text/javascript" src="search/search.js"></script> |
| 19 |
<link href="customdoxygen.css" rel="stylesheet" type="text/css" /> |
| 20 |
</head> |
| 21 |
<body> |
| 22 |
<div id="top"> |
| 23 |
<div id="titlearea"> |
| 24 |
<table cellspacing="0" cellpadding="0"> |
| 25 |
<tbody> |
| 26 |
<tr style="height: 56px;"> |
| 27 |
<td id="projectalign" style="padding-left: 0.5em;" > |
| 28 |
<div id="projectname">NATS C Client with JetStream and Streaming support |
| 29 |
 <span id="projectnumber">3.12.0</span> |
| 30 |
</div> |
| 31 |
<div id="projectbrief">The nats.io C Client, Supported by Synadia Communications Inc.</div> |
| 32 |
</td> |
| 33 |
</tr> |
| 34 |
</tbody> |
| 35 |
</table> |
| 36 |
</div> |
| 37 |
|
| 38 |
|
| 39 |
<script type="text/javascript"> |
| 40 |
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ |
| 41 |
var searchBox = new SearchBox("searchBox", "search/",'.html'); |
| 42 |
/* @license-end */ |
| 43 |
</script> |
| 44 |
<script type="text/javascript" src="menudata.js"></script> |
| 45 |
<script type="text/javascript" src="menu.js"></script> |
| 46 |
<script type="text/javascript"> |
| 47 |
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ |
| 48 |
$(function() { |
| 49 |
initMenu('',true,false,'search.php','Search'); |
| 50 |
$(document).ready(function() { init_search(); }); |
| 51 |
}); |
| 52 |
/* @license-end */ |
| 53 |
</script> |
| 54 |
<div id="main-nav"></div> |
| 55 |
</div> |
| 56 |
<div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 57 |
<div id="nav-tree"> |
| 58 |
<div id="nav-tree-contents"> |
| 59 |
<div id="nav-sync" class="sync"></div> |
| 60 |
</div> |
| 61 |
</div> |
| 62 |
<div id="splitbar" style="-moz-user-select:none;" |
| 63 |
class="ui-resizable-handle"> |
| 64 |
</div> |
| 65 |
</div> |
| 66 |
<script type="text/javascript"> |
| 67 |
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ |
| 68 |
$(document).ready(function(){initNavTree('group__obs_group.html',''); initResizable(); }); |
| 69 |
/* @license-end */ |
| 70 |
</script> |
| 71 |
<div id="doc-content"> |
| 72 |
|
| 73 |
<div id="MSearchSelectWindow" |
| 74 |
onmouseover="return searchBox.OnSearchSelectShow()" |
| 75 |
onmouseout="return searchBox.OnSearchSelectHide()" |
| 76 |
onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 77 |
</div> |
| 78 |
|
| 79 |
|
| 80 |
<div id="MSearchResultsWindow"> |
| 81 |
<div id="MSearchResults"> |
| 82 |
<div class="SRPage"> |
| 83 |
<div id="SRIndex"> |
| 84 |
<div id="SRResults"></div> |
| 85 |
<div class="SRStatus" id="Loading">Loading...</div> |
| 86 |
<div class="SRStatus" id="Searching">Searching...</div> |
| 87 |
<div class="SRStatus" id="NoMatches">No Matches</div> |
| 88 |
</div> |
| 89 |
</div> |
| 90 |
</div> |
| 91 |
</div> |
| 92 |
|
| 93 |
<div class="header"> |
| 94 |
<div class="summary"> |
| 95 |
<a href="#groups">Modules</a> | |
| 96 |
<a href="#func-members">Functions</a> </div> |
| 97 |
<div class="headertitle"><div class="title">Object Stores<div class="ingroups"><a class="el" href="group__func_group.html">Functions</a></div></div></div> |
| 98 |
</div> |
| 99 |
<div class="contents"> |
| 100 |
<table class="memberdecls"> |
| 101 |
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a> |
| 102 |
Modules</h2></td></tr> |
| 103 |
<tr class="memitem:group__obs_group_mgt" id="r_group__obs_group_mgt"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group_mgt.html">Object Stores management</a></td></tr> |
| 104 |
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> |
| 105 |
<tr class="memitem:group__obs_mgt" id="r_group__obs_mgt"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_mgt.html">Object Store management</a></td></tr> |
| 106 |
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> |
| 107 |
</table><table class="memberdecls"> |
| 108 |
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a> |
| 109 |
Functions</h2></td></tr> |
| 110 |
<tr class="memitem:gab10be9afeb87609da24f10ea25556412" id="r_gab10be9afeb87609da24f10ea25556412"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gab10be9afeb87609da24f10ea25556412">objStoreMeta_Init</a> (<a class="el" href="structobj_store_meta.html">objStoreMeta</a> *meta)</td></tr> |
| 111 |
<tr class="memdesc:gab10be9afeb87609da24f10ea25556412"><td class="mdescLeft"> </td><td class="mdescRight">Initializes an object store meta structure. <br /></td></tr> |
| 112 |
<tr class="separator:gab10be9afeb87609da24f10ea25556412"><td class="memSeparator" colspan="2"> </td></tr> |
| 113 |
<tr class="memitem:ga7f905e1cda4e13b4a44f0e614adec6b6" id="r_ga7f905e1cda4e13b4a44f0e614adec6b6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#ga7f905e1cda4e13b4a44f0e614adec6b6">objStore_Put</a> (<a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> **new_put, <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> *obs, <a class="el" href="structobj_store_meta.html">objStoreMeta</a> *meta)</td></tr> |
| 114 |
<tr class="memdesc:ga7f905e1cda4e13b4a44f0e614adec6b6"><td class="mdescLeft"> </td><td class="mdescRight">Initiates a session to put bytes into an object. <br /></td></tr> |
| 115 |
<tr class="separator:ga7f905e1cda4e13b4a44f0e614adec6b6"><td class="memSeparator" colspan="2"> </td></tr> |
| 116 |
<tr class="memitem:ga1c406a0cc622f74dff298baa6df14ee2" id="r_ga1c406a0cc622f74dff298baa6df14ee2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#ga1c406a0cc622f74dff298baa6df14ee2">objStorePut_Add</a> (<a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> *put, const void *data, int dataLen)</td></tr> |
| 117 |
<tr class="memdesc:ga1c406a0cc622f74dff298baa6df14ee2"><td class="mdescLeft"> </td><td class="mdescRight">Add data to the object. <br /></td></tr> |
| 118 |
<tr class="separator:ga1c406a0cc622f74dff298baa6df14ee2"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 |
<tr class="memitem:gab72474e93b75b51c381117c85efa84e4" id="r_gab72474e93b75b51c381117c85efa84e4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gab72474e93b75b51c381117c85efa84e4">objStorePut_Complete</a> (<a class="el" href="structobj_store_info.html">objStoreInfo</a> **new_info, <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> *put, int64_t timeout)</td></tr> |
| 120 |
<tr class="memdesc:gab72474e93b75b51c381117c85efa84e4"><td class="mdescLeft"> </td><td class="mdescRight">Complete a put operation. <br /></td></tr> |
| 121 |
<tr class="separator:gab72474e93b75b51c381117c85efa84e4"><td class="memSeparator" colspan="2"> </td></tr> |
| 122 |
<tr class="memitem:gac40222ed56aaeac0955a3a87819f7ed7" id="r_gac40222ed56aaeac0955a3a87819f7ed7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gac40222ed56aaeac0955a3a87819f7ed7">objStorePut_Destroy</a> (<a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> *put)</td></tr> |
| 123 |
<tr class="memdesc:gac40222ed56aaeac0955a3a87819f7ed7"><td class="mdescLeft"> </td><td class="mdescRight">Destroys the object store's put object. <br /></td></tr> |
| 124 |
<tr class="separator:gac40222ed56aaeac0955a3a87819f7ed7"><td class="memSeparator" colspan="2"> </td></tr> |
| 125 |
<tr class="memitem:gac0484b53e470c6a6821df662eb52922e" id="r_gac0484b53e470c6a6821df662eb52922e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gac0484b53e470c6a6821df662eb52922e">objStore_PutString</a> (<a class="el" href="structobj_store_info.html">objStoreInfo</a> **new_info, <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> *obs, const char *name, const char *data)</td></tr> |
| 126 |
<tr class="memdesc:gac0484b53e470c6a6821df662eb52922e"><td class="mdescLeft"> </td><td class="mdescRight">Put a string into this object. <br /></td></tr> |
| 127 |
<tr class="separator:gac0484b53e470c6a6821df662eb52922e"><td class="memSeparator" colspan="2"> </td></tr> |
| 128 |
<tr class="memitem:gabfc126056112ae8522a70ace6900e3a3" id="r_gabfc126056112ae8522a70ace6900e3a3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gabfc126056112ae8522a70ace6900e3a3">objStore_PutBytes</a> (<a class="el" href="structobj_store_info.html">objStoreInfo</a> **new_info, <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> *obs, const char *name, const void *data, int dataLen)</td></tr> |
| 129 |
<tr class="memdesc:gabfc126056112ae8522a70ace6900e3a3"><td class="mdescLeft"> </td><td class="mdescRight">Put bytes into this object. <br /></td></tr> |
| 130 |
<tr class="separator:gabfc126056112ae8522a70ace6900e3a3"><td class="memSeparator" colspan="2"> </td></tr> |
| 131 |
<tr class="memitem:ga792f04ea3c22e1a0aebdbbc38c62ff04" id="r_ga792f04ea3c22e1a0aebdbbc38c62ff04"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#ga792f04ea3c22e1a0aebdbbc38c62ff04">objStore_PutFile</a> (<a class="el" href="structobj_store_info.html">objStoreInfo</a> **new_info, <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> *obs, const char *fileName)</td></tr> |
| 132 |
<tr class="memdesc:ga792f04ea3c22e1a0aebdbbc38c62ff04"><td class="mdescLeft"> </td><td class="mdescRight">Put the content of a file into this object. <br /></td></tr> |
| 133 |
<tr class="separator:ga792f04ea3c22e1a0aebdbbc38c62ff04"><td class="memSeparator" colspan="2"> </td></tr> |
| 134 |
<tr class="memitem:gab967cd5a4c6ed2b403ec9baa374543eb" id="r_gab967cd5a4c6ed2b403ec9baa374543eb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gab967cd5a4c6ed2b403ec9baa374543eb">objStore_Get</a> (<a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> **new_get, <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> *obs, const char *name, <a class="el" href="structobj_store_options.html">objStoreOptions</a> *opts)</td></tr> |
| 135 |
<tr class="memdesc:gab967cd5a4c6ed2b403ec9baa374543eb"><td class="mdescLeft"> </td><td class="mdescRight">Pull the named object from the object store. <br /></td></tr> |
| 136 |
<tr class="separator:gab967cd5a4c6ed2b403ec9baa374543eb"><td class="memSeparator" colspan="2"> </td></tr> |
| 137 |
<tr class="memitem:gad599fef84e3e015d0d8c1e62c9e1b986" id="r_gad599fef84e3e015d0d8c1e62c9e1b986"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gad599fef84e3e015d0d8c1e62c9e1b986">objStoreGet_Info</a> (const <a class="el" href="structobj_store_info.html">objStoreInfo</a> **new_info, <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> *get)</td></tr> |
| 138 |
<tr class="memdesc:gad599fef84e3e015d0d8c1e62c9e1b986"><td class="mdescLeft"> </td><td class="mdescRight">Returns a handle to the information object own by the <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object. <br /></td></tr> |
| 139 |
<tr class="separator:gad599fef84e3e015d0d8c1e62c9e1b986"><td class="memSeparator" colspan="2"> </td></tr> |
| 140 |
<tr class="memitem:gab4388a36f33aff20a5b8a0b32b3a6b64" id="r_gab4388a36f33aff20a5b8a0b32b3a6b64"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gab4388a36f33aff20a5b8a0b32b3a6b64">objStoreGet_Read</a> (bool *done, void **new_data, int *dataLen, <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> *get, int64_t timeout)</td></tr> |
| 141 |
<tr class="memdesc:gab4388a36f33aff20a5b8a0b32b3a6b64"><td class="mdescLeft"> </td><td class="mdescRight">Returns some bytes of the pulled object. <br /></td></tr> |
| 142 |
<tr class="separator:gab4388a36f33aff20a5b8a0b32b3a6b64"><td class="memSeparator" colspan="2"> </td></tr> |
| 143 |
<tr class="memitem:ga4ac8b8af8aee703a07acfd56d47cc7c5" id="r_ga4ac8b8af8aee703a07acfd56d47cc7c5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#ga4ac8b8af8aee703a07acfd56d47cc7c5">objStoreGet_ReadAll</a> (void **new_data, int *dataLen, <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> *get, int64_t timeout)</td></tr> |
| 144 |
<tr class="memdesc:ga4ac8b8af8aee703a07acfd56d47cc7c5"><td class="mdescLeft"> </td><td class="mdescRight">Returns the remaining bytes of the pulled object. <br /></td></tr> |
| 145 |
<tr class="separator:ga4ac8b8af8aee703a07acfd56d47cc7c5"><td class="memSeparator" colspan="2"> </td></tr> |
| 146 |
<tr class="memitem:ga24d9fdf73cae9cc89e889128d6de8243" id="r_ga24d9fdf73cae9cc89e889128d6de8243"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#ga24d9fdf73cae9cc89e889128d6de8243">objStoreGet_Destroy</a> (<a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> *get)</td></tr> |
| 147 |
<tr class="memdesc:ga24d9fdf73cae9cc89e889128d6de8243"><td class="mdescLeft"> </td><td class="mdescRight">Destroys the object store's get object. <br /></td></tr> |
| 148 |
<tr class="separator:ga24d9fdf73cae9cc89e889128d6de8243"><td class="memSeparator" colspan="2"> </td></tr> |
| 149 |
<tr class="memitem:gab7f016290a9a0407ebb7824461a506b7" id="r_gab7f016290a9a0407ebb7824461a506b7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gab7f016290a9a0407ebb7824461a506b7">objStore_GetString</a> (char **new_str, <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> *obs, const char *name, <a class="el" href="structobj_store_options.html">objStoreOptions</a> *opts)</td></tr> |
| 150 |
<tr class="memdesc:gab7f016290a9a0407ebb7824461a506b7"><td class="mdescLeft"> </td><td class="mdescRight">Pull the named object from the object store and return it as a string. <br /></td></tr> |
| 151 |
<tr class="separator:gab7f016290a9a0407ebb7824461a506b7"><td class="memSeparator" colspan="2"> </td></tr> |
| 152 |
<tr class="memitem:gafb7f87a99c7e2b0fe14f8044bb82e032" id="r_gafb7f87a99c7e2b0fe14f8044bb82e032"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gafb7f87a99c7e2b0fe14f8044bb82e032">objStore_GetBytes</a> (void **new_data, int *dataLen, <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> *obs, const char *name, <a class="el" href="structobj_store_options.html">objStoreOptions</a> *opts)</td></tr> |
| 153 |
<tr class="memdesc:gafb7f87a99c7e2b0fe14f8044bb82e032"><td class="mdescLeft"> </td><td class="mdescRight">Pull the named object from the object store and return it as a byte array. <br /></td></tr> |
| 154 |
<tr class="separator:gafb7f87a99c7e2b0fe14f8044bb82e032"><td class="memSeparator" colspan="2"> </td></tr> |
| 155 |
<tr class="memitem:gab8ac22b959354953c88119d3c1a74408" id="r_gab8ac22b959354953c88119d3c1a74408"><td class="memItemLeft" align="right" valign="top"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group__obs_group.html#gab8ac22b959354953c88119d3c1a74408">objStore_GetFile</a> (<a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> *obs, const char *name, const char *fileName, <a class="el" href="structobj_store_options.html">objStoreOptions</a> *opts)</td></tr> |
| 156 |
<tr class="memdesc:gab8ac22b959354953c88119d3c1a74408"><td class="mdescLeft"> </td><td class="mdescRight">Pull the named object from the object store and place it into a file. <br /></td></tr> |
| 157 |
<tr class="separator:gab8ac22b959354953c88119d3c1a74408"><td class="memSeparator" colspan="2"> </td></tr> |
| 158 |
</table> |
| 159 |
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 160 |
<p>Object Stores offer a straightforward method for storing large objects within JetStream. These stores are backed by a specially configured streams, designed to efficiently and compactly store these objects.</p> |
| 161 |
<p>The Object Store, also known as a bucket, enables the execution of various operations:</p> |
| 162 |
<ul> |
| 163 |
<li>create an object store</li> |
| 164 |
<li>update an object store</li> |
| 165 |
<li>get an object store</li> |
| 166 |
<li>delete an object store</li> |
| 167 |
<li>list all objects in a bucket</li> |
| 168 |
<li>watch for changes on objects in a bucket</li> |
| 169 |
<li>create links to other objects or other buckets</li> |
| 170 |
</ul> |
| 171 |
<dl class="section warning"><dt>Warning</dt><dd>Object Stores needs TLS to be able to generate and check SHA256 object digests. If the library is compiled without TLS support, some of the features will still work, but "put" and "get" operations will fail. </dd></dl> |
| 172 |
<h2 class="groupheader">Function Documentation</h2> |
| 173 |
<a id="gab10be9afeb87609da24f10ea25556412" name="gab10be9afeb87609da24f10ea25556412"></a> |
| 174 |
<h2 class="memtitle"><span class="permalink"><a href="#gab10be9afeb87609da24f10ea25556412">◆ </a></span>objStoreMeta_Init()</h2> |
| 175 |
|
| 176 |
<div class="memitem"> |
| 177 |
<div class="memproto"> |
| 178 |
<table class="memname"> |
| 179 |
<tr> |
| 180 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStoreMeta_Init </td> |
| 181 |
<td>(</td> |
| 182 |
<td class="paramtype"><a class="el" href="structobj_store_meta.html">objStoreMeta</a> * </td> |
| 183 |
<td class="paramname"><em>meta</em></td><td>)</td> |
| 184 |
<td></td> |
| 185 |
</tr> |
| 186 |
</table> |
| 187 |
</div><div class="memdoc"> |
| 188 |
<p>Typically, the user will declare an <a class="el" href="structobj_store_meta.html">objStoreMeta</a> variable on the stack and call this function to initializes the structure, set some fields and pass it to an API.</p> |
| 189 |
<div class="fragment"><div class="line">objStoreMeta meta;</div> |
| 190 |
<div class="line"> </div> |
| 191 |
<div class="line">objStoreMeta_Init(&meta);</div> |
| 192 |
<div class="line">meta.Name = "test";</div> |
| 193 |
<div class="line">s = objStore_Put(&put, obs, &meta);</div> |
| 194 |
<div class="line">...</div> |
| 195 |
</div><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_group.html#ga7f905e1cda4e13b4a44f0e614adec6b6" title="Initiates a session to put bytes into an object.">objStore_Put</a></dd></dl> |
| 196 |
<dl class="params"><dt>Parameters</dt><dd> |
| 197 |
<table class="params"> |
| 198 |
<tr><td class="paramname">meta</td><td>the pointer to the <a class="el" href="structobj_store_meta.html">objStoreMeta</a> structure to initialize. </td></tr> |
| 199 |
</table> |
| 200 |
</dd> |
| 201 |
</dl> |
| 202 |
|
| 203 |
</div> |
| 204 |
</div> |
| 205 |
<a id="ga7f905e1cda4e13b4a44f0e614adec6b6" name="ga7f905e1cda4e13b4a44f0e614adec6b6"></a> |
| 206 |
<h2 class="memtitle"><span class="permalink"><a href="#ga7f905e1cda4e13b4a44f0e614adec6b6">◆ </a></span>objStore_Put()</h2> |
| 207 |
|
| 208 |
<div class="memitem"> |
| 209 |
<div class="memproto"> |
| 210 |
<table class="memname"> |
| 211 |
<tr> |
| 212 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStore_Put </td> |
| 213 |
<td>(</td> |
| 214 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> ** </td> |
| 215 |
<td class="paramname"><em>new_put</em>, </td> |
| 216 |
</tr> |
| 217 |
<tr> |
| 218 |
<td class="paramkey"></td> |
| 219 |
<td></td> |
| 220 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> * </td> |
| 221 |
<td class="paramname"><em>obs</em>, </td> |
| 222 |
</tr> |
| 223 |
<tr> |
| 224 |
<td class="paramkey"></td> |
| 225 |
<td></td> |
| 226 |
<td class="paramtype"><a class="el" href="structobj_store_meta.html">objStoreMeta</a> * </td> |
| 227 |
<td class="paramname"><em>meta</em> </td> |
| 228 |
</tr> |
| 229 |
<tr> |
| 230 |
<td></td> |
| 231 |
<td>)</td> |
| 232 |
<td></td><td></td> |
| 233 |
</tr> |
| 234 |
</table> |
| 235 |
</div><div class="memdoc"> |
| 236 |
<p>If the object already exists, it will be overwritten. The object name is required and taken from the <a class="el" href="structobj_store_meta.html#a30cb6788f1a84a392028e08be35791a7" title="Name is the name of the object.">objStoreMeta.Name</a> field.</p> |
| 237 |
<p>On success, an <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> object will be returned. This should then be passed to the functions to add and complete the put operation.</p> |
| 238 |
<dl class="section note"><dt>Note</dt><dd>The returned <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> object needs be destroyed using <a class="el" href="group__obs_group.html#gac40222ed56aaeac0955a3a87819f7ed7" title="Destroys the object store's put object.">objStorePut_Destroy</a> when no longer needed to free allocated memory.</dd></dl> |
| 239 |
<div class="fragment"><div class="line">objStoreMeta meta;</div> |
| 240 |
<div class="line">objStorePut *put = NULL;</div> |
| 241 |
<div class="line">objStoreInfo *info = NULL;</div> |
| 242 |
<div class="line"> </div> |
| 243 |
<div class="line">objStoreMeta_Init(&meta);</div> |
| 244 |
<div class="line">meta.Name = "test";</div> |
| 245 |
<div class="line">s = objStore_Put(&put, obs, &meta);</div> |
| 246 |
<div class="line">if (s == NATS_OK)</div> |
| 247 |
<div class="line">{</div> |
| 248 |
<div class="line"> natsStatus addSts = NATS_OK;</div> |
| 249 |
<div class="line"> </div> |
| 250 |
<div class="line"> while ((addSts == NATS_OK) && hasMoreDataToAdd)</div> |
| 251 |
<div class="line"> {</div> |
| 252 |
<div class="line"> // Get some data from somewhere...</div> |
| 253 |
<div class="line"> addSts = objStorePut_Add(put, data, dataLen);</div> |
| 254 |
<div class="line"> // If data needs to be freed, it is safe to do it after the "Add" call.</div> |
| 255 |
<div class="line"> ...</div> |
| 256 |
<div class="line"> }</div> |
| 257 |
<div class="line"> // We are done adding data, call "Complete". We should invoke this even</div> |
| 258 |
<div class="line"> // if there were issues adding data. The call will then purge partial chunks.</div> |
| 259 |
<div class="line"> // The last param is the timeout for operation to complete, here using 3 seconds.</div> |
| 260 |
<div class="line"> s = objStorePut_Complete(&info, put, 3000);</div> |
| 261 |
<div class="line">}</div> |
| 262 |
<div class="line">// At this point, the "put" operation is complete. On success, we would have an `info`</div> |
| 263 |
<div class="line">// variable that can be inspected. If not needed, `NULL` should have been passed to</div> |
| 264 |
<div class="line">// the `objStorePut_Complete` call.</div> |
| 265 |
<div class="line">if (s == NATS_OK)</div> |
| 266 |
<div class="line">{</div> |
| 267 |
<div class="line"> // Inspect the info if needed.</div> |
| 268 |
<div class="line">}</div> |
| 269 |
<div class="line">// Now we need to destroy both object. No need to check for `NULL` (as long as you</div> |
| 270 |
<div class="line">properly initialized them to `NULL`) since the calls internally check for that.</div> |
| 271 |
<div class="line">objStoreInfo_Destroy(info);</div> |
| 272 |
<div class="line">objStorePut_Destroy(put);</div> |
| 273 |
<div class="line">...</div> |
| 274 |
</div><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_group.html#gab10be9afeb87609da24f10ea25556412" title="Initializes an object store meta structure.">objStoreMeta_Init</a> </dd> |
| 275 |
<dd> |
| 276 |
<a class="el" href="group__obs_group.html#ga1c406a0cc622f74dff298baa6df14ee2" title="Add data to the object.">objStorePut_Add</a> </dd> |
| 277 |
<dd> |
| 278 |
<a class="el" href="group__obs_group.html#gab72474e93b75b51c381117c85efa84e4" title="Complete a put operation.">objStorePut_Complete</a> </dd> |
| 279 |
<dd> |
| 280 |
<a class="el" href="group__obs_group.html#gac40222ed56aaeac0955a3a87819f7ed7" title="Destroys the object store's put object.">objStorePut_Destroy</a></dd></dl> |
| 281 |
<dl class="params"><dt>Parameters</dt><dd> |
| 282 |
<table class="params"> |
| 283 |
<tr><td class="paramname">new_put</td><td>the location where to store the pointer to the <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> object. </td></tr> |
| 284 |
<tr><td class="paramname">obs</td><td>the pointer to the <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> object. </td></tr> |
| 285 |
<tr><td class="paramname">meta</td><td>the pointer to the <a class="el" href="structobj_store_meta.html">objStoreMeta</a> object. </td></tr> |
| 286 |
</table> |
| 287 |
</dd> |
| 288 |
</dl> |
| 289 |
|
| 290 |
</div> |
| 291 |
</div> |
| 292 |
<a id="ga1c406a0cc622f74dff298baa6df14ee2" name="ga1c406a0cc622f74dff298baa6df14ee2"></a> |
| 293 |
<h2 class="memtitle"><span class="permalink"><a href="#ga1c406a0cc622f74dff298baa6df14ee2">◆ </a></span>objStorePut_Add()</h2> |
| 294 |
|
| 295 |
<div class="memitem"> |
| 296 |
<div class="memproto"> |
| 297 |
<table class="memname"> |
| 298 |
<tr> |
| 299 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStorePut_Add </td> |
| 300 |
<td>(</td> |
| 301 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> * </td> |
| 302 |
<td class="paramname"><em>put</em>, </td> |
| 303 |
</tr> |
| 304 |
<tr> |
| 305 |
<td class="paramkey"></td> |
| 306 |
<td></td> |
| 307 |
<td class="paramtype">const void * </td> |
| 308 |
<td class="paramname"><em>data</em>, </td> |
| 309 |
</tr> |
| 310 |
<tr> |
| 311 |
<td class="paramkey"></td> |
| 312 |
<td></td> |
| 313 |
<td class="paramtype">int </td> |
| 314 |
<td class="paramname"><em>dataLen</em> </td> |
| 315 |
</tr> |
| 316 |
<tr> |
| 317 |
<td></td> |
| 318 |
<td>)</td> |
| 319 |
<td></td><td></td> |
| 320 |
</tr> |
| 321 |
</table> |
| 322 |
</div><div class="memdoc"> |
| 323 |
<p>After successfully calling <a class="el" href="group__obs_group.html#ga7f905e1cda4e13b4a44f0e614adec6b6" title="Initiates a session to put bytes into an object.">objStore_Put</a>, the returned <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> object is used by this function to add bytes to the object. When there is no more data to add, call <a class="el" href="group__obs_group.html#gab72474e93b75b51c381117c85efa84e4" title="Complete a put operation.">objStorePut_Complete</a> to complete the operation.</p> |
| 324 |
<p>If an error occurs, invoking this function again will immediately error out. The only outcome is to call <a class="el" href="group__obs_group.html#gab72474e93b75b51c381117c85efa84e4" title="Complete a put operation.">objStorePut_Complete</a> to undo the partial additions and free the object.</p> |
| 325 |
<p>See <a class="el" href="group__obs_group.html#ga7f905e1cda4e13b4a44f0e614adec6b6" title="Initiates a session to put bytes into an object.">objStore_Put</a> for an example on how to use the set of APIs.</p> |
| 326 |
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_group.html#ga7f905e1cda4e13b4a44f0e614adec6b6" title="Initiates a session to put bytes into an object.">objStore_Put</a> </dd> |
| 327 |
<dd> |
| 328 |
<a class="el" href="group__obs_group.html#gab72474e93b75b51c381117c85efa84e4" title="Complete a put operation.">objStorePut_Complete</a></dd></dl> |
| 329 |
<dl class="params"><dt>Parameters</dt><dd> |
| 330 |
<table class="params"> |
| 331 |
<tr><td class="paramname">put</td><td>the pointer to the <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> object. </td></tr> |
| 332 |
<tr><td class="paramname">data</td><td>the pointer to the byte array to add to the object. </td></tr> |
| 333 |
<tr><td class="paramname">dataLen</td><td>the number of bytes of the byte array to add. </td></tr> |
| 334 |
</table> |
| 335 |
</dd> |
| 336 |
</dl> |
| 337 |
|
| 338 |
</div> |
| 339 |
</div> |
| 340 |
<a id="gab72474e93b75b51c381117c85efa84e4" name="gab72474e93b75b51c381117c85efa84e4"></a> |
| 341 |
<h2 class="memtitle"><span class="permalink"><a href="#gab72474e93b75b51c381117c85efa84e4">◆ </a></span>objStorePut_Complete()</h2> |
| 342 |
|
| 343 |
<div class="memitem"> |
| 344 |
<div class="memproto"> |
| 345 |
<table class="memname"> |
| 346 |
<tr> |
| 347 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStorePut_Complete </td> |
| 348 |
<td>(</td> |
| 349 |
<td class="paramtype"><a class="el" href="structobj_store_info.html">objStoreInfo</a> ** </td> |
| 350 |
<td class="paramname"><em>new_info</em>, </td> |
| 351 |
</tr> |
| 352 |
<tr> |
| 353 |
<td class="paramkey"></td> |
| 354 |
<td></td> |
| 355 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> * </td> |
| 356 |
<td class="paramname"><em>put</em>, </td> |
| 357 |
</tr> |
| 358 |
<tr> |
| 359 |
<td class="paramkey"></td> |
| 360 |
<td></td> |
| 361 |
<td class="paramtype">int64_t </td> |
| 362 |
<td class="paramname"><em>timeout</em> </td> |
| 363 |
</tr> |
| 364 |
<tr> |
| 365 |
<td></td> |
| 366 |
<td>)</td> |
| 367 |
<td></td><td></td> |
| 368 |
</tr> |
| 369 |
</table> |
| 370 |
</div><div class="memdoc"> |
| 371 |
<p>After adding data, this call will complete the operation and on success return the <a class="el" href="structobj_store_info.html">objStoreInfo</a> (if desired).</p> |
| 372 |
<p>If there were errors adding the data, this function will purge the partial data added.</p> |
| 373 |
<dl class="section note"><dt>Note</dt><dd>The returned <a class="el" href="structobj_store_info.html">objStoreInfo</a> object needs be destroyed using <a class="el" href="group__obs_mgt.html#ga022cb685f1c3861d76dbb168446a23d1" title="Destroys the ObjectStore information object.">objStoreInfo_Destroy</a> when no longer needed to free allocated memory.</dd></dl> |
| 374 |
<dl class="params"><dt>Parameters</dt><dd> |
| 375 |
<table class="params"> |
| 376 |
<tr><td class="paramname">new_info</td><td>the location where to store the pointer to the <a class="el" href="structobj_store_info.html">objStoreInfo</a> object, or <code>NULL</code> if not needed. </td></tr> |
| 377 |
<tr><td class="paramname">put</td><td>the pointer to the <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> object. </td></tr> |
| 378 |
<tr><td class="paramname">timeout</td><td>the amount of time (in milliseconds) to wait for the operation to complete. </td></tr> |
| 379 |
</table> |
| 380 |
</dd> |
| 381 |
</dl> |
| 382 |
|
| 383 |
</div> |
| 384 |
</div> |
| 385 |
<a id="gac40222ed56aaeac0955a3a87819f7ed7" name="gac40222ed56aaeac0955a3a87819f7ed7"></a> |
| 386 |
<h2 class="memtitle"><span class="permalink"><a href="#gac40222ed56aaeac0955a3a87819f7ed7">◆ </a></span>objStorePut_Destroy()</h2> |
| 387 |
|
| 388 |
<div class="memitem"> |
| 389 |
<div class="memproto"> |
| 390 |
<table class="memname"> |
| 391 |
<tr> |
| 392 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void objStorePut_Destroy </td> |
| 393 |
<td>(</td> |
| 394 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> * </td> |
| 395 |
<td class="paramname"><em>put</em></td><td>)</td> |
| 396 |
<td></td> |
| 397 |
</tr> |
| 398 |
</table> |
| 399 |
</div><div class="memdoc"> |
| 400 |
<p>Releases memory allocated for this <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> object.</p> |
| 401 |
<dl class="section note"><dt>Note</dt><dd>If there were errors and the put operation did not complete, this function will attempt to purge the data that was partially added.</dd></dl> |
| 402 |
<dl class="params"><dt>Parameters</dt><dd> |
| 403 |
<table class="params"> |
| 404 |
<tr><td class="paramname">put</td><td>the pointer to the <a class="el" href="group__types_group.html#ga00926d2a2f92b993a9e488491f68f2da">objStorePut</a> object. </td></tr> |
| 405 |
</table> |
| 406 |
</dd> |
| 407 |
</dl> |
| 408 |
|
| 409 |
</div> |
| 410 |
</div> |
| 411 |
<a id="gac0484b53e470c6a6821df662eb52922e" name="gac0484b53e470c6a6821df662eb52922e"></a> |
| 412 |
<h2 class="memtitle"><span class="permalink"><a href="#gac0484b53e470c6a6821df662eb52922e">◆ </a></span>objStore_PutString()</h2> |
| 413 |
|
| 414 |
<div class="memitem"> |
| 415 |
<div class="memproto"> |
| 416 |
<table class="memname"> |
| 417 |
<tr> |
| 418 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStore_PutString </td> |
| 419 |
<td>(</td> |
| 420 |
<td class="paramtype"><a class="el" href="structobj_store_info.html">objStoreInfo</a> ** </td> |
| 421 |
<td class="paramname"><em>new_info</em>, </td> |
| 422 |
</tr> |
| 423 |
<tr> |
| 424 |
<td class="paramkey"></td> |
| 425 |
<td></td> |
| 426 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> * </td> |
| 427 |
<td class="paramname"><em>obs</em>, </td> |
| 428 |
</tr> |
| 429 |
<tr> |
| 430 |
<td class="paramkey"></td> |
| 431 |
<td></td> |
| 432 |
<td class="paramtype">const char * </td> |
| 433 |
<td class="paramname"><em>name</em>, </td> |
| 434 |
</tr> |
| 435 |
<tr> |
| 436 |
<td class="paramkey"></td> |
| 437 |
<td></td> |
| 438 |
<td class="paramtype">const char * </td> |
| 439 |
<td class="paramname"><em>data</em> </td> |
| 440 |
</tr> |
| 441 |
<tr> |
| 442 |
<td></td> |
| 443 |
<td>)</td> |
| 444 |
<td></td><td></td> |
| 445 |
</tr> |
| 446 |
</table> |
| 447 |
</div><div class="memdoc"> |
| 448 |
<p>This is a convenience function to put a string into this object store under the given name.</p> |
| 449 |
<p>An <a class="el" href="structobj_store_info.html">objStoreInfo</a> will be returned, containing the object's metadata, digest and instance information.</p> |
| 450 |
<dl class="section note"><dt>Note</dt><dd>The returned <a class="el" href="structobj_store_info.html">objStoreInfo</a> object needs be destroyed using <a class="el" href="group__obs_mgt.html#ga022cb685f1c3861d76dbb168446a23d1" title="Destroys the ObjectStore information object.">objStoreInfo_Destroy</a> when no longer needed to free allocated memory.</dd></dl> |
| 451 |
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_mgt.html#ga022cb685f1c3861d76dbb168446a23d1" title="Destroys the ObjectStore information object.">objStoreInfo_Destroy</a></dd></dl> |
| 452 |
<dl class="params"><dt>Parameters</dt><dd> |
| 453 |
<table class="params"> |
| 454 |
<tr><td class="paramname">new_info</td><td>the location where to store the pointer to the <a class="el" href="structobj_store_info.html">objStoreInfo</a> object, or <code>NULL</code> if not needed. </td></tr> |
| 455 |
<tr><td class="paramname">obs</td><td>the pointer to the <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> object. </td></tr> |
| 456 |
<tr><td class="paramname">name</td><td>the name of the object to put the string into. </td></tr> |
| 457 |
<tr><td class="paramname">data</td><td>the string to put into the object. </td></tr> |
| 458 |
</table> |
| 459 |
</dd> |
| 460 |
</dl> |
| 461 |
|
| 462 |
</div> |
| 463 |
</div> |
| 464 |
<a id="gabfc126056112ae8522a70ace6900e3a3" name="gabfc126056112ae8522a70ace6900e3a3"></a> |
| 465 |
<h2 class="memtitle"><span class="permalink"><a href="#gabfc126056112ae8522a70ace6900e3a3">◆ </a></span>objStore_PutBytes()</h2> |
| 466 |
|
| 467 |
<div class="memitem"> |
| 468 |
<div class="memproto"> |
| 469 |
<table class="memname"> |
| 470 |
<tr> |
| 471 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStore_PutBytes </td> |
| 472 |
<td>(</td> |
| 473 |
<td class="paramtype"><a class="el" href="structobj_store_info.html">objStoreInfo</a> ** </td> |
| 474 |
<td class="paramname"><em>new_info</em>, </td> |
| 475 |
</tr> |
| 476 |
<tr> |
| 477 |
<td class="paramkey"></td> |
| 478 |
<td></td> |
| 479 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> * </td> |
| 480 |
<td class="paramname"><em>obs</em>, </td> |
| 481 |
</tr> |
| 482 |
<tr> |
| 483 |
<td class="paramkey"></td> |
| 484 |
<td></td> |
| 485 |
<td class="paramtype">const char * </td> |
| 486 |
<td class="paramname"><em>name</em>, </td> |
| 487 |
</tr> |
| 488 |
<tr> |
| 489 |
<td class="paramkey"></td> |
| 490 |
<td></td> |
| 491 |
<td class="paramtype">const void * </td> |
| 492 |
<td class="paramname"><em>data</em>, </td> |
| 493 |
</tr> |
| 494 |
<tr> |
| 495 |
<td class="paramkey"></td> |
| 496 |
<td></td> |
| 497 |
<td class="paramtype">int </td> |
| 498 |
<td class="paramname"><em>dataLen</em> </td> |
| 499 |
</tr> |
| 500 |
<tr> |
| 501 |
<td></td> |
| 502 |
<td>)</td> |
| 503 |
<td></td><td></td> |
| 504 |
</tr> |
| 505 |
</table> |
| 506 |
</div><div class="memdoc"> |
| 507 |
<p>This is a convenience function to put bytes into this object store under the given name.</p> |
| 508 |
<p>An <a class="el" href="structobj_store_info.html">objStoreInfo</a> will be returned, containing the object's metadata, digest and instance information.</p> |
| 509 |
<dl class="section note"><dt>Note</dt><dd>The returned <a class="el" href="structobj_store_info.html">objStoreInfo</a> object needs be destroyed using <a class="el" href="group__obs_mgt.html#ga022cb685f1c3861d76dbb168446a23d1" title="Destroys the ObjectStore information object.">objStoreInfo_Destroy</a> when no longer needed to free allocated memory.</dd></dl> |
| 510 |
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_mgt.html#ga022cb685f1c3861d76dbb168446a23d1" title="Destroys the ObjectStore information object.">objStoreInfo_Destroy</a></dd></dl> |
| 511 |
<dl class="params"><dt>Parameters</dt><dd> |
| 512 |
<table class="params"> |
| 513 |
<tr><td class="paramname">new_info</td><td>the location where to store the pointer to the <a class="el" href="structobj_store_info.html">objStoreInfo</a> object, or <code>NULL</code> if not needed. </td></tr> |
| 514 |
<tr><td class="paramname">obs</td><td>the pointer to the <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> object. </td></tr> |
| 515 |
<tr><td class="paramname">name</td><td>the name of the object to put the string into. </td></tr> |
| 516 |
<tr><td class="paramname">data</td><td>the bytes to put into the object. </td></tr> |
| 517 |
<tr><td class="paramname">dataLen</td><td>the number of bytes to put into the object. </td></tr> |
| 518 |
</table> |
| 519 |
</dd> |
| 520 |
</dl> |
| 521 |
|
| 522 |
</div> |
| 523 |
</div> |
| 524 |
<a id="ga792f04ea3c22e1a0aebdbbc38c62ff04" name="ga792f04ea3c22e1a0aebdbbc38c62ff04"></a> |
| 525 |
<h2 class="memtitle"><span class="permalink"><a href="#ga792f04ea3c22e1a0aebdbbc38c62ff04">◆ </a></span>objStore_PutFile()</h2> |
| 526 |
|
| 527 |
<div class="memitem"> |
| 528 |
<div class="memproto"> |
| 529 |
<table class="memname"> |
| 530 |
<tr> |
| 531 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStore_PutFile </td> |
| 532 |
<td>(</td> |
| 533 |
<td class="paramtype"><a class="el" href="structobj_store_info.html">objStoreInfo</a> ** </td> |
| 534 |
<td class="paramname"><em>new_info</em>, </td> |
| 535 |
</tr> |
| 536 |
<tr> |
| 537 |
<td class="paramkey"></td> |
| 538 |
<td></td> |
| 539 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> * </td> |
| 540 |
<td class="paramname"><em>obs</em>, </td> |
| 541 |
</tr> |
| 542 |
<tr> |
| 543 |
<td class="paramkey"></td> |
| 544 |
<td></td> |
| 545 |
<td class="paramtype">const char * </td> |
| 546 |
<td class="paramname"><em>fileName</em> </td> |
| 547 |
</tr> |
| 548 |
<tr> |
| 549 |
<td></td> |
| 550 |
<td>)</td> |
| 551 |
<td></td><td></td> |
| 552 |
</tr> |
| 553 |
</table> |
| 554 |
</div><div class="memdoc"> |
| 555 |
<p>This is a convenience function to put a file content into this object store. The name of the object will be the path of the file.</p> |
| 556 |
<dl class="section note"><dt>Note</dt><dd>The returned <a class="el" href="structobj_store_info.html">objStoreInfo</a> object needs be destroyed using <a class="el" href="group__obs_mgt.html#ga022cb685f1c3861d76dbb168446a23d1" title="Destroys the ObjectStore information object.">objStoreInfo_Destroy</a> when no longer needed to free allocated memory.</dd></dl> |
| 557 |
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_mgt.html#ga022cb685f1c3861d76dbb168446a23d1" title="Destroys the ObjectStore information object.">objStoreInfo_Destroy</a></dd></dl> |
| 558 |
<dl class="params"><dt>Parameters</dt><dd> |
| 559 |
<table class="params"> |
| 560 |
<tr><td class="paramname">new_info</td><td>the location where to store the pointer to the <a class="el" href="structobj_store_info.html">objStoreInfo</a> object, or <code>NULL</code> if not needed. </td></tr> |
| 561 |
<tr><td class="paramname">obs</td><td>the pointer to the <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> object. </td></tr> |
| 562 |
<tr><td class="paramname">fileName</td><td>the name of the file whose content will be put into the object. </td></tr> |
| 563 |
</table> |
| 564 |
</dd> |
| 565 |
</dl> |
| 566 |
|
| 567 |
</div> |
| 568 |
</div> |
| 569 |
<a id="gab967cd5a4c6ed2b403ec9baa374543eb" name="gab967cd5a4c6ed2b403ec9baa374543eb"></a> |
| 570 |
<h2 class="memtitle"><span class="permalink"><a href="#gab967cd5a4c6ed2b403ec9baa374543eb">◆ </a></span>objStore_Get()</h2> |
| 571 |
|
| 572 |
<div class="memitem"> |
| 573 |
<div class="memproto"> |
| 574 |
<table class="memname"> |
| 575 |
<tr> |
| 576 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStore_Get </td> |
| 577 |
<td>(</td> |
| 578 |
<td class="paramtype"><a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> ** </td> |
| 579 |
<td class="paramname"><em>new_get</em>, </td> |
| 580 |
</tr> |
| 581 |
<tr> |
| 582 |
<td class="paramkey"></td> |
| 583 |
<td></td> |
| 584 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> * </td> |
| 585 |
<td class="paramname"><em>obs</em>, </td> |
| 586 |
</tr> |
| 587 |
<tr> |
| 588 |
<td class="paramkey"></td> |
| 589 |
<td></td> |
| 590 |
<td class="paramtype">const char * </td> |
| 591 |
<td class="paramname"><em>name</em>, </td> |
| 592 |
</tr> |
| 593 |
<tr> |
| 594 |
<td class="paramkey"></td> |
| 595 |
<td></td> |
| 596 |
<td class="paramtype"><a class="el" href="structobj_store_options.html">objStoreOptions</a> * </td> |
| 597 |
<td class="paramname"><em>opts</em> </td> |
| 598 |
</tr> |
| 599 |
<tr> |
| 600 |
<td></td> |
| 601 |
<td>)</td> |
| 602 |
<td></td><td></td> |
| 603 |
</tr> |
| 604 |
</table> |
| 605 |
</div><div class="memdoc"> |
| 606 |
<p>If the object does not exist, <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ad0229a12b17d3d12a28efed6213720d8">NATS_NOT_FOUND</a> will be returned.</p> |
| 607 |
<p>The returned <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object will contain the object's metadata and the user can call <a class="el" href="group__obs_group.html#gab4388a36f33aff20a5b8a0b32b3a6b64" title="Returns some bytes of the pulled object.">objStoreGet_Read</a> to get some bytes as they become available, or <a class="el" href="group__obs_group.html#ga4ac8b8af8aee703a07acfd56d47cc7c5" title="Returns the remaining bytes of the pulled object.">objStoreGet_ReadAll</a> to get the whole object in one call.</p> |
| 608 |
<p>The option <a class="el" href="structobj_store_options.html#ab64a09119339521ead3ea4b7e5c3c8b7" title="ShowDeleted includes deleted object in the result.">objStoreOptions.ShowDeleted</a> can be provided to return an object even if it was marked as deleted.</p> |
| 609 |
<dl class="section note"><dt>Note</dt><dd>The returned <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object needs be destroyed using <a class="el" href="group__obs_group.html#ga24d9fdf73cae9cc89e889128d6de8243" title="Destroys the object store's get object.">objStoreGet_Destroy</a> when no longer needed to free allocated memory.</dd></dl> |
| 610 |
<p>Here is an example to read data by chunks:</p> |
| 611 |
<div class="fragment"><div class="line">objStoreGet *get = NULL;</div> |
| 612 |
<div class="line"> </div> |
| 613 |
<div class="line">s = objStore_Get(&get, obs, "myobject", NULL);</div> |
| 614 |
<div class="line">if (s == NATS_OK)</div> |
| 615 |
<div class="line">{</div> |
| 616 |
<div class="line"> objStoreInfo *info = NULL;</div> |
| 617 |
<div class="line"> bool done = false;</div> |
| 618 |
<div class="line"> </div> |
| 619 |
<div class="line"> // We can inspect the info if we chose to do so.</div> |
| 620 |
<div class="line"> s = objStoreGet_Info(&info);</div> |
| 621 |
<div class="line"> if (s == NATS_OK)</div> |
| 622 |
<div class="line"> {</div> |
| 623 |
<div class="line"> // Inspect the info...</div> |
| 624 |
<div class="line"> }</div> |
| 625 |
<div class="line"> // DO NOT destroy the info, it belongs to the `objStoreGet` object.</div> |
| 626 |
<div class="line"> </div> |
| 627 |
<div class="line"> // Get data in chunks.</div> |
| 628 |
<div class="line"> while ((s == NATS_OK) && !done)</div> |
| 629 |
<div class="line"> {</div> |
| 630 |
<div class="line"> void *data = NULL;</div> |
| 631 |
<div class="line"> int len = 0;</div> |
| 632 |
<div class="line"> </div> |
| 633 |
<div class="line"> // Read some data. The last param is a timeout (in milliseconds) to wait</div> |
| 634 |
<div class="line"> // for some data to become available.</div> |
| 635 |
<div class="line"> s = objStoreGet_Read(&done, &data, &len, get, 4000);</div> |
| 636 |
<div class="line"> if (s == NATS_OK)</div> |
| 637 |
<div class="line"> {</div> |
| 638 |
<div class="line"> // Do something with the data</div> |
| 639 |
<div class="line"> ...</div> |
| 640 |
<div class="line"> // It is the user responsibility to free the memory.</div> |
| 641 |
<div class="line"> free(data);</div> |
| 642 |
<div class="line"> }</div> |
| 643 |
<div class="line"> }</div> |
| 644 |
<div class="line"> // At this point, all data for the object has been retrieved.</div> |
| 645 |
<div class="line">}</div> |
| 646 |
<div class="line">// Now we need to destroy the object. No need to check for `NULL` (as long as you</div> |
| 647 |
<div class="line">properly initialized it to `NULL`) since the call internally check for that.</div> |
| 648 |
<div class="line">objStoreGet_Destroy(get);</div> |
| 649 |
<div class="line">...</div> |
| 650 |
</div><p>Here is an example to read data all at once. Unless the user needs to inspect the object store information's object prior to read the data, the convenience functtion <a class="el" href="group__obs_group.html#gafb7f87a99c7e2b0fe14f8044bb82e032" title="Pull the named object from the object store and return it as a byte array.">objStore_GetBytes</a> will be equivalent much simpler to use.</p> |
| 651 |
<div class="fragment"><div class="line">objStoreGet *get = NULL;</div> |
| 652 |
<div class="line"> </div> |
| 653 |
<div class="line">s = objStore_Get(&get, obs, "myobject", NULL);</div> |
| 654 |
<div class="line">if (s == NATS_OK)</div> |
| 655 |
<div class="line">{</div> |
| 656 |
<div class="line"> objStoreInfo *info = NULL;</div> |
| 657 |
<div class="line"> </div> |
| 658 |
<div class="line"> // We can inspect the info if we chose to do so.</div> |
| 659 |
<div class="line"> s = objStoreGet_Info(&info);</div> |
| 660 |
<div class="line"> if (s == NATS_OK)</div> |
| 661 |
<div class="line"> {</div> |
| 662 |
<div class="line"> // Inspect the info...</div> |
| 663 |
<div class="line"> }</div> |
| 664 |
<div class="line"> // DO NOT destroy the info, it belongs to the `objStoreGet` object.</div> |
| 665 |
<div class="line"> </div> |
| 666 |
<div class="line"> if (s == NATS_OK)</div> |
| 667 |
<div class="line"> {</div> |
| 668 |
<div class="line"> void *data = NULL;</div> |
| 669 |
<div class="line"> int len = 0;</div> |
| 670 |
<div class="line"> </div> |
| 671 |
<div class="line"> // The last param is a timeout (in milliseconds) to wait</div> |
| 672 |
<div class="line"> // for some data to become available. Here we are using 10 seconds.</div> |
| 673 |
<div class="line"> s = objStoreGet_ReadAll(&data, &len, get, 10000);</div> |
| 674 |
<div class="line"> if (s == NATS_OK)</div> |
| 675 |
<div class="line"> {</div> |
| 676 |
<div class="line"> // Do something with the data</div> |
| 677 |
<div class="line"> ...</div> |
| 678 |
<div class="line"> // It is the user responsibility to free the memory.</div> |
| 679 |
<div class="line"> free(data);</div> |
| 680 |
<div class="line"> }</div> |
| 681 |
<div class="line"> }</div> |
| 682 |
<div class="line">}</div> |
| 683 |
<div class="line">// Now we need to destroy the object. No need to check for `NULL` (as long as you</div> |
| 684 |
<div class="line">properly initialized it to `NULL`) since the call internally check for that.</div> |
| 685 |
<div class="line">objStoreGet_Destroy(get);</div> |
| 686 |
<div class="line">...</div> |
| 687 |
</div><dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_group.html#gab4388a36f33aff20a5b8a0b32b3a6b64" title="Returns some bytes of the pulled object.">objStoreGet_Read</a> </dd> |
| 688 |
<dd> |
| 689 |
<a class="el" href="group__obs_group.html#ga4ac8b8af8aee703a07acfd56d47cc7c5" title="Returns the remaining bytes of the pulled object.">objStoreGet_ReadAll</a> </dd> |
| 690 |
<dd> |
| 691 |
<a class="el" href="group__obs_group.html#ga24d9fdf73cae9cc89e889128d6de8243" title="Destroys the object store's get object.">objStoreGet_Destroy</a></dd></dl> |
| 692 |
<dl class="params"><dt>Parameters</dt><dd> |
| 693 |
<table class="params"> |
| 694 |
<tr><td class="paramname">new_get</td><td>the location where to store the pointer to the <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object. </td></tr> |
| 695 |
<tr><td class="paramname">obs</td><td>the pointer to the <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> object. </td></tr> |
| 696 |
<tr><td class="paramname">name</td><td>the name of the object to pull data from. </td></tr> |
| 697 |
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="structobj_store_options.html">objStoreOptions</a> object, possibly <code>NULL</code>. </td></tr> |
| 698 |
</table> |
| 699 |
</dd> |
| 700 |
</dl> |
| 701 |
|
| 702 |
</div> |
| 703 |
</div> |
| 704 |
<a id="gad599fef84e3e015d0d8c1e62c9e1b986" name="gad599fef84e3e015d0d8c1e62c9e1b986"></a> |
| 705 |
<h2 class="memtitle"><span class="permalink"><a href="#gad599fef84e3e015d0d8c1e62c9e1b986">◆ </a></span>objStoreGet_Info()</h2> |
| 706 |
|
| 707 |
<div class="memitem"> |
| 708 |
<div class="memproto"> |
| 709 |
<table class="memname"> |
| 710 |
<tr> |
| 711 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStoreGet_Info </td> |
| 712 |
<td>(</td> |
| 713 |
<td class="paramtype">const <a class="el" href="structobj_store_info.html">objStoreInfo</a> ** </td> |
| 714 |
<td class="paramname"><em>new_info</em>, </td> |
| 715 |
</tr> |
| 716 |
<tr> |
| 717 |
<td class="paramkey"></td> |
| 718 |
<td></td> |
| 719 |
<td class="paramtype"><a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> * </td> |
| 720 |
<td class="paramname"><em>get</em> </td> |
| 721 |
</tr> |
| 722 |
<tr> |
| 723 |
<td></td> |
| 724 |
<td>)</td> |
| 725 |
<td></td><td></td> |
| 726 |
</tr> |
| 727 |
</table> |
| 728 |
</div><div class="memdoc"> |
| 729 |
<p>Allows the user to get information about the pulled object.</p> |
| 730 |
<dl class="section warning"><dt>Warning</dt><dd>The <a class="el" href="structobj_store_info.html">objStoreInfo</a> is owned by the <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object and MUST NOT be destroyed or altered by the user. In other words, do not call <a class="el" href="group__obs_mgt.html#ga022cb685f1c3861d76dbb168446a23d1" title="Destroys the ObjectStore information object.">objStoreInfo_Destroy</a> on the <a class="el" href="structobj_store_info.html">objStoreInfo</a> pointer returned by this function. Instead, call <a class="el" href="group__obs_group.html#ga24d9fdf73cae9cc89e889128d6de8243" title="Destroys the object store's get object.">objStoreGet_Destroy</a> to free allocated memory.</dd></dl> |
| 731 |
<dl class="params"><dt>Parameters</dt><dd> |
| 732 |
<table class="params"> |
| 733 |
<tr><td class="paramname">new_info</td><td>the location where to store the pointer to the <a class="el" href="structobj_store_info.html">objStoreInfo</a> object. </td></tr> |
| 734 |
<tr><td class="paramname">get</td><td>the pointer to the <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object owning this information object. </td></tr> |
| 735 |
</table> |
| 736 |
</dd> |
| 737 |
</dl> |
| 738 |
|
| 739 |
</div> |
| 740 |
</div> |
| 741 |
<a id="gab4388a36f33aff20a5b8a0b32b3a6b64" name="gab4388a36f33aff20a5b8a0b32b3a6b64"></a> |
| 742 |
<h2 class="memtitle"><span class="permalink"><a href="#gab4388a36f33aff20a5b8a0b32b3a6b64">◆ </a></span>objStoreGet_Read()</h2> |
| 743 |
|
| 744 |
<div class="memitem"> |
| 745 |
<div class="memproto"> |
| 746 |
<table class="memname"> |
| 747 |
<tr> |
| 748 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStoreGet_Read </td> |
| 749 |
<td>(</td> |
| 750 |
<td class="paramtype">bool * </td> |
| 751 |
<td class="paramname"><em>done</em>, </td> |
| 752 |
</tr> |
| 753 |
<tr> |
| 754 |
<td class="paramkey"></td> |
| 755 |
<td></td> |
| 756 |
<td class="paramtype">void ** </td> |
| 757 |
<td class="paramname"><em>new_data</em>, </td> |
| 758 |
</tr> |
| 759 |
<tr> |
| 760 |
<td class="paramkey"></td> |
| 761 |
<td></td> |
| 762 |
<td class="paramtype">int * </td> |
| 763 |
<td class="paramname"><em>dataLen</em>, </td> |
| 764 |
</tr> |
| 765 |
<tr> |
| 766 |
<td class="paramkey"></td> |
| 767 |
<td></td> |
| 768 |
<td class="paramtype"><a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> * </td> |
| 769 |
<td class="paramname"><em>get</em>, </td> |
| 770 |
</tr> |
| 771 |
<tr> |
| 772 |
<td class="paramkey"></td> |
| 773 |
<td></td> |
| 774 |
<td class="paramtype">int64_t </td> |
| 775 |
<td class="paramname"><em>timeout</em> </td> |
| 776 |
</tr> |
| 777 |
<tr> |
| 778 |
<td></td> |
| 779 |
<td>)</td> |
| 780 |
<td></td><td></td> |
| 781 |
</tr> |
| 782 |
</table> |
| 783 |
</div><div class="memdoc"> |
| 784 |
<p>This call returns up to a chunk of bytes of the object. The <code>dataLen</code> will be set with the number of bytes that were returned.</p> |
| 785 |
<p>The <code>done</code> boolean will be set to <code>true</code> if the call detects that this was the last bit of data that consistuted this object. Calling this function again would result in the <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9bb78b4f245d2870040d25c450febd4b">NATS_ILLEGAL_STATE</a> error returned.</p> |
| 786 |
<dl class="section warning"><dt>Warning</dt><dd>The returned <code>data</code> must be freed by the user.</dd></dl> |
| 787 |
<p>See <a class="el" href="group__obs_group.html#gab967cd5a4c6ed2b403ec9baa374543eb" title="Pull the named object from the object store.">objStore_Get</a> for example on how to use the set of APIs.</p> |
| 788 |
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_group.html#gab967cd5a4c6ed2b403ec9baa374543eb" title="Pull the named object from the object store.">objStore_Get</a></dd></dl> |
| 789 |
<dl class="params"><dt>Parameters</dt><dd> |
| 790 |
<table class="params"> |
| 791 |
<tr><td class="paramname">done</td><td>the location where to store the boolean indicating if this is the last read. </td></tr> |
| 792 |
<tr><td class="paramname">new_data</td><td>the location where to store the pointer to a chunk of the object's data. </td></tr> |
| 793 |
<tr><td class="paramname">dataLen</td><td>the location where to store the number of bytes returned. </td></tr> |
| 794 |
<tr><td class="paramname">get</td><td>the pointer to the <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object. </td></tr> |
| 795 |
<tr><td class="paramname">timeout</td><td>the amount of time (in milliseconds) allowed to perform the operation. </td></tr> |
| 796 |
</table> |
| 797 |
</dd> |
| 798 |
</dl> |
| 799 |
|
| 800 |
</div> |
| 801 |
</div> |
| 802 |
<a id="ga4ac8b8af8aee703a07acfd56d47cc7c5" name="ga4ac8b8af8aee703a07acfd56d47cc7c5"></a> |
| 803 |
<h2 class="memtitle"><span class="permalink"><a href="#ga4ac8b8af8aee703a07acfd56d47cc7c5">◆ </a></span>objStoreGet_ReadAll()</h2> |
| 804 |
|
| 805 |
<div class="memitem"> |
| 806 |
<div class="memproto"> |
| 807 |
<table class="memname"> |
| 808 |
<tr> |
| 809 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStoreGet_ReadAll </td> |
| 810 |
<td>(</td> |
| 811 |
<td class="paramtype">void ** </td> |
| 812 |
<td class="paramname"><em>new_data</em>, </td> |
| 813 |
</tr> |
| 814 |
<tr> |
| 815 |
<td class="paramkey"></td> |
| 816 |
<td></td> |
| 817 |
<td class="paramtype">int * </td> |
| 818 |
<td class="paramname"><em>dataLen</em>, </td> |
| 819 |
</tr> |
| 820 |
<tr> |
| 821 |
<td class="paramkey"></td> |
| 822 |
<td></td> |
| 823 |
<td class="paramtype"><a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> * </td> |
| 824 |
<td class="paramname"><em>get</em>, </td> |
| 825 |
</tr> |
| 826 |
<tr> |
| 827 |
<td class="paramkey"></td> |
| 828 |
<td></td> |
| 829 |
<td class="paramtype">int64_t </td> |
| 830 |
<td class="paramname"><em>timeout</em> </td> |
| 831 |
</tr> |
| 832 |
<tr> |
| 833 |
<td></td> |
| 834 |
<td>)</td> |
| 835 |
<td></td><td></td> |
| 836 |
</tr> |
| 837 |
</table> |
| 838 |
</div><div class="memdoc"> |
| 839 |
<p>This call returns all data representing the object, or the remaining of the data if some were already collected using <a class="el" href="group__obs_group.html#gab4388a36f33aff20a5b8a0b32b3a6b64" title="Returns some bytes of the pulled object.">objStoreGet_Read</a>.</p> |
| 840 |
<p>This function should be called only once (except in the case of a <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ab88994c9ea9889ac4d9d656d62f550ed">NATS_TIMEOUT</a>), if not the error <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80a9bb78b4f245d2870040d25c450febd4b">NATS_ILLEGAL_STATE</a> error will be returned.</p> |
| 841 |
<dl class="section warning"><dt>Warning</dt><dd>The returned <code>data</code> must be freed by the user.</dd></dl> |
| 842 |
<p>See <a class="el" href="group__obs_group.html#gab967cd5a4c6ed2b403ec9baa374543eb" title="Pull the named object from the object store.">objStore_Get</a> for example on how to use the set of APIs.</p> |
| 843 |
<dl class="section see"><dt>See also</dt><dd><a class="el" href="group__obs_group.html#gab967cd5a4c6ed2b403ec9baa374543eb" title="Pull the named object from the object store.">objStore_Get</a></dd></dl> |
| 844 |
<dl class="params"><dt>Parameters</dt><dd> |
| 845 |
<table class="params"> |
| 846 |
<tr><td class="paramname">new_data</td><td>the location where to store the pointer to a chunk of the object's data. </td></tr> |
| 847 |
<tr><td class="paramname">dataLen</td><td>the location where to store the number of bytes returned. </td></tr> |
| 848 |
<tr><td class="paramname">get</td><td>the pointer to the <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object. </td></tr> |
| 849 |
<tr><td class="paramname">timeout</td><td>the amount of time (in milliseconds) allowed to perform the operation. </td></tr> |
| 850 |
</table> |
| 851 |
</dd> |
| 852 |
</dl> |
| 853 |
|
| 854 |
</div> |
| 855 |
</div> |
| 856 |
<a id="ga24d9fdf73cae9cc89e889128d6de8243" name="ga24d9fdf73cae9cc89e889128d6de8243"></a> |
| 857 |
<h2 class="memtitle"><span class="permalink"><a href="#ga24d9fdf73cae9cc89e889128d6de8243">◆ </a></span>objStoreGet_Destroy()</h2> |
| 858 |
|
| 859 |
<div class="memitem"> |
| 860 |
<div class="memproto"> |
| 861 |
<table class="memname"> |
| 862 |
<tr> |
| 863 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> void objStoreGet_Destroy </td> |
| 864 |
<td>(</td> |
| 865 |
<td class="paramtype"><a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> * </td> |
| 866 |
<td class="paramname"><em>get</em></td><td>)</td> |
| 867 |
<td></td> |
| 868 |
</tr> |
| 869 |
</table> |
| 870 |
</div><div class="memdoc"> |
| 871 |
<p>Releases memory allocated for this <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object.</p> |
| 872 |
<dl class="params"><dt>Parameters</dt><dd> |
| 873 |
<table class="params"> |
| 874 |
<tr><td class="paramname">get</td><td>the pointer to the <a class="el" href="group__types_group.html#gac9635b7be7110db17b5e61bb5624aa95">objStoreGet</a> object. </td></tr> |
| 875 |
</table> |
| 876 |
</dd> |
| 877 |
</dl> |
| 878 |
|
| 879 |
</div> |
| 880 |
</div> |
| 881 |
<a id="gab7f016290a9a0407ebb7824461a506b7" name="gab7f016290a9a0407ebb7824461a506b7"></a> |
| 882 |
<h2 class="memtitle"><span class="permalink"><a href="#gab7f016290a9a0407ebb7824461a506b7">◆ </a></span>objStore_GetString()</h2> |
| 883 |
|
| 884 |
<div class="memitem"> |
| 885 |
<div class="memproto"> |
| 886 |
<table class="memname"> |
| 887 |
<tr> |
| 888 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStore_GetString </td> |
| 889 |
<td>(</td> |
| 890 |
<td class="paramtype">char ** </td> |
| 891 |
<td class="paramname"><em>new_str</em>, </td> |
| 892 |
</tr> |
| 893 |
<tr> |
| 894 |
<td class="paramkey"></td> |
| 895 |
<td></td> |
| 896 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> * </td> |
| 897 |
<td class="paramname"><em>obs</em>, </td> |
| 898 |
</tr> |
| 899 |
<tr> |
| 900 |
<td class="paramkey"></td> |
| 901 |
<td></td> |
| 902 |
<td class="paramtype">const char * </td> |
| 903 |
<td class="paramname"><em>name</em>, </td> |
| 904 |
</tr> |
| 905 |
<tr> |
| 906 |
<td class="paramkey"></td> |
| 907 |
<td></td> |
| 908 |
<td class="paramtype"><a class="el" href="structobj_store_options.html">objStoreOptions</a> * </td> |
| 909 |
<td class="paramname"><em>opts</em> </td> |
| 910 |
</tr> |
| 911 |
<tr> |
| 912 |
<td></td> |
| 913 |
<td>)</td> |
| 914 |
<td></td><td></td> |
| 915 |
</tr> |
| 916 |
</table> |
| 917 |
</div><div class="memdoc"> |
| 918 |
<p>This is a convenience function to pull an object from this object store and return it as a string.</p> |
| 919 |
<p>If the object does not exist, <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ad0229a12b17d3d12a28efed6213720d8">NATS_NOT_FOUND</a> will be returned.</p> |
| 920 |
<p>The option <a class="el" href="structobj_store_options.html#ab64a09119339521ead3ea4b7e5c3c8b7" title="ShowDeleted includes deleted object in the result.">objStoreOptions.ShowDeleted</a> can be provided to return an object even if it was marked as deleted.</p> |
| 921 |
<p>Here is an example:</p> |
| 922 |
<ul> |
| 923 |
<li><div class="fragment"><div class="line">objStoreOptions o;</div> |
| 924 |
<div class="line"> </div> |
| 925 |
<div class="line">objStoreOptions_Init(&o);</div> |
| 926 |
<div class="line">s = objStore_GetString(&str, obs, "myobject", &o);</div> |
| 927 |
<div class="line">if (s == NATS_OK)</div> |
| 928 |
<div class="line">{</div> |
| 929 |
<div class="line"> // Do something with the string</div> |
| 930 |
<div class="line"> ...</div> |
| 931 |
<div class="line"> // It is the user responsibility to free the memory.</div> |
| 932 |
<div class="line"> free(str);</div> |
| 933 |
<div class="line">}</div> |
| 934 |
<div class="line">...</div> |
| 935 |
</div></li> |
| 936 |
</ul> |
| 937 |
<dl class="section note"><dt>Note</dt><dd>The string is NULL terminated, therefore the allocated memory is one byte more than the size reported in the object's <a class="el" href="structobj_store_info.html#a7dcf7fcbb773e478120b5a6206c7f20d" title="Size is the size of the object in bytes. It only includes the size of the object itself,...">objStoreInfo.Size</a> field.</dd></dl> |
| 938 |
<dl class="section warning"><dt>Warning</dt><dd>The returned string must be freed when no longer needed to reclaim memory.</dd></dl> |
| 939 |
<dl class="params"><dt>Parameters</dt><dd> |
| 940 |
<table class="params"> |
| 941 |
<tr><td class="paramname">new_str</td><td>the location where to store the pointer to the retrieved string. </td></tr> |
| 942 |
<tr><td class="paramname">obs</td><td>the pointer to the <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> object. </td></tr> |
| 943 |
<tr><td class="paramname">name</td><td>the name of the object to pull the string from. </td></tr> |
| 944 |
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="structobj_store_options.html">objStoreOptions</a> object, possibly <code>NULL</code>. </td></tr> |
| 945 |
</table> |
| 946 |
</dd> |
| 947 |
</dl> |
| 948 |
|
| 949 |
</div> |
| 950 |
</div> |
| 951 |
<a id="gafb7f87a99c7e2b0fe14f8044bb82e032" name="gafb7f87a99c7e2b0fe14f8044bb82e032"></a> |
| 952 |
<h2 class="memtitle"><span class="permalink"><a href="#gafb7f87a99c7e2b0fe14f8044bb82e032">◆ </a></span>objStore_GetBytes()</h2> |
| 953 |
|
| 954 |
<div class="memitem"> |
| 955 |
<div class="memproto"> |
| 956 |
<table class="memname"> |
| 957 |
<tr> |
| 958 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStore_GetBytes </td> |
| 959 |
<td>(</td> |
| 960 |
<td class="paramtype">void ** </td> |
| 961 |
<td class="paramname"><em>new_data</em>, </td> |
| 962 |
</tr> |
| 963 |
<tr> |
| 964 |
<td class="paramkey"></td> |
| 965 |
<td></td> |
| 966 |
<td class="paramtype">int * </td> |
| 967 |
<td class="paramname"><em>dataLen</em>, </td> |
| 968 |
</tr> |
| 969 |
<tr> |
| 970 |
<td class="paramkey"></td> |
| 971 |
<td></td> |
| 972 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> * </td> |
| 973 |
<td class="paramname"><em>obs</em>, </td> |
| 974 |
</tr> |
| 975 |
<tr> |
| 976 |
<td class="paramkey"></td> |
| 977 |
<td></td> |
| 978 |
<td class="paramtype">const char * </td> |
| 979 |
<td class="paramname"><em>name</em>, </td> |
| 980 |
</tr> |
| 981 |
<tr> |
| 982 |
<td class="paramkey"></td> |
| 983 |
<td></td> |
| 984 |
<td class="paramtype"><a class="el" href="structobj_store_options.html">objStoreOptions</a> * </td> |
| 985 |
<td class="paramname"><em>opts</em> </td> |
| 986 |
</tr> |
| 987 |
<tr> |
| 988 |
<td></td> |
| 989 |
<td>)</td> |
| 990 |
<td></td><td></td> |
| 991 |
</tr> |
| 992 |
</table> |
| 993 |
</div><div class="memdoc"> |
| 994 |
<p>This is a convenience function to pull an object from this object store and return it as a byte array.</p> |
| 995 |
<p>If the object does not exist, <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ad0229a12b17d3d12a28efed6213720d8">NATS_NOT_FOUND</a> will be returned.</p> |
| 996 |
<p>The option <a class="el" href="structobj_store_options.html#ab64a09119339521ead3ea4b7e5c3c8b7" title="ShowDeleted includes deleted object in the result.">objStoreOptions.ShowDeleted</a> can be provided to return an object even if it was marked as deleted. See <a class="el" href="group__obs_group.html#gab7f016290a9a0407ebb7824461a506b7" title="Pull the named object from the object store and return it as a string.">objStore_GetString</a> for an example on how to do so.</p> |
| 997 |
<dl class="section warning"><dt>Warning</dt><dd>The returned byte array must be freed when no longer needed to reclaim memory.</dd></dl> |
| 998 |
<dl class="params"><dt>Parameters</dt><dd> |
| 999 |
<table class="params"> |
| 1000 |
<tr><td class="paramname">new_data</td><td>the location where to store the pointer to the retrieved byte array. </td></tr> |
| 1001 |
<tr><td class="paramname">dataLen</td><td>the location where to store the number of bytes of the byte array. </td></tr> |
| 1002 |
<tr><td class="paramname">obs</td><td>the pointer to the <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> object. </td></tr> |
| 1003 |
<tr><td class="paramname">name</td><td>the name of the object to pull the string from. </td></tr> |
| 1004 |
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="structobj_store_options.html">objStoreOptions</a> object, possibly <code>NULL</code>. </td></tr> |
| 1005 |
</table> |
| 1006 |
</dd> |
| 1007 |
</dl> |
| 1008 |
|
| 1009 |
</div> |
| 1010 |
</div> |
| 1011 |
<a id="gab8ac22b959354953c88119d3c1a74408" name="gab8ac22b959354953c88119d3c1a74408"></a> |
| 1012 |
<h2 class="memtitle"><span class="permalink"><a href="#gab8ac22b959354953c88119d3c1a74408">◆ </a></span>objStore_GetFile()</h2> |
| 1013 |
|
| 1014 |
<div class="memitem"> |
| 1015 |
<div class="memproto"> |
| 1016 |
<table class="memname"> |
| 1017 |
<tr> |
| 1018 |
<td class="memname"><a class="el" href="nats_8h.html#a3bc1b3fe7f64083e60c7c3b93f205bad">NATS_EXTERN</a> <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80">natsStatus</a> objStore_GetFile </td> |
| 1019 |
<td>(</td> |
| 1020 |
<td class="paramtype"><a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> * </td> |
| 1021 |
<td class="paramname"><em>obs</em>, </td> |
| 1022 |
</tr> |
| 1023 |
<tr> |
| 1024 |
<td class="paramkey"></td> |
| 1025 |
<td></td> |
| 1026 |
<td class="paramtype">const char * </td> |
| 1027 |
<td class="paramname"><em>name</em>, </td> |
| 1028 |
</tr> |
| 1029 |
<tr> |
| 1030 |
<td class="paramkey"></td> |
| 1031 |
<td></td> |
| 1032 |
<td class="paramtype">const char * </td> |
| 1033 |
<td class="paramname"><em>fileName</em>, </td> |
| 1034 |
</tr> |
| 1035 |
<tr> |
| 1036 |
<td class="paramkey"></td> |
| 1037 |
<td></td> |
| 1038 |
<td class="paramtype"><a class="el" href="structobj_store_options.html">objStoreOptions</a> * </td> |
| 1039 |
<td class="paramname"><em>opts</em> </td> |
| 1040 |
</tr> |
| 1041 |
<tr> |
| 1042 |
<td></td> |
| 1043 |
<td>)</td> |
| 1044 |
<td></td><td></td> |
| 1045 |
</tr> |
| 1046 |
</table> |
| 1047 |
</div><div class="memdoc"> |
| 1048 |
<p>This is a convenience function to pull an object from this object store and place it in a file. If the file already exists, it will be overwritten, otherwise it will be created.</p> |
| 1049 |
<p>If the object does not exist, <a class="el" href="status_8h.html#a36c934157b663b7b5fb5d6609c897c80ad0229a12b17d3d12a28efed6213720d8">NATS_NOT_FOUND</a> will be returned.</p> |
| 1050 |
<p>The option <a class="el" href="structobj_store_options.html#ab64a09119339521ead3ea4b7e5c3c8b7" title="ShowDeleted includes deleted object in the result.">objStoreOptions.ShowDeleted</a> can be provided to return an object even if it was marked as deleted. See <a class="el" href="group__obs_group.html#gab7f016290a9a0407ebb7824461a506b7" title="Pull the named object from the object store and return it as a string.">objStore_GetString</a> for an example on how to do so.</p> |
| 1051 |
<dl class="params"><dt>Parameters</dt><dd> |
| 1052 |
<table class="params"> |
| 1053 |
<tr><td class="paramname">obs</td><td>the pointer to the <a class="el" href="group__types_group.html#ga0dbdf6ef78b63bfeeb8551519ba57c5d">objStore</a> object. </td></tr> |
| 1054 |
<tr><td class="paramname">name</td><td>the name of the object to pull the string from. </td></tr> |
| 1055 |
<tr><td class="paramname">fileName</td><td>the name of the file to write the content into. </td></tr> |
| 1056 |
<tr><td class="paramname">opts</td><td>the pointer to the <a class="el" href="structobj_store_options.html">objStoreOptions</a> object, possibly <code>NULL</code>. </td></tr> |
| 1057 |
</table> |
| 1058 |
</dd> |
| 1059 |
</dl> |
| 1060 |
|
| 1061 |
</div> |
| 1062 |
</div> |
| 1063 |
</div> |
| 1064 |
</div> |
| 1065 |
|
| 1066 |
|
| 1067 |
<div id="nav-path" class="navpath"> |
| 1068 |
<ul> |
| 1069 |
<li class="footer">NATS.IO Supported By Synadia Communications Inc. |
| 1070 |
<a href="http://www.nats.io"> |
| 1071 |
</a></li> |
| 1072 |
</ul> |
| 1073 |
</div> |
| 1074 |
</body> |
| 1075 |
</html> |