module-src_client.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Module: src/client</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/client</h1>
  17. <section>
  18. <header>
  19. </header>
  20. <article>
  21. <div class="container-overview">
  22. <div class="description">Server module</div>
  23. <dl class="details">
  24. <dt class="tag-source">Source:</dt>
  25. <dd class="tag-source"><ul class="dummy"><li>
  26. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line34">line 34</a>
  27. </li></ul></dd>
  28. </dl>
  29. </div>
  30. <h3 class="subsection-title">Classes</h3>
  31. <dl>
  32. <dt><a href="module-src_client-ClientDuplexStream.html">ClientDuplexStream</a></dt>
  33. <dd></dd>
  34. <dt><a href="module-src_client-ClientReadableStream.html">ClientReadableStream</a></dt>
  35. <dd></dd>
  36. <dt><a href="module-src_client-ClientWritableStream.html">ClientWritableStream</a></dt>
  37. <dd></dd>
  38. </dl>
  39. <h3 class="subsection-title">Members</h3>
  40. <h4 class="name" id=".callError"><span class="type-signature">(static) </span>callError<span class="type-signature"></span></h4>
  41. <div class="description">
  42. See docs for client.callError
  43. </div>
  44. <dl class="details">
  45. <dt class="tag-source">Source:</dt>
  46. <dd class="tag-source"><ul class="dummy"><li>
  47. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line643">line 643</a>
  48. </li></ul></dd>
  49. </dl>
  50. <h4 class="name" id=".status"><span class="type-signature">(static) </span>status<span class="type-signature"></span></h4>
  51. <div class="description">
  52. Map of status code names to status codes
  53. </div>
  54. <dl class="details">
  55. <dt class="tag-source">Source:</dt>
  56. <dd class="tag-source"><ul class="dummy"><li>
  57. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line638">line 638</a>
  58. </li></ul></dd>
  59. </dl>
  60. <h4 class="name" id="~requester_makers"><span class="type-signature">(inner) </span>requester_makers<span class="type-signature"></span></h4>
  61. <div class="description">
  62. Map with short names for each of the requester maker functions. Used in
  63. makeClientConstructor
  64. </div>
  65. <dl class="details">
  66. <dt class="tag-source">Source:</dt>
  67. <dd class="tag-source"><ul class="dummy"><li>
  68. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line517">line 517</a>
  69. </li></ul></dd>
  70. </dl>
  71. <h3 class="subsection-title">Methods</h3>
  72. <h4 class="name" id=".makeClientConstructor"><span class="type-signature">(static) </span>makeClientConstructor<span class="signature">(methods, serviceName)</span><span class="type-signature"> &rarr; {function}</span></h4>
  73. <div class="description">
  74. Creates a constructor for a client with the given methods. The methods object
  75. maps method name to an object with the following keys:
  76. path: The path on the server for accessing the method. For example, for
  77. protocol buffers, we use "/service_name/method_name"
  78. requestStream: bool indicating whether the client sends a stream
  79. resonseStream: bool indicating whether the server sends a stream
  80. requestSerialize: function to serialize request objects
  81. responseDeserialize: function to deserialize response objects
  82. </div>
  83. <h5>Parameters:</h5>
  84. <table class="params">
  85. <thead>
  86. <tr>
  87. <th>Name</th>
  88. <th>Type</th>
  89. <th class="last">Description</th>
  90. </tr>
  91. </thead>
  92. <tbody>
  93. <tr>
  94. <td class="name"><code>methods</code></td>
  95. <td class="type">
  96. <span class="param-type">Object</span>
  97. </td>
  98. <td class="description last">An object mapping method names to method attributes</td>
  99. </tr>
  100. <tr>
  101. <td class="name"><code>serviceName</code></td>
  102. <td class="type">
  103. <span class="param-type">string</span>
  104. </td>
  105. <td class="description last">The fully qualified name of the service</td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. <dl class="details">
  110. <dt class="tag-source">Source:</dt>
  111. <dd class="tag-source"><ul class="dummy"><li>
  112. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line537">line 537</a>
  113. </li></ul></dd>
  114. </dl>
  115. <h5>Returns:</h5>
  116. <div class="param-desc">
  117. New client constructor
  118. </div>
  119. <dl>
  120. <dt>
  121. Type
  122. </dt>
  123. <dd>
  124. <span class="param-type">function</span>
  125. </dd>
  126. </dl>
  127. <h4 class="name" id=".makeProtobufClientConstructor"><span class="type-signature">(static) </span>makeProtobufClientConstructor<span class="signature">(service)</span><span class="type-signature"> &rarr; {function}</span></h4>
  128. <div class="description">
  129. Creates a constructor for clients for the given service
  130. </div>
  131. <h5>Parameters:</h5>
  132. <table class="params">
  133. <thead>
  134. <tr>
  135. <th>Name</th>
  136. <th>Type</th>
  137. <th class="last">Description</th>
  138. </tr>
  139. </thead>
  140. <tbody>
  141. <tr>
  142. <td class="name"><code>service</code></td>
  143. <td class="type">
  144. <span class="param-type">ProtoBuf.Reflect.Service</span>
  145. </td>
  146. <td class="description last">The service to generate a client
  147. for</td>
  148. </tr>
  149. </tbody>
  150. </table>
  151. <dl class="details">
  152. <dt class="tag-source">Source:</dt>
  153. <dd class="tag-source"><ul class="dummy"><li>
  154. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line627">line 627</a>
  155. </li></ul></dd>
  156. </dl>
  157. <h5>Returns:</h5>
  158. <div class="param-desc">
  159. New client constructor
  160. </div>
  161. <dl>
  162. <dt>
  163. Type
  164. </dt>
  165. <dd>
  166. <span class="param-type">function</span>
  167. </dd>
  168. </dl>
  169. <h4 class="name" id="~cancel"><span class="type-signature">(inner) </span>cancel<span class="signature">()</span><span class="type-signature"></span></h4>
  170. <div class="description">
  171. Cancel the ongoing call
  172. </div>
  173. <dl class="details">
  174. <dt class="tag-source">Source:</dt>
  175. <dd class="tag-source"><ul class="dummy"><li>
  176. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line188">line 188</a>
  177. </li></ul></dd>
  178. </dl>
  179. <h4 class="name" id="~getCall"><span class="type-signature">(inner) </span>getCall<span class="signature">(options)</span><span class="type-signature"></span></h4>
  180. <div class="description">
  181. Get a call object built with the provided options. Keys for options are
  182. 'deadline', which takes a date or number, and 'host', which takes a string
  183. and overrides the hostname to connect to.
  184. </div>
  185. <h5>Parameters:</h5>
  186. <table class="params">
  187. <thead>
  188. <tr>
  189. <th>Name</th>
  190. <th>Type</th>
  191. <th class="last">Description</th>
  192. </tr>
  193. </thead>
  194. <tbody>
  195. <tr>
  196. <td class="name"><code>options</code></td>
  197. <td class="type">
  198. <span class="param-type">Object</span>
  199. </td>
  200. <td class="description last">Options map.</td>
  201. </tr>
  202. </tbody>
  203. </table>
  204. <dl class="details">
  205. <dt class="tag-source">Source:</dt>
  206. <dd class="tag-source"><ul class="dummy"><li>
  207. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line216">line 216</a>
  208. </li></ul></dd>
  209. </dl>
  210. <h4 class="name" id="~getPeer"><span class="type-signature">(inner) </span>getPeer<span class="signature">()</span><span class="type-signature"> &rarr; {string}</span></h4>
  211. <div class="description">
  212. Get the endpoint this call/stream is connected to.
  213. </div>
  214. <dl class="details">
  215. <dt class="tag-source">Source:</dt>
  216. <dd class="tag-source"><ul class="dummy"><li>
  217. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line201">line 201</a>
  218. </li></ul></dd>
  219. </dl>
  220. <h5>Returns:</h5>
  221. <div class="param-desc">
  222. The URI of the endpoint
  223. </div>
  224. <dl>
  225. <dt>
  226. Type
  227. </dt>
  228. <dd>
  229. <span class="param-type">string</span>
  230. </dd>
  231. </dl>
  232. <h4 class="name" id="~makeBidiStreamRequestFunction"><span class="type-signature">(inner) </span>makeBidiStreamRequestFunction<span class="signature">(method, serialize, deserialize)</span><span class="type-signature"> &rarr; {function}</span></h4>
  233. <div class="description">
  234. Get a function that can make bidirectional stream requests to the specified
  235. method.
  236. </div>
  237. <h5>Parameters:</h5>
  238. <table class="params">
  239. <thead>
  240. <tr>
  241. <th>Name</th>
  242. <th>Type</th>
  243. <th class="last">Description</th>
  244. </tr>
  245. </thead>
  246. <tbody>
  247. <tr>
  248. <td class="name"><code>method</code></td>
  249. <td class="type">
  250. <span class="param-type">string</span>
  251. </td>
  252. <td class="description last">The name of the method to request</td>
  253. </tr>
  254. <tr>
  255. <td class="name"><code>serialize</code></td>
  256. <td class="type">
  257. <span class="param-type">function</span>
  258. </td>
  259. <td class="description last">The serialization function for inputs</td>
  260. </tr>
  261. <tr>
  262. <td class="name"><code>deserialize</code></td>
  263. <td class="type">
  264. <span class="param-type">function</span>
  265. </td>
  266. <td class="description last">The deserialization function for
  267. outputs</td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. <dl class="details">
  272. <dt class="tag-source">Source:</dt>
  273. <dd class="tag-source"><ul class="dummy"><li>
  274. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line455">line 455</a>
  275. </li></ul></dd>
  276. </dl>
  277. <h5>Returns:</h5>
  278. <div class="param-desc">
  279. makeBidiStreamRequest
  280. </div>
  281. <dl>
  282. <dt>
  283. Type
  284. </dt>
  285. <dd>
  286. <span class="param-type">function</span>
  287. </dd>
  288. </dl>
  289. <h4 class="name" id="~makeClientStreamRequestFunction"><span class="type-signature">(inner) </span>makeClientStreamRequestFunction<span class="signature">(method, serialize, deserialize)</span><span class="type-signature"> &rarr; {function}</span></h4>
  290. <div class="description">
  291. Get a function that can make client stream requests to the specified method.
  292. </div>
  293. <h5>Parameters:</h5>
  294. <table class="params">
  295. <thead>
  296. <tr>
  297. <th>Name</th>
  298. <th>Type</th>
  299. <th class="last">Description</th>
  300. </tr>
  301. </thead>
  302. <tbody>
  303. <tr>
  304. <td class="name"><code>method</code></td>
  305. <td class="type">
  306. <span class="param-type">string</span>
  307. </td>
  308. <td class="description last">The name of the method to request</td>
  309. </tr>
  310. <tr>
  311. <td class="name"><code>serialize</code></td>
  312. <td class="type">
  313. <span class="param-type">function</span>
  314. </td>
  315. <td class="description last">The serialization function for inputs</td>
  316. </tr>
  317. <tr>
  318. <td class="name"><code>deserialize</code></td>
  319. <td class="type">
  320. <span class="param-type">function</span>
  321. </td>
  322. <td class="description last">The deserialization function for
  323. outputs</td>
  324. </tr>
  325. </tbody>
  326. </table>
  327. <dl class="details">
  328. <dt class="tag-source">Source:</dt>
  329. <dd class="tag-source"><ul class="dummy"><li>
  330. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line314">line 314</a>
  331. </li></ul></dd>
  332. </dl>
  333. <h5>Returns:</h5>
  334. <div class="param-desc">
  335. makeClientStreamRequest
  336. </div>
  337. <dl>
  338. <dt>
  339. Type
  340. </dt>
  341. <dd>
  342. <span class="param-type">function</span>
  343. </dd>
  344. </dl>
  345. <h4 class="name" id="~makeServerStreamRequestFunction"><span class="type-signature">(inner) </span>makeServerStreamRequestFunction<span class="signature">(method, serialize, deserialize)</span><span class="type-signature"> &rarr; {function}</span></h4>
  346. <div class="description">
  347. Get a function that can make server stream requests to the specified method.
  348. </div>
  349. <h5>Parameters:</h5>
  350. <table class="params">
  351. <thead>
  352. <tr>
  353. <th>Name</th>
  354. <th>Type</th>
  355. <th class="last">Description</th>
  356. </tr>
  357. </thead>
  358. <tbody>
  359. <tr>
  360. <td class="name"><code>method</code></td>
  361. <td class="type">
  362. <span class="param-type">string</span>
  363. </td>
  364. <td class="description last">The name of the method to request</td>
  365. </tr>
  366. <tr>
  367. <td class="name"><code>serialize</code></td>
  368. <td class="type">
  369. <span class="param-type">function</span>
  370. </td>
  371. <td class="description last">The serialization function for inputs</td>
  372. </tr>
  373. <tr>
  374. <td class="name"><code>deserialize</code></td>
  375. <td class="type">
  376. <span class="param-type">function</span>
  377. </td>
  378. <td class="description last">The deserialization function for
  379. outputs</td>
  380. </tr>
  381. </tbody>
  382. </table>
  383. <dl class="details">
  384. <dt class="tag-source">Source:</dt>
  385. <dd class="tag-source"><ul class="dummy"><li>
  386. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line384">line 384</a>
  387. </li></ul></dd>
  388. </dl>
  389. <h5>Returns:</h5>
  390. <div class="param-desc">
  391. makeServerStreamRequest
  392. </div>
  393. <dl>
  394. <dt>
  395. Type
  396. </dt>
  397. <dd>
  398. <span class="param-type">function</span>
  399. </dd>
  400. </dl>
  401. <h4 class="name" id="~makeUnaryRequestFunction"><span class="type-signature">(inner) </span>makeUnaryRequestFunction<span class="signature">(method, serialize, deserialize)</span><span class="type-signature"> &rarr; {function}</span></h4>
  402. <div class="description">
  403. Get a function that can make unary requests to the specified method.
  404. </div>
  405. <h5>Parameters:</h5>
  406. <table class="params">
  407. <thead>
  408. <tr>
  409. <th>Name</th>
  410. <th>Type</th>
  411. <th class="last">Description</th>
  412. </tr>
  413. </thead>
  414. <tbody>
  415. <tr>
  416. <td class="name"><code>method</code></td>
  417. <td class="type">
  418. <span class="param-type">string</span>
  419. </td>
  420. <td class="description last">The name of the method to request</td>
  421. </tr>
  422. <tr>
  423. <td class="name"><code>serialize</code></td>
  424. <td class="type">
  425. <span class="param-type">function</span>
  426. </td>
  427. <td class="description last">The serialization function for inputs</td>
  428. </tr>
  429. <tr>
  430. <td class="name"><code>deserialize</code></td>
  431. <td class="type">
  432. <span class="param-type">function</span>
  433. </td>
  434. <td class="description last">The deserialization function for
  435. outputs</td>
  436. </tr>
  437. </tbody>
  438. </table>
  439. <dl class="details">
  440. <dt class="tag-source">Source:</dt>
  441. <dd class="tag-source"><ul class="dummy"><li>
  442. <a href="src_client.js.html">src/client.js</a>, <a href="src_client.js.html#line242">line 242</a>
  443. </li></ul></dd>
  444. </dl>
  445. <h5>Returns:</h5>
  446. <div class="param-desc">
  447. makeUnaryRequest
  448. </div>
  449. <dl>
  450. <dt>
  451. Type
  452. </dt>
  453. <dd>
  454. <span class="param-type">function</span>
  455. </dd>
  456. </dl>
  457. </article>
  458. </section>
  459. </div>
  460. <nav>
  461. <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_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_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#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#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></ul>
  462. </nav>
  463. <br class="clear">
  464. <footer>
  465. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.2</a> on Tue Aug 18 2015 18:25:05 GMT-0700 (PDT)
  466. </footer>
  467. <script> prettyPrint(); </script>
  468. <script src="scripts/linenumber.js"> </script>
  469. </body>
  470. </html>