index.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>JSDoc: Home</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">Home</h1>
  17. <h3>grpc 1.0.0</h3>
  18. <section>
  19. <article><p><a href="https://www.npmjs.com/package/grpc"><img src="https://img.shields.io/npm/v/grpc.svg" alt="npm"></a></p>
  20. <h1>Node.js gRPC Library</h1><h2>Status</h2><p>Beta</p>
  21. <h2>PREREQUISITES</h2><ul>
  22. <li><p><code>node</code>: This requires <code>node</code> to be installed, version <code>0.12</code> or above. If you instead have the <code>nodejs</code> executable on Debian, you should install the <a href="https://packages.debian.org/sid/nodejs-legacy"><code>nodejs-legacy</code></a> package.</p>
  23. </li>
  24. <li><p><strong>Note:</strong> If you installed <code>node</code> via a package manager and the version is still less than <code>0.12</code>, try directly installing it from <a href="https://nodejs.org">nodejs.org</a>.</p>
  25. </li>
  26. </ul>
  27. <h2>INSTALLATION</h2><p>Install the gRPC NPM package</p>
  28. <pre class="prettyprint source lang-sh"><code>npm install grpc</code></pre><h2>BUILD FROM SOURCE</h2><ol>
  29. <li>Clone <a href="https://github.com/grpc/grpc">the grpc Git Repository</a>.</li>
  30. <li><p>Run <code>npm install</code> from the repository root.</p>
  31. </li>
  32. <li><p><strong>Note:</strong> On Windows, this might fail due to <a href="https://github.com/nodejs/node/issues/4932">nodejs issue #4932</a> in which case, you will see something like the following in <code>npm install</code>'s output (towards the very beginning):</p>
  33. <pre class="prettyprint source"><code> ..
  34. Building the projects in this solution one at a time. To enable parallel build, please add the &quot;/m&quot; switch.
  35. WINDOWS_BUILD_WARNING
  36. &quot;..\IMPORTANT: Due to https:\github.com\nodejs\node\issues\4932, to build this library on Windows, you must first remove C:\Users\jenkins\.node-gyp\4.4.0\include\node\openssl&quot;
  37. ...
  38. ..</code></pre><p> To fix this, you will have to delete the folder <code>C:\Users\&lt;username&gt;\.node-gyp\&lt;node_version&gt;\include\node\openssl</code> and retry <code>npm install</code></p>
  39. </li>
  40. </ol>
  41. <h2>TESTING</h2><p>To run the test suite, simply run <code>npm test</code> in the install location.</p>
  42. <h2>API</h2><p>This library internally uses <a href="https://github.com/dcodeIO/ProtoBuf.js">ProtoBuf.js</a>, and some structures it exports match those exported by that library</p>
  43. <p>If you require this module, you will get an object with the following members</p>
  44. <pre class="prettyprint source lang-javascript"><code>function load(filename)</code></pre><p>Takes a filename of a <a href="https://developers.google.com/protocol-buffers/">Protocol Buffer</a> file, and returns an object representing the structure of the protocol buffer in the following way:</p>
  45. <ul>
  46. <li>Namespaces become maps from the names of their direct members to those member objects</li>
  47. <li>Service definitions become client constructors for clients for that service. They also have a <code>service</code> member that can be used for constructing servers.</li>
  48. <li>Message definitions become Message constructors like those that ProtoBuf.js would create</li>
  49. <li>Enum definitions become Enum objects like those that ProtoBuf.js would create</li>
  50. <li>Anything else becomes the relevant reflection object that ProtoBuf.js would create</li>
  51. </ul>
  52. <pre class="prettyprint source lang-javascript"><code>function loadObject(reflectionObject)</code></pre><p>Returns the same structure that <code>load</code> returns, but takes a reflection object from <code>ProtoBuf.js</code> instead of a file name.</p>
  53. <pre class="prettyprint source lang-javascript"><code>function Server([serverOpions])</code></pre><p>Constructs a server to which service/implementation pairs can be added.</p>
  54. <pre class="prettyprint source lang-javascript"><code>status</code></pre><p>An object mapping status names to status code numbers.</p>
  55. <pre class="prettyprint source lang-javascript"><code>callError</code></pre><p>An object mapping call error names to codes. This is primarily useful for tracking down certain kinds of internal errors.</p>
  56. <pre class="prettyprint source lang-javascript"><code>Credentials</code></pre><p>An object with factory methods for creating credential objects for clients.</p>
  57. <pre class="prettyprint source lang-javascript"><code>ServerCredentials</code></pre><p>An object with factory methods for creating credential objects for servers.</p></article>
  58. </section>
  59. </div>
  60. <nav>
  61. <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#logVerbosity">logVerbosity</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#setLogger">setLogger</a></li><li><a href="global.html#setLogVerbosity">setLogVerbosity</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>
  62. </nav>
  63. <br class="clear">
  64. <footer>
  65. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Aug 18 2016 12:19:14 GMT-0700 (PDT)
  66. </footer>
  67. <script> prettyPrint(); </script>
  68. <script src="scripts/linenumber.js"> </script>
  69. </body>
  70. </html>