module-src_metadata-Metadata.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Class: Metadata</title>
  6. <script src="scripts/prettify/prettify.js"> </script>
  7. <script src="scripts/prettify/lang-css.js"> </script>
  8. <!--[if lt IE 9]>
  9. <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
  10. <![endif]-->
  11. <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
  12. <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
  13. </head>
  14. <body>
  15. <div id="main">
  16. <h1 class="page-title">Class: Metadata</h1>
  17. <section>
  18. <header>
  19. <h2>
  20. <span class="ancestors"><a href="module-src_metadata.html">src/metadata</a>~</span>Metadata</h2>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h4 class="name" id="Metadata"><span class="type-signature"></span>new Metadata<span class="signature">()</span><span class="type-signature"></span></h4>
  25. <div class="description">
  26. Class for storing metadata. Keys are normalized to lowercase ASCII.
  27. </div>
  28. <dl class="details">
  29. <dt class="tag-source">Source:</dt>
  30. <dd class="tag-source"><ul class="dummy"><li>
  31. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line58">line 58</a>
  32. </li></ul></dd>
  33. </dl>
  34. </div>
  35. <h3 class="subsection-title">Methods</h3>
  36. <h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(key, value)</span><span class="type-signature"></span></h4>
  37. <div class="description">
  38. Adds the given value for the given key. Normalizes the key.
  39. </div>
  40. <h5>Parameters:</h5>
  41. <table class="params">
  42. <thead>
  43. <tr>
  44. <th>Name</th>
  45. <th>Type</th>
  46. <th class="last">Description</th>
  47. </tr>
  48. </thead>
  49. <tbody>
  50. <tr>
  51. <td class="name"><code>key</code></td>
  52. <td class="type">
  53. <span class="param-type">String</span>
  54. </td>
  55. <td class="description last">The key to add to.</td>
  56. </tr>
  57. <tr>
  58. <td class="name"><code>value</code></td>
  59. <td class="type">
  60. <span class="param-type">String</span>
  61. |
  62. <span class="param-type">Buffer</span>
  63. </td>
  64. <td class="description last">The value to add. Must be a buffer if and only
  65. if the normalized key ends with '-bin'</td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. <dl class="details">
  70. <dt class="tag-source">Source:</dt>
  71. <dd class="tag-source"><ul class="dummy"><li>
  72. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line106">line 106</a>
  73. </li></ul></dd>
  74. </dl>
  75. <h4 class="name" id="clone"><span class="type-signature"></span>clone<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="global.html#Metadata">Metadata</a>}</span></h4>
  76. <div class="description">
  77. Clone the metadata object.
  78. </div>
  79. <dl class="details">
  80. <dt class="tag-source">Source:</dt>
  81. <dd class="tag-source"><ul class="dummy"><li>
  82. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line159">line 159</a>
  83. </li></ul></dd>
  84. </dl>
  85. <h5>Returns:</h5>
  86. <div class="param-desc">
  87. The new cloned object
  88. </div>
  89. <dl>
  90. <dt>
  91. Type
  92. </dt>
  93. <dd>
  94. <span class="param-type"><a href="global.html#Metadata">Metadata</a></span>
  95. </dd>
  96. </dl>
  97. <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(key)</span><span class="type-signature"> &rarr; {Array.&lt;(String|Buffer)>}</span></h4>
  98. <div class="description">
  99. Gets a list of all values associated with the key. Normalizes the key.
  100. </div>
  101. <h5>Parameters:</h5>
  102. <table class="params">
  103. <thead>
  104. <tr>
  105. <th>Name</th>
  106. <th>Type</th>
  107. <th class="last">Description</th>
  108. </tr>
  109. </thead>
  110. <tbody>
  111. <tr>
  112. <td class="name"><code>key</code></td>
  113. <td class="type">
  114. <span class="param-type">String</span>
  115. </td>
  116. <td class="description last">The key to get</td>
  117. </tr>
  118. </tbody>
  119. </table>
  120. <dl class="details">
  121. <dt class="tag-source">Source:</dt>
  122. <dd class="tag-source"><ul class="dummy"><li>
  123. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line131">line 131</a>
  124. </li></ul></dd>
  125. </dl>
  126. <h5>Returns:</h5>
  127. <div class="param-desc">
  128. The values associated with that key
  129. </div>
  130. <dl>
  131. <dt>
  132. Type
  133. </dt>
  134. <dd>
  135. <span class="param-type">Array.&lt;(String|Buffer)></span>
  136. </dd>
  137. </dl>
  138. <h4 class="name" id="getMap"><span class="type-signature"></span>getMap<span class="signature">()</span><span class="type-signature"> &rarr; {Object.&lt;String, (String|Buffer)>}</span></h4>
  139. <div class="description">
  140. Get a map of each key to a single associated value. This reflects the most
  141. common way that people will want to see metadata.
  142. </div>
  143. <dl class="details">
  144. <dt class="tag-source">Source:</dt>
  145. <dd class="tag-source"><ul class="dummy"><li>
  146. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line145">line 145</a>
  147. </li></ul></dd>
  148. </dl>
  149. <h5>Returns:</h5>
  150. <div class="param-desc">
  151. A key/value mapping of the metadata
  152. </div>
  153. <dl>
  154. <dt>
  155. Type
  156. </dt>
  157. <dd>
  158. <span class="param-type">Object.&lt;String, (String|Buffer)></span>
  159. </dd>
  160. </dl>
  161. <h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(key)</span><span class="type-signature"></span></h4>
  162. <div class="description">
  163. Remove the given key and any associated values. Normalizes the key.
  164. </div>
  165. <h5>Parameters:</h5>
  166. <table class="params">
  167. <thead>
  168. <tr>
  169. <th>Name</th>
  170. <th>Type</th>
  171. <th class="last">Description</th>
  172. </tr>
  173. </thead>
  174. <tbody>
  175. <tr>
  176. <td class="name"><code>key</code></td>
  177. <td class="type">
  178. <span class="param-type">String</span>
  179. </td>
  180. <td class="description last">The key to remove</td>
  181. </tr>
  182. </tbody>
  183. </table>
  184. <dl class="details">
  185. <dt class="tag-source">Source:</dt>
  186. <dd class="tag-source"><ul class="dummy"><li>
  187. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line119">line 119</a>
  188. </li></ul></dd>
  189. </dl>
  190. <h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(key, value)</span><span class="type-signature"></span></h4>
  191. <div class="description">
  192. Sets the given value for the given key, replacing any other values associated
  193. with that key. Normalizes the key.
  194. </div>
  195. <h5>Parameters:</h5>
  196. <table class="params">
  197. <thead>
  198. <tr>
  199. <th>Name</th>
  200. <th>Type</th>
  201. <th class="last">Description</th>
  202. </tr>
  203. </thead>
  204. <tbody>
  205. <tr>
  206. <td class="name"><code>key</code></td>
  207. <td class="type">
  208. <span class="param-type">String</span>
  209. </td>
  210. <td class="description last">The key to set</td>
  211. </tr>
  212. <tr>
  213. <td class="name"><code>value</code></td>
  214. <td class="type">
  215. <span class="param-type">String</span>
  216. |
  217. <span class="param-type">Buffer</span>
  218. </td>
  219. <td class="description last">The value to set. Must be a buffer if and only
  220. if the normalized key ends with '-bin'</td>
  221. </tr>
  222. </tbody>
  223. </table>
  224. <dl class="details">
  225. <dt class="tag-source">Source:</dt>
  226. <dd class="tag-source"><ul class="dummy"><li>
  227. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line94">line 94</a>
  228. </li></ul></dd>
  229. </dl>
  230. </article>
  231. </section>
  232. </div>
  233. <nav>
  234. <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-src_client.html">src/client</a></li><li><a href="module-src_common.html">src/common</a></li><li><a href="module-src_credentials.html">src/credentials</a></li><li><a href="module-src_metadata.html">src/metadata</a></li><li><a href="module-src_server.html">src/server</a></li></ul><h3>Classes</h3><ul><li><a href="module-src_client.makeClientConstructor-Client.html">Client</a></li><li><a href="module-src_client-ClientDuplexStream.html">ClientDuplexStream</a></li><li><a href="module-src_client-ClientReadableStream.html">ClientReadableStream</a></li><li><a href="module-src_client-ClientWritableStream.html">ClientWritableStream</a></li><li><a href="module-src_metadata-Metadata.html">Metadata</a></li><li><a href="module-src_server-Server.html">Server</a></li><li><a href="module-src_server-ServerDuplexStream.html">ServerDuplexStream</a></li><li><a href="module-src_server-ServerReadableStream.html">ServerReadableStream</a></li><li><a href="module-src_server-ServerWritableStream.html">ServerWritableStream</a></li></ul><h3>Global</h3><ul><li><a href="global.html#callError">callError</a></li><li><a href="global.html#credentials">credentials</a></li><li><a href="global.html#getClientChannel">getClientChannel</a></li><li><a href="global.html#load">load</a></li><li><a href="global.html#loadObject">loadObject</a></li><li><a href="global.html#makeGenericClientConstructor">makeGenericClientConstructor</a></li><li><a href="global.html#Metadata">Metadata</a></li><li><a href="global.html#propagate">propagate</a></li><li><a href="global.html#Server">Server</a></li><li><a href="global.html#ServerCredentials">ServerCredentials</a></li><li><a href="global.html#status">status</a></li><li><a href="global.html#waitForClientReady">waitForClientReady</a></li><li><a href="global.html#writeFlags">writeFlags</a></li></ul>
  235. </nav>
  236. <br class="clear">
  237. <footer>
  238. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Jan 14 2016 16:17:15 GMT-0800 (PST)
  239. </footer>
  240. <script> prettyPrint(); </script>
  241. <script src="scripts/linenumber.js"> </script>
  242. </body>
  243. </html>