This module contains functions that are common to client and server
code. None of them should be used directly by gRPC users.
- Source:
Methods
(static) 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
(static) 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
(static) 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
(static) 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
(static) wrapIgnoreNull(funcnullable) → {function}
Wrap a function to pass null-like values through without calling it. If no
function is given, just uses the identity;
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
func |
function |
<nullable> |
The function to wrap |
- Source:
Returns:
The wrapped function
- Type
- function