index.html 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 0.10.0</h3>
  18. <section>
  19. <article><h1>Node.js gRPC Library</h1><h2>Status</h2><p>Alpha : Ready for early adopters</p>
  20. <h2>PREREQUISITES</h2><ul>
  21. <li><code>node</code>: This requires <code>node</code> to be installed. 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.</li>
  22. <li><a href="http://brew.sh">homebrew</a> on Mac OS X. These simplify the installation of the gRPC C core.</li>
  23. </ul>
  24. <h2>INSTALLATION</h2><p><strong>Linux (Debian):</strong></p>
  25. <p>Add <a href="https://www.debian.org/releases/stretch/">Debian testing</a> to your <code>sources.list</code> file. Example:</p>
  26. <pre class="prettyprint source lang-sh"><code>echo &quot;deb http://ftp.us.debian.org/debian testing main contrib non-free&quot; | \
  27. sudo tee -a /etc/apt/sources.list</code></pre><p>Install the gRPC Debian package</p>
  28. <pre class="prettyprint source lang-sh"><code>sudo apt-get update
  29. sudo apt-get install libgrpc-dev</code></pre><p>Install the gRPC NPM package</p>
  30. <pre class="prettyprint source lang-sh"><code>npm install grpc</code></pre><p><strong>Mac OS X</strong></p>
  31. <p>Install <a href="http://brew.sh">homebrew</a>. Run the following command to install gRPC Node.js.</p>
  32. <pre class="prettyprint source lang-sh"><code>$ curl -fsSL https://goo.gl/getgrpc | bash -s nodejs</code></pre><p>This will download and run the <a href="https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install">gRPC install script</a>, then install the latest version of gRPC Nodejs npm package.</p>
  33. <h2>BUILD FROM SOURCE</h2><ol>
  34. <li>Clone <a href="https://github.com/grpc/grpc">the grpc Git Repository</a>.</li>
  35. <li>Follow the instructions in the <code>INSTALL</code> file in the root of that repository to install the C core library that this package depends on.</li>
  36. <li>Run <code>npm install</code>.</li>
  37. </ol>
  38. <p>If you install the gRPC C core library in a custom location, then you need to set some environment variables to install this library. The command will look like this:</p>
  39. <pre class="prettyprint source lang-sh"><code>CXXFLAGS=-I&lt;custom location>/include LDFLAGS=-L&lt;custom location>/lib npm install [grpc]</code></pre><h2>TESTING</h2><p>To run the test suite, simply run <code>npm test</code> in the install location.</p>
  40. <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>
  41. <p>If you require this module, you will get an object with the following members</p>
  42. <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>
  43. <ul>
  44. <li>Namespaces become maps from the names of their direct members to those member objects</li>
  45. <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>
  46. <li>Message definitions become Message constructors like those that ProtoBuf.js would create</li>
  47. <li>Enum definitions become Enum objects like those that ProtoBuf.js would create</li>
  48. <li>Anything else becomes the relevant reflection object that ProtoBuf.js would create</li>
  49. </ul>
  50. <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>
  51. <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>
  52. <pre class="prettyprint source lang-javascript"><code>status</code></pre><p>An object mapping status names to status code numbers.</p>
  53. <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>
  54. <pre class="prettyprint source lang-javascript"><code>Credentials</code></pre><p>An object with factory methods for creating credential objects for clients.</p>
  55. <pre class="prettyprint source lang-javascript"><code>ServerCredentials</code></pre><p>An object with factory methods for creating credential objects for servers.</p></article>
  56. </section>
  57. </div>
  58. <nav>
  59. <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>
  60. </nav>
  61. <br class="clear">
  62. <footer>
  63. Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.3.2</a> on Mon Aug 31 2015 11:35:11 GMT-0700 (PDT)
  64. </footer>
  65. <script> prettyPrint(); </script>
  66. <script src="scripts/linenumber.js"> </script>
  67. </body>
  68. </html>