123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <title>Documentation Index</title>
- <!--[if lt IE 9]>
- <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
- <![endif]-->
- <link type="text/css" rel="stylesheet" href="styles/sunlight.default.css">
- <link type="text/css" rel="stylesheet" href="styles/site.simplex.css">
- </head>
- <body>
- <div class="navbar navbar-default navbar-fixed-top ">
- <div class="container">
- <div class="navbar-header">
- <a class="navbar-brand" href="index.html">Documentation</a>
- <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#topNavigation">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </button>
- </div>
- <div class="navbar-collapse collapse" id="topNavigation">
- <ul class="nav navbar-nav">
-
- <li class="dropdown">
- <a href="namespaces.list.html" class="dropdown-toggle" data-toggle="dropdown">Namespaces<b class="caret"></b></a>
- <ul class="dropdown-menu ">
- <li><a href="grpc.html">grpc</a></li><li><a href="grpc.credentials.html">grpc.credentials</a></li>
- </ul>
- </li>
-
- <li class="dropdown">
- <a href="modules.list.html" class="dropdown-toggle" data-toggle="dropdown">Modules<b class="caret"></b></a>
- <ul class="dropdown-menu ">
- <li><a href="module-src_client_interceptors.html">src/client_interceptors</a></li>
- </ul>
- </li>
-
- <li class="dropdown">
- <a href="classes.list.html" class="dropdown-toggle" data-toggle="dropdown">Classes<b class="caret"></b></a>
- <ul class="dropdown-menu ">
- <li><a href="grpc.Channel.html">grpc.Channel</a></li><li><a href="grpc.Client.html">grpc.Client</a></li><li><a href="grpc.credentials-CallCredentials.html">grpc.credentials~CallCredentials</a></li><li><a href="grpc.credentials-ChannelCredentials.html">grpc.credentials~ChannelCredentials</a></li><li><a href="grpc.Metadata.html">grpc.Metadata</a></li><li><a href="grpc.Server.html">grpc.Server</a></li><li><a href="grpc.ServerCredentials.html">grpc.ServerCredentials</a></li><li><a href="grpc-Call.html">grpc~Call</a></li><li><a href="grpc-ClientDuplexStream.html">grpc~ClientDuplexStream</a></li><li><a href="grpc-ClientReadableStream.html">grpc~ClientReadableStream</a></li><li><a href="grpc-ClientUnaryCall.html">grpc~ClientUnaryCall</a></li><li><a href="grpc-ClientWritableStream.html">grpc~ClientWritableStream</a></li><li><a href="grpc-ServerDuplexStream.html">grpc~ServerDuplexStream</a></li><li><a href="grpc-ServerReadableStream.html">grpc~ServerReadableStream</a></li><li><a href="grpc-ServerUnaryCall.html">grpc~ServerUnaryCall</a></li><li><a href="grpc-ServerWritableStream.html">grpc~ServerWritableStream</a></li><li><a href="module-src_client_interceptors-EndListener.html">src/client_interceptors~EndListener</a></li><li><a href="module-src_client_interceptors-InterceptingCall.html">src/client_interceptors~InterceptingCall</a></li><li><a href="module-src_client_interceptors-InterceptingListener.html">src/client_interceptors~InterceptingListener</a></li><li><a href="module-src_client_interceptors-InterceptorConfigurationError.html">src/client_interceptors~InterceptorConfigurationError</a></li><li><a href="module-src_client_interceptors-ListenerBuilder.html">src/client_interceptors~ListenerBuilder</a></li><li><a href="module-src_client_interceptors-RequesterBuilder.html">src/client_interceptors~RequesterBuilder</a></li><li><a href="module-src_client_interceptors-StatusBuilder.html">src/client_interceptors~StatusBuilder</a></li>
- </ul>
- </li>
-
- <li class="dropdown">
- <a href="events.list.html" class="dropdown-toggle" data-toggle="dropdown">Events<b class="caret"></b></a>
- <ul class="dropdown-menu ">
- <li><a href="grpc-ClientDuplexStream.html#event:metadata">grpc~ClientDuplexStream#metadata</a></li><li><a href="grpc-ClientDuplexStream.html#event:status">grpc~ClientDuplexStream#status</a></li><li><a href="grpc-ClientReadableStream.html#event:metadata">grpc~ClientReadableStream#metadata</a></li><li><a href="grpc-ClientReadableStream.html#event:status">grpc~ClientReadableStream#status</a></li><li><a href="grpc-ClientUnaryCall.html#event:metadata">grpc~ClientUnaryCall#event:metadata</a></li><li><a href="grpc-ClientUnaryCall.html#event:status">grpc~ClientUnaryCall#event:status</a></li><li><a href="grpc-ClientWritableStream.html#event:metadata">grpc~ClientWritableStream#metadata</a></li><li><a href="grpc-ClientWritableStream.html#event:status">grpc~ClientWritableStream#status</a></li><li><a href="grpc-ServerDuplexStream.html#~event:cancelled">grpc~ServerDuplexStream~event:cancelled</a></li><li><a href="grpc-ServerReadableStream.html#~event:cancelled">grpc~ServerReadableStream~event:cancelled</a></li><li><a href="grpc-ServerUnaryCall.html#~event:cancelled">grpc~ServerUnaryCall~event:cancelled</a></li><li><a href="grpc-ServerWritableStream.html#~event:cancelled">grpc~ServerWritableStream~event:cancelled</a></li>
- </ul>
- </li>
-
- <li class="dropdown">
- <a href="global.html" class="dropdown-toggle" data-toggle="dropdown">Global<b class="caret"></b></a>
- <ul class="dropdown-menu ">
- <li><a href="global.html#CancelRequester">CancelRequester</a></li><li><a href="global.html#CloseRequester">CloseRequester</a></li><li><a href="global.html#createStatusError">createStatusError</a></li><li><a href="global.html#getClientInterceptors">getClientInterceptors</a></li><li><a href="global.html#getMethodType">getMethodType</a></li><li><a href="global.html#GetPeerRequester">GetPeerRequester</a></li><li><a href="global.html#Interceptor">Interceptor</a></li><li><a href="global.html#InterceptorProvider">InterceptorProvider</a></li><li><a href="global.html#loadPackageDefinition">loadPackageDefinition</a></li><li><a href="global.html#MessageListener">MessageListener</a></li><li><a href="global.html#MessageRequester">MessageRequester</a></li><li><a href="global.html#MetadataListener">MetadataListener</a></li><li><a href="global.html#MetadataRequester">MetadataRequester</a></li><li><a href="global.html#NextCall">NextCall</a></li><li><a href="global.html#StatusListener">StatusListener</a></li>
- </ul>
- </li>
-
- <li class="dropdown">
- <a href="externals.list.html" class="dropdown-toggle" data-toggle="dropdown">Externals<b class="caret"></b></a>
- <ul class="dropdown-menu ">
- <li><a href="external-Duplex.html">Duplex</a></li><li><a href="external-EventEmitter.html">EventEmitter</a></li><li><a href="external-GoogleCredential.html">GoogleCredential</a></li><li><a href="external-Readable.html">Readable</a></li><li><a href="external-Writable.html">Writable</a></li>
- </ul>
- </li>
-
- </ul>
-
- <div class="col-sm-3 col-md-3">
- <form class="navbar-form" role="search">
- <div class="input-group">
- <input type="text" class="form-control" placeholder="Search" name="q" id="search-input">
- <div class="input-group-btn">
- <button class="btn btn-default" id="search-submit"><i class="glyphicon glyphicon-search"></i></button>
- </div>
- </div>
- </form>
- </div>
-
- </div>
- </div>
- </div>
- <div class="container" id="toc-content">
- <div class="row">
-
- <div class="col-md-8">
-
- <div id="main">
-
-
-
-
-
- <section class="readme-section">
- <article><p><a href="https://www.npmjs.com/package/grpc"><img src="https://img.shields.io/npm/v/grpc.svg" alt="npm"></a></p>
- <h1>Node.js gRPC Library</h1><h2>PREREQUISITES</h2><ul>
- <li><p><code>node</code>: This requires <code>node</code> to be installed, version <code>4.0</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>
- </li>
- <li><p><strong>Note:</strong> If you installed <code>node</code> via a package manager and the version is still less than <code>4.0</code>, try directly installing it from <a href="https://nodejs.org">nodejs.org</a>.</p>
- </li>
- </ul>
- <h2>INSTALLATION</h2><p>Install the gRPC NPM package</p>
- <pre class="prettyprint source lang-sh"><code>npm install grpc</code></pre><h2>BUILD FROM SOURCE</h2><p>The following command can be used to build from source when installing the package from npm:</p>
- <pre class="prettyprint source"><code>npm install grpc --build-from-source</code></pre><p>The <code>--build-from-source</code> option will work even when installing another package that depends on <code>grpc</code>. To build only <code>grpc</code> from source, you can use the argument <code>--build-from-source=grpc</code>.</p>
- <h2>ABOUT ELECTRON</h2><p>The official electron documentation recommends to <a href="https://electronjs.org/docs/tutorial/using-native-node-modules#modules-that-rely-on-node-pre-gyp">build all of your native packages from source</a>. While the reasons behind this are technically good - many native extensions won't be packaged to work properly with electron - the gRPC source code is fairly difficult to build from source due to its complex nature, and we're also providing working electron pre-built binaries. Therefore, we recommend that you do not follow this model for using gRPC with electron. Also, for the same reason, <code>electron-rebuild</code> will always build from source. We advise you to not use this tool if you are depending on gRPC. Please note that there's not just one way to get native extensions running in electron, and that there's never any silver bullet for anything. The following instructions try to cater about some of the most generic ways, but different edge cases might require different methodologies.</p>
- <p>The best to get gRPC to work with electron is to do this, possibly in your <code>postinstall</code> script of your <code>package.json</code> file:</p>
- <pre class="prettyprint source"><code>npm rebuild --target=2.0.0 --runtime=electron --dist-url=https://atom.io/download/electron</code></pre><p>Note that the <code>2.0.0</code> above is the electron runtime version number. You will need to update this every time you go on a different version of the runtime.</p>
- <p>If you have more native dependencies than gRPC, and they work better when built from source, you can explicitely specify which extension to build the following way:</p>
- <pre class="prettyprint source"><code>npm rebuild --build-from-source=sqlite3 --target=2.0.0 --runtime=electron --dist-url=https://atom.io/download/electron</code></pre><p>This way, if you depend on both <code>grpc</code> and <code>sqlite3</code>, only the <code>sqlite3</code> package will be rebuilt from source, leaving the <code>grpc</code> package to use its precompiled binaries.</p>
- <h2>BUILD IN GIT REPOSITORY</h2><ol>
- <li>Clone <a href="https://github.com/grpc/grpc-node">the grpc-node Git Repository</a>.</li>
- <li>Run <code>git submodule update --init --recursive</code> from the repository root.</li>
- <li>Run <code>cd packages/grpc-native-core</code>.</li>
- <li><p>Run <code>npm install --build-from-source</code>.</p>
- </li>
- <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>
- <pre class="prettyprint source"><code> ..
- Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
- WINDOWS_BUILD_WARNING
- "..\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"
- ...
- ..</code></pre><p> To fix this, you will have to delete the folder <code>C:\Users\<username>\.node-gyp\<node_version>\include\node\openssl</code> and retry <code>npm install</code></p>
- </li>
- </ol>
- <h2>CONFIGURE BINARIES' LOCATION</h2><p>You can configure the location from which the pre-compiled binaries are downloaded during installation.</p>
- <p><code>npm install --grpc_node_binary_host_mirror=https://your-url.com</code></p>
- <p>Or defining <code>grpc_node_binary_host_mirror</code> in your <code>.npmrc</code>.</p>
- <h2>API DOCUMENTATION</h2><p>See the <a href="https://grpc.io/grpc/node/">API Documentation</a>.</p>
- <h2>TESTING</h2><p>To run the test suite, simply run <code>npm test</code> in the install location.</p></article>
- </section>
- </div>
- </div>
- <div class="clearfix"></div>
-
- <div class="col-md-3">
- <div id="toc" class="col-md-3 hidden-xs hidden-sm hidden-md"></div>
- </div>
-
- </div>
- </div>
- <div class="modal fade" id="searchResults">
- <div class="modal-dialog">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
- <h4 class="modal-title">Search results</h4>
- </div>
- <div class="modal-body"></div>
- <div class="modal-footer">
- <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
- </div>
- </div><!-- /.modal-content -->
- </div><!-- /.modal-dialog -->
- </div>
- <footer>
- <span class="jsdoc-message">
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>
-
- on 2019-07-15T16:38:16-07:00
-
- using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
- </span>
- </footer>
- <script src="scripts/docstrap.lib.js"></script>
- <script src="scripts/toc.js"></script>
- <script type="text/javascript" src="scripts/fulltext-search-ui.js"></script>
- <script>
- $( function () {
- $( "[id*='$']" ).each( function () {
- var $this = $( this );
- $this.attr( "id", $this.attr( "id" ).replace( "$", "__" ) );
- } );
- $( ".tutorial-section pre, .readme-section pre, pre.prettyprint.source" ).each( function () {
- var $this = $( this );
- var example = $this.find( "code" );
- exampleText = example.html();
- var lang = /{@lang (.*?)}/.exec( exampleText );
- if ( lang && lang[1] ) {
- exampleText = exampleText.replace( lang[0], "" );
- example.html( exampleText );
- lang = lang[1];
- } else {
- var langClassMatch = example.parent()[0].className.match(/lang\-(\S+)/);
- lang = langClassMatch ? langClassMatch[1] : "javascript";
- }
- if ( lang ) {
- $this
- .addClass( "sunlight-highlight-" + lang )
- .addClass( "linenums" )
- .html( example.html() );
- }
- } );
- Sunlight.highlightAll( {
- lineNumbers : false,
- showMenu : true,
- enableDoclinks : true
- } );
- $.catchAnchorLinks( {
- navbarOffset: 10
- } );
- $( "#toc" ).toc( {
- anchorName : function ( i, heading, prefix ) {
- return $( heading ).attr( "id" ) || ( prefix + i );
- },
- selectors : "#toc-content h1,#toc-content h2,#toc-content h3,#toc-content h4",
- showAndHide : false,
- smoothScrolling: true
- } );
- $( "#main span[id^='toc']" ).addClass( "toc-shim" );
- $( '.dropdown-toggle' ).dropdown();
- $( "table" ).each( function () {
- var $this = $( this );
- $this.addClass('table');
- } );
- } );
- </script>
- <!--Navigation and Symbol Display-->
- <!--Google Analytics-->
- <script type="text/javascript">
- $(document).ready(function() {
- SearcherDisplay.init();
- });
- </script>
- </body>
- </html>
|