Members
callError
Call error name to code number mapping
credentials
Credentials factories
getClientChannel
- Source:
- See:
logVerbosity
Log verbosity setting name to code number mapping
makeGenericClientConstructor
- Source:
- See:
Metadata
- Source:
- See:
propagate
Propagate flag name to number mapping
Server
- Source:
- See:
ServerCredentials
ServerCredentials factories
status
Status name to code number mapping
waitForClientReady
- Source:
- See:
writeFlags
Write flag name to code number mapping
Methods
deserializeCls(cls, binaryAsBase64opt, longsAsStringsopt) → {function}
Get a function that deserializes a specific type of protobuf.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
cls |
function | The constructor of the message type to deserialize | |
binaryAsBase64 |
bool |
<optional> |
Deserialize bytes fields as base64 strings instead of Buffers. Defaults to false |
longsAsStrings |
bool |
<optional> |
Deserialize long values as strings instead of objects. Defaults to true |
- Source:
Returns:
The deserialization function
- Type
- function
deserializeCls(cls, binaryAsBase64opt, longsAsStringsopt) → {function}
Get a function that deserializes a specific type of protobuf.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
cls |
function | The constructor of the message type to deserialize | |
binaryAsBase64 |
bool |
<optional> |
Deserialize bytes fields as base64 strings instead of Buffers. Defaults to false |
longsAsStrings |
bool |
<optional> |
Deserialize long values as strings instead of objects. Defaults to true |
- Source:
Returns:
The deserialization function
- Type
- function
fullyQualifiedName(value) → {string}
Get the fully qualified (dotted) name of a ProtoBuf.Reflect value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
ProtoBuf.ReflectionObject | The value to get the name of |
- Source:
Returns:
The fully qualified name of the value
- Type
- string
fullyQualifiedName(value) → {string}
Get the fully qualified (dotted) name of a ProtoBuf.Reflect value.
Parameters:
| Name | Type | Description |
|---|---|---|
value |
ProtoBuf.Reflect.Namespace | The value to get the name of |
- Source:
Returns:
The fully qualified name of the value
- Type
- string
getProtobufServiceAttrs(service, optionsopt) → {Object}
Return a map from method names to method attributes for the service.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
service |
ProtoBuf.Service | The service to get attributes for | |
options |
Object |
<optional> |
Options to apply to these attributes |
- Source:
Returns:
The attributes map
- Type
- Object
getProtobufServiceAttrs(service, optionsopt) → {Object}
Return a map from method names to method attributes for the service.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
service |
ProtoBuf.Reflect.Service | The service to get attributes for | |
options |
Object |
<optional> |
Options to apply to these attributes |
- Source:
Returns:
The attributes map
- Type
- Object
isProbablyProtobufJs5(obj) → {boolean}
The primary purpose of this method is to distinguish between reflection
objects from different versions of ProtoBuf.js. This is just a heuristic,
checking for properties that are (currently) specific to this version of
ProtoBuf.js
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
Object | The object to check |
- Source:
Returns:
Whether the object appears to be a Protobuf.js 5
ReflectionObject
- Type
- boolean
isProbablyProtobufJs6(obj) → {boolean}
The primary purpose of this method is to distinguish between reflection
objects from different versions of ProtoBuf.js. This is just a heuristic,
checking for properties that are (currently) specific to this version of
ProtoBuf.js
Parameters:
| Name | Type | Description |
|---|---|---|
obj |
Object | The object to check |
- Source:
Returns:
Whether the object appears to be a Protobuf.js 6
ReflectionObject
- Type
- boolean
load(filename, formatopt, optionsopt) → {Object.<string, *>}
Load a gRPC object from a .proto file. The options object can provide the
following options:
- convertFieldsToCamelCase: Load this file with field names in camel case
instead of their original case
- binaryAsBase64: deserialize bytes values as base64 strings instead of
Buffers. Defaults to false
- longsAsStrings: deserialize long values as strings instead of objects.
Defaults to true
- enumsAsStrings: deserialize enum values as strings instead of numbers.
Defaults to true
- deprecatedArgumentOrder: Use the beta method argument order for client
methods, with optional arguments after the callback. Defaults to false.
This option is only a temporary stopgap measure to smooth an API breakage.
It is deprecated, and new code should not use it.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
filename |
string | Object | The file to load | |
format |
string |
<optional> |
The file format to expect. Must be either 'proto' or 'json'. Defaults to 'proto' |
options |
Object |
<optional> |
Options to apply to the loaded file |
Returns:
The resulting gRPC object
- Type
- Object.<string, *>
loadObject(value, optionsopt) → {Object.<string, *>}
Load a gRPC object from an existing ProtoBuf.Reflect object.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
ProtoBuf.Reflect.Namespace | The ProtoBuf object to load. | |
options |
Object |
<optional> |
Options to apply to the loaded object |
- Source:
Returns:
The resulting gRPC object
- Type
- Object.<string, *>
loadObject(value, optionsopt) → {Object.<string, *>}
Load a ProtoBuf.js object as a gRPC object. The options object can provide
the following options:
- binaryAsBase64: deserialize bytes values as base64 strings instead of
Buffers. Defaults to false
- longsAsStrings: deserialize long values as strings instead of objects.
Defaults to true
- enumsAsStrings: deserialize enum values as strings instead of numbers.
Defaults to true
- deprecatedArgumentOrder: Use the beta method argument order for client
methods, with optional arguments after the callback. Defaults to false.
This option is only a temporary stopgap measure to smooth an API breakage.
It is deprecated, and new code should not use it.
- protobufjsVersion: Available values are 5, 6, and 'detect'. 5 and 6
respectively indicate that an object from the corresponding version of
ProtoBuf.js is provided in the value argument. If the option is 'detect',
gRPC will guess what the version is based on the structure of the value.
Defaults to 'detect'.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
value |
Object | The ProtoBuf.js reflection object to load | |
options |
Object |
<optional> |
Options to apply to the loaded file |
Returns:
The resulting gRPC object
- Type
- Object.<string, *>
serializeCls(Cls) → {function}
Get a function that serializes objects to a buffer by protobuf class.
Parameters:
| Name | Type | Description |
|---|---|---|
Cls |
function | The constructor of the message type to serialize |
- Source:
Returns:
The serialization function
- Type
- function
serializeCls(Cls) → {function}
Get a function that serializes objects to a buffer by protobuf class.
Parameters:
| Name | Type | Description |
|---|---|---|
Cls |
function | The constructor of the message type to serialize |
- Source:
Returns:
The serialization function
- Type
- function
setLogger(logger)
Sets the logger function for the gRPC module. For debugging purposes, the C
core will log synchronously directly to stdout unless this function is
called. Note: the output format here is intended to be informational, and
is not guaranteed to stay the same in the future.
Logs will be directed to logger.error.
Parameters:
| Name | Type | Description |
|---|---|---|
logger |
Console | A Console-like object. |
setLogVerbosity(verbosity)
Sets the logger verbosity for gRPC module logging. The options are members
of the grpc.logVerbosity map.
Parameters:
| Name | Type | Description |
|---|---|---|
verbosity |
Number | The minimum severity to log |