aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Tim Emiola <tbetbetbe@users.noreply.github.com>2015-10-30 11:24:45 +0900
committerGravatar Tim Emiola <tbetbetbe@users.noreply.github.com>2015-10-30 11:24:45 +0900
commit4cca1a56995aeabb15769fd7eb30aad3741f4511 (patch)
tree4db2f81e2c6158c509d146d2c8a9a4544393135c
parent8b162cd41f0e13ae4db4f5b6b9e0e9866333f264 (diff)
parent3c769d67a348e4caadd5c57b9694bb4b62c20873 (diff)
Merge pull request #3886 from murgatroid99/node_file_comments
Added some file-level comments to Node source files
-rw-r--r--src/node/src/client.js11
-rw-r--r--src/node/src/common.js2
-rw-r--r--src/node/src/metadata.js9
-rw-r--r--src/node/src/server.js15
4 files changed, 35 insertions, 2 deletions
diff --git a/src/node/src/client.js b/src/node/src/client.js
index 596ea5ebb0..3cdd550752 100644
--- a/src/node/src/client.js
+++ b/src/node/src/client.js
@@ -33,6 +33,17 @@
/**
* Client module
+ *
+ * This module contains the factory method for creating Client classes, and the
+ * method calling code for all types of methods.
+ *
+ * For example, to create a client and call a method on it:
+ *
+ * var proto_obj = grpc.load(proto_file_path);
+ * var Client = proto_obj.package.subpackage.ServiceName;
+ * var client = new Client(server_address, client_credentials);
+ * var call = client.unaryMethod(arguments, callback);
+ *
* @module
*/
diff --git a/src/node/src/common.js b/src/node/src/common.js
index ebaaa13db0..e4fe5a8e03 100644
--- a/src/node/src/common.js
+++ b/src/node/src/common.js
@@ -32,6 +32,8 @@
*/
/**
+ * This module contains functions that are common to client and server
+ * code. None of them should be used directly by gRPC users.
* @module
*/
diff --git a/src/node/src/metadata.js b/src/node/src/metadata.js
index 183c3ad4fc..0a2f1489b6 100644
--- a/src/node/src/metadata.js
+++ b/src/node/src/metadata.js
@@ -33,6 +33,15 @@
/**
* Metadata module
+ *
+ * This module defines the Metadata class, which represents header and trailer
+ * metadata for gRPC calls. Here is an example of how to use it:
+ *
+ * var metadata = new metadata_module.Metadata();
+ * metadata.set('key1', 'value1');
+ * metadata.add('key1', 'value2');
+ * metadata.get('key1') // returns ['value1', 'value2']
+ *
* @module
*/
diff --git a/src/node/src/server.js b/src/node/src/server.js
index 89e1090c6c..d1fb627e6c 100644
--- a/src/node/src/server.js
+++ b/src/node/src/server.js
@@ -33,6 +33,17 @@
/**
* Server module
+ *
+ * This module contains all the server code for Node gRPC: both the Server
+ * class itself and the method handler code for all types of methods.
+ *
+ * For example, to create a Server, add a service, and start it:
+ *
+ * var server = new server_module.Server();
+ * server.addProtoService(protobuf_service_descriptor, service_implementation);
+ * server.bind('address:port', server_credential);
+ * server.start();
+ *
* @module
*/
@@ -746,8 +757,8 @@ Server.prototype.addProtoService = function(service, implementation) {
* Binds the server to the given port, with SSL enabled if creds is given
* @param {string} port The port that the server should bind on, in the format
* "address:port"
- * @param {boolean=} creds Server credential object to be used for SSL. Pass
- * nothing for an insecure port
+ * @param {ServerCredentials=} creds Server credential object to be used for
+ * SSL. Pass an insecure credentials object for an insecure port.
*/
Server.prototype.bind = function(port, creds) {
if (this.started) {