module-src_metadata-Metadata.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980
  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>
  21. Metadata
  22. </h2>
  23. </header>
  24. <article>
  25. <div class="container-overview">
  26. <h4 class="name" id="Metadata"><span class="type-signature"></span>new Metadata<span class="signature">()</span><span class="type-signature"></span></h4>
  27. <div class="description">
  28. Class for storing metadata. Keys are normalized to lowercase ASCII.
  29. </div>
  30. <dl class="details">
  31. <dt class="tag-source">Source:</dt>
  32. <dd class="tag-source"><ul class="dummy"><li>
  33. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line47">line 47</a>
  34. </li></ul></dd>
  35. </dl>
  36. </div>
  37. <h3 class="subsection-title">Methods</h3>
  38. <h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(key, value)</span><span class="type-signature"></span></h4>
  39. <div class="description">
  40. Adds the given value for the given key. Normalizes the key.
  41. </div>
  42. <h5>Parameters:</h5>
  43. <table class="params">
  44. <thead>
  45. <tr>
  46. <th>Name</th>
  47. <th>Type</th>
  48. <th class="last">Description</th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <tr>
  53. <td class="name"><code>key</code></td>
  54. <td class="type">
  55. <span class="param-type">String</span>
  56. </td>
  57. <td class="description last">The key to add to.</td>
  58. </tr>
  59. <tr>
  60. <td class="name"><code>value</code></td>
  61. <td class="type">
  62. <span class="param-type">String</span>
  63. |
  64. <span class="param-type">Buffer</span>
  65. </td>
  66. <td class="description last">The value to add. Must be a buffer if and only
  67. if the normalized key ends with '-bin'</td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. <dl class="details">
  72. <dt class="tag-source">Source:</dt>
  73. <dd class="tag-source"><ul class="dummy"><li>
  74. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line95">line 95</a>
  75. </li></ul></dd>
  76. </dl>
  77. <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>
  78. <div class="description">
  79. Clone the metadata object.
  80. </div>
  81. <dl class="details">
  82. <dt class="tag-source">Source:</dt>
  83. <dd class="tag-source"><ul class="dummy"><li>
  84. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line148">line 148</a>
  85. </li></ul></dd>
  86. </dl>
  87. <h5>Returns:</h5>
  88. <div class="param-desc">
  89. The new cloned object
  90. </div>
  91. <dl>
  92. <dt>
  93. Type
  94. </dt>
  95. <dd>
  96. <span class="param-type"><a href="global.html#Metadata">Metadata</a></span>
  97. </dd>
  98. </dl>
  99. <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>
  100. <div class="description">
  101. Gets a list of all values associated with the key. Normalizes the key.
  102. </div>
  103. <h5>Parameters:</h5>
  104. <table class="params">
  105. <thead>
  106. <tr>
  107. <th>Name</th>
  108. <th>Type</th>
  109. <th class="last">Description</th>
  110. </tr>
  111. </thead>
  112. <tbody>
  113. <tr>
  114. <td class="name"><code>key</code></td>
  115. <td class="type">
  116. <span class="param-type">String</span>
  117. </td>
  118. <td class="description last">The key to get</td>
  119. </tr>
  120. </tbody>
  121. </table>
  122. <dl class="details">
  123. <dt class="tag-source">Source:</dt>
  124. <dd class="tag-source"><ul class="dummy"><li>
  125. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line120">line 120</a>
  126. </li></ul></dd>
  127. </dl>
  128. <h5>Returns:</h5>
  129. <div class="param-desc">
  130. The values associated with that key
  131. </div>
  132. <dl>
  133. <dt>
  134. Type
  135. </dt>
  136. <dd>
  137. <span class="param-type">Array.&lt;(String|Buffer)></span>
  138. </dd>
  139. </dl>
  140. <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>
  141. <div class="description">
  142. Get a map of each key to a single associated value. This reflects the most
  143. common way that people will want to see metadata.
  144. </div>
  145. <dl class="details">
  146. <dt class="tag-source">Source:</dt>
  147. <dd class="tag-source"><ul class="dummy"><li>
  148. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line134">line 134</a>
  149. </li></ul></dd>
  150. </dl>
  151. <h5>Returns:</h5>
  152. <div class="param-desc">
  153. A key/value mapping of the metadata
  154. </div>
  155. <dl>
  156. <dt>
  157. Type
  158. </dt>
  159. <dd>
  160. <span class="param-type">Object.&lt;String, (String|Buffer)></span>
  161. </dd>
  162. </dl>
  163. <h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(key)</span><span class="type-signature"></span></h4>
  164. <div class="description">
  165. Remove the given key and any associated values. Normalizes the key.
  166. </div>
  167. <h5>Parameters:</h5>
  168. <table class="params">
  169. <thead>
  170. <tr>
  171. <th>Name</th>
  172. <th>Type</th>
  173. <th class="last">Description</th>
  174. </tr>
  175. </thead>
  176. <tbody>
  177. <tr>
  178. <td class="name"><code>key</code></td>
  179. <td class="type">
  180. <span class="param-type">String</span>
  181. </td>
  182. <td class="description last">The key to remove</td>
  183. </tr>
  184. </tbody>
  185. </table>
  186. <dl class="details">
  187. <dt class="tag-source">Source:</dt>
  188. <dd class="tag-source"><ul class="dummy"><li>
  189. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line108">line 108</a>
  190. </li></ul></dd>
  191. </dl>
  192. <h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(key, value)</span><span class="type-signature"></span></h4>
  193. <div class="description">
  194. Sets the given value for the given key, replacing any other values associated
  195. with that key. Normalizes the key.
  196. </div>
  197. <h5>Parameters:</h5>
  198. <table class="params">
  199. <thead>
  200. <tr>
  201. <th>Name</th>
  202. <th>Type</th>
  203. <th class="last">Description</th>
  204. </tr>
  205. </thead>
  206. <tbody>
  207. <tr>
  208. <td class="name"><code>key</code></td>
  209. <td class="type">
  210. <span class="param-type">String</span>
  211. </td>
  212. <td class="description last">The key to set</td>
  213. </tr>
  214. <tr>
  215. <td class="name"><code>value</code></td>
  216. <td class="type">
  217. <span class="param-type">String</span>
  218. |
  219. <span class="param-type">Buffer</span>
  220. </td>
  221. <td class="description last">The value to set. Must be a buffer if and only
  222. if the normalized key ends with '-bin'</td>
  223. </tr>
  224. </tbody>
  225. </table>
  226. <dl class="details">
  227. <dt class="tag-source">Source:</dt>
  228. <dd class="tag-source"><ul class="dummy"><li>
  229. <a href="src_metadata.js.html">src/metadata.js</a>, <a href="src_metadata.js.html#line83">line 83</a>
  230. </li></ul></dd>
  231. </dl>
  232. </article>
  233. </section>
  234. </div>
  235. <nav>
  236. <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_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#getGoogleAuthDelegate">getGoogleAuthDelegate</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>
  237. </nav>
  238. <br class="clear">
  239. <footer>
  240. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.3</a> on Thu Oct 29 2015 13:07:25 GMT-0700 (PDT)
  241. </footer>
  242. <script> prettyPrint(); </script>
  243. <script src="scripts/linenumber.js"> </script>
  244. </body>
  245. </html>