module-src_common.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Module: src/common</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">Module: src/common</h1>
  17. <section>
  18. <header>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <div class="description">This module contains functions that are common to client and server
  23. code. None of them should be used directly by gRPC users.</div>
  24. <dl class="details">
  25. <dt class="tag-source">Source:</dt>
  26. <dd class="tag-source"><ul class="dummy"><li>
  27. <a href="src_common.js.html">src/common.js</a>, <a href="src_common.js.html#line34">line 34</a>
  28. </li></ul></dd>
  29. </dl>
  30. </div>
  31. <h3 class="subsection-title">Methods</h3>
  32. <h4 class="name" id=".deserializeCls"><span class="type-signature">(static) </span>deserializeCls<span class="signature">(cls)</span><span class="type-signature"> &rarr; {function}</span></h4>
  33. <div class="description">
  34. Get a function that deserializes a specific type of protobuf.
  35. </div>
  36. <h5>Parameters:</h5>
  37. <table class="params">
  38. <thead>
  39. <tr>
  40. <th>Name</th>
  41. <th>Type</th>
  42. <th class="last">Description</th>
  43. </tr>
  44. </thead>
  45. <tbody>
  46. <tr>
  47. <td class="name"><code>cls</code></td>
  48. <td class="type">
  49. <span class="param-type">function</span>
  50. </td>
  51. <td class="description last">The constructor of the message type to deserialize</td>
  52. </tr>
  53. </tbody>
  54. </table>
  55. <dl class="details">
  56. <dt class="tag-source">Source:</dt>
  57. <dd class="tag-source"><ul class="dummy"><li>
  58. <a href="src_common.js.html">src/common.js</a>, <a href="src_common.js.html#line49">line 49</a>
  59. </li></ul></dd>
  60. </dl>
  61. <h5>Returns:</h5>
  62. <div class="param-desc">
  63. The deserialization function
  64. </div>
  65. <dl>
  66. <dt>
  67. Type
  68. </dt>
  69. <dd>
  70. <span class="param-type">function</span>
  71. </dd>
  72. </dl>
  73. <h4 class="name" id=".fullyQualifiedName"><span class="type-signature">(static) </span>fullyQualifiedName<span class="signature">(value)</span><span class="type-signature"> &rarr; {string}</span></h4>
  74. <div class="description">
  75. Get the fully qualified (dotted) name of a ProtoBuf.Reflect value.
  76. </div>
  77. <h5>Parameters:</h5>
  78. <table class="params">
  79. <thead>
  80. <tr>
  81. <th>Name</th>
  82. <th>Type</th>
  83. <th class="last">Description</th>
  84. </tr>
  85. </thead>
  86. <tbody>
  87. <tr>
  88. <td class="name"><code>value</code></td>
  89. <td class="type">
  90. <span class="param-type">ProtoBuf.Reflect.Namespace</span>
  91. </td>
  92. <td class="description last">The value to get the name of</td>
  93. </tr>
  94. </tbody>
  95. </table>
  96. <dl class="details">
  97. <dt class="tag-source">Source:</dt>
  98. <dd class="tag-source"><ul class="dummy"><li>
  99. <a href="src_common.js.html">src/common.js</a>, <a href="src_common.js.html#line87">line 87</a>
  100. </li></ul></dd>
  101. </dl>
  102. <h5>Returns:</h5>
  103. <div class="param-desc">
  104. The fully qualified name of the value
  105. </div>
  106. <dl>
  107. <dt>
  108. Type
  109. </dt>
  110. <dd>
  111. <span class="param-type">string</span>
  112. </dd>
  113. </dl>
  114. <h4 class="name" id=".getProtobufServiceAttrs"><span class="type-signature">(static) </span>getProtobufServiceAttrs<span class="signature">(service)</span><span class="type-signature"> &rarr; {Object}</span></h4>
  115. <div class="description">
  116. Return a map from method names to method attributes for the service.
  117. </div>
  118. <h5>Parameters:</h5>
  119. <table class="params">
  120. <thead>
  121. <tr>
  122. <th>Name</th>
  123. <th>Type</th>
  124. <th class="last">Description</th>
  125. </tr>
  126. </thead>
  127. <tbody>
  128. <tr>
  129. <td class="name"><code>service</code></td>
  130. <td class="type">
  131. <span class="param-type">ProtoBuf.Reflect.Service</span>
  132. </td>
  133. <td class="description last">The service to get attributes for</td>
  134. </tr>
  135. </tbody>
  136. </table>
  137. <dl class="details">
  138. <dt class="tag-source">Source:</dt>
  139. <dd class="tag-source"><ul class="dummy"><li>
  140. <a href="src_common.js.html">src/common.js</a>, <a href="src_common.js.html#line124">line 124</a>
  141. </li></ul></dd>
  142. </dl>
  143. <h5>Returns:</h5>
  144. <div class="param-desc">
  145. The attributes map
  146. </div>
  147. <dl>
  148. <dt>
  149. Type
  150. </dt>
  151. <dd>
  152. <span class="param-type">Object</span>
  153. </dd>
  154. </dl>
  155. <h4 class="name" id=".serializeCls"><span class="type-signature">(static) </span>serializeCls<span class="signature">(Cls)</span><span class="type-signature"> &rarr; {function}</span></h4>
  156. <div class="description">
  157. Get a function that serializes objects to a buffer by protobuf class.
  158. </div>
  159. <h5>Parameters:</h5>
  160. <table class="params">
  161. <thead>
  162. <tr>
  163. <th>Name</th>
  164. <th>Type</th>
  165. <th class="last">Description</th>
  166. </tr>
  167. </thead>
  168. <tbody>
  169. <tr>
  170. <td class="name"><code>Cls</code></td>
  171. <td class="type">
  172. <span class="param-type">function</span>
  173. </td>
  174. <td class="description last">The constructor of the message type to serialize</td>
  175. </tr>
  176. </tbody>
  177. </table>
  178. <dl class="details">
  179. <dt class="tag-source">Source:</dt>
  180. <dd class="tag-source"><ul class="dummy"><li>
  181. <a href="src_common.js.html">src/common.js</a>, <a href="src_common.js.html#line69">line 69</a>
  182. </li></ul></dd>
  183. </dl>
  184. <h5>Returns:</h5>
  185. <div class="param-desc">
  186. The serialization function
  187. </div>
  188. <dl>
  189. <dt>
  190. Type
  191. </dt>
  192. <dd>
  193. <span class="param-type">function</span>
  194. </dd>
  195. </dl>
  196. <h4 class="name" id=".wrapIgnoreNull"><span class="type-signature">(static) </span>wrapIgnoreNull<span class="signature">(func<span class="signature-attributes">nullable</span>)</span><span class="type-signature"> &rarr; {function}</span></h4>
  197. <div class="description">
  198. Wrap a function to pass null-like values through without calling it. If no
  199. function is given, just uses the identity;
  200. </div>
  201. <h5>Parameters:</h5>
  202. <table class="params">
  203. <thead>
  204. <tr>
  205. <th>Name</th>
  206. <th>Type</th>
  207. <th>Attributes</th>
  208. <th class="last">Description</th>
  209. </tr>
  210. </thead>
  211. <tbody>
  212. <tr>
  213. <td class="name"><code>func</code></td>
  214. <td class="type">
  215. <span class="param-type">function</span>
  216. </td>
  217. <td class="attributes">
  218. &lt;nullable><br>
  219. </td>
  220. <td class="description last">The function to wrap</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_common.js.html">src/common.js</a>, <a href="src_common.js.html#line107">line 107</a>
  228. </li></ul></dd>
  229. </dl>
  230. <h5>Returns:</h5>
  231. <div class="param-desc">
  232. The wrapped function
  233. </div>
  234. <dl>
  235. <dt>
  236. Type
  237. </dt>
  238. <dd>
  239. <span class="param-type">function</span>
  240. </dd>
  241. </dl>
  242. </article>
  243. </section>
  244. </div>
  245. <nav>
  246. <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>
  247. </nav>
  248. <br class="clear">
  249. <footer>
  250. 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)
  251. </footer>
  252. <script> prettyPrint(); </script>
  253. <script src="scripts/linenumber.js"> </script>
  254. </body>
  255. </html>