Module: src/client

Server module
Source:

Classes

ClientDuplexStream
ClientReadableStream
ClientWritableStream

Members

(static) callError

See docs for client.callError
Source:

(static) status

Map of status code names to status codes
Source:

(inner) requester_makers

Map with short names for each of the requester maker functions. Used in makeClientConstructor
Source:

Methods

(static) makeClientConstructor(methods, serviceName) → {function}

Creates a constructor for a client with the given methods. The methods object maps method name to an object with the following keys: path: The path on the server for accessing the method. For example, for protocol buffers, we use "/service_name/method_name" requestStream: bool indicating whether the client sends a stream resonseStream: bool indicating whether the server sends a stream requestSerialize: function to serialize request objects responseDeserialize: function to deserialize response objects
Parameters:
Name Type Description
methods Object An object mapping method names to method attributes
serviceName string The fully qualified name of the service
Source:
Returns:
New client constructor
Type
function

(static) makeProtobufClientConstructor(service) → {function}

Creates a constructor for clients for the given service
Parameters:
Name Type Description
service ProtoBuf.Reflect.Service The service to generate a client for
Source:
Returns:
New client constructor
Type
function

(inner) cancel()

Cancel the ongoing call
Source:

(inner) getCall(options)

Get a call object built with the provided options. Keys for options are 'deadline', which takes a date or number, and 'host', which takes a string and overrides the hostname to connect to.
Parameters:
Name Type Description
options Object Options map.
Source:

(inner) getPeer() → {string}

Get the endpoint this call/stream is connected to.
Source:
Returns:
The URI of the endpoint
Type
string

(inner) makeBidiStreamRequestFunction(method, serialize, deserialize) → {function}

Get a function that can make bidirectional stream requests to the specified method.
Parameters:
Name Type Description
method string The name of the method to request
serialize function The serialization function for inputs
deserialize function The deserialization function for outputs
Source:
Returns:
makeBidiStreamRequest
Type
function

(inner) makeClientStreamRequestFunction(method, serialize, deserialize) → {function}

Get a function that can make client stream requests to the specified method.
Parameters:
Name Type Description
method string The name of the method to request
serialize function The serialization function for inputs
deserialize function The deserialization function for outputs
Source:
Returns:
makeClientStreamRequest
Type
function

(inner) makeServerStreamRequestFunction(method, serialize, deserialize) → {function}

Get a function that can make server stream requests to the specified method.
Parameters:
Name Type Description
method string The name of the method to request
serialize function The serialization function for inputs
deserialize function The deserialization function for outputs
Source:
Returns:
makeServerStreamRequest
Type
function

(inner) makeUnaryRequestFunction(method, serialize, deserialize) → {function}

Get a function that can make unary requests to the specified method.
Parameters:
Name Type Description
method string The name of the method to request
serialize function The serialization function for inputs
deserialize function The deserialization function for outputs
Source:
Returns:
makeUnaryRequest
Type
function