UNPKG

@mishmash-io/mishmash-rpc

Version:

mishmash.io gRPC client services

93 lines (80 loc) 3.98 kB
// GENERATED CODE -- DO NOT EDIT! // Original file comments: // // Copyright 2020 MISHMASH I O OOD // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. 'use strict'; var grpc = require('grpc'); var protobuf_mishmash_rpc_pb = require('../protobuf/mishmash_rpc_pb.js'); function serialize_io_mishmash_common_rpc_MutationClientMessage(arg) { if (!(arg instanceof protobuf_mishmash_rpc_pb.MutationClientMessage)) { throw new Error('Expected argument of type io.mishmash.common.rpc.MutationClientMessage'); } return Buffer.from(arg.serializeBinary()); } function deserialize_io_mishmash_common_rpc_MutationClientMessage(buffer_arg) { return protobuf_mishmash_rpc_pb.MutationClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_io_mishmash_common_rpc_MutationServerMessage(arg) { if (!(arg instanceof protobuf_mishmash_rpc_pb.MutationServerMessage)) { throw new Error('Expected argument of type io.mishmash.common.rpc.MutationServerMessage'); } return Buffer.from(arg.serializeBinary()); } function deserialize_io_mishmash_common_rpc_MutationServerMessage(buffer_arg) { return protobuf_mishmash_rpc_pb.MutationServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_io_mishmash_common_rpc_StreamClientMessage(arg) { if (!(arg instanceof protobuf_mishmash_rpc_pb.StreamClientMessage)) { throw new Error('Expected argument of type io.mishmash.common.rpc.StreamClientMessage'); } return Buffer.from(arg.serializeBinary()); } function deserialize_io_mishmash_common_rpc_StreamClientMessage(buffer_arg) { return protobuf_mishmash_rpc_pb.StreamClientMessage.deserializeBinary(new Uint8Array(buffer_arg)); } function serialize_io_mishmash_common_rpc_StreamServerMessage(arg) { if (!(arg instanceof protobuf_mishmash_rpc_pb.StreamServerMessage)) { throw new Error('Expected argument of type io.mishmash.common.rpc.StreamServerMessage'); } return Buffer.from(arg.serializeBinary()); } function deserialize_io_mishmash_common_rpc_StreamServerMessage(buffer_arg) { return protobuf_mishmash_rpc_pb.StreamServerMessage.deserializeBinary(new Uint8Array(buffer_arg)); } var MishmashServiceService = exports.MishmashServiceService = { stream: { path: '/io.mishmash.common.rpc.MishmashService/stream', requestStream: true, responseStream: true, requestType: protobuf_mishmash_rpc_pb.StreamClientMessage, responseType: protobuf_mishmash_rpc_pb.StreamServerMessage, requestSerialize: serialize_io_mishmash_common_rpc_StreamClientMessage, requestDeserialize: deserialize_io_mishmash_common_rpc_StreamClientMessage, responseSerialize: serialize_io_mishmash_common_rpc_StreamServerMessage, responseDeserialize: deserialize_io_mishmash_common_rpc_StreamServerMessage, }, mutate: { path: '/io.mishmash.common.rpc.MishmashService/mutate', requestStream: true, responseStream: true, requestType: protobuf_mishmash_rpc_pb.MutationClientMessage, responseType: protobuf_mishmash_rpc_pb.MutationServerMessage, requestSerialize: serialize_io_mishmash_common_rpc_MutationClientMessage, requestDeserialize: deserialize_io_mishmash_common_rpc_MutationClientMessage, responseSerialize: serialize_io_mishmash_common_rpc_MutationServerMessage, responseDeserialize: deserialize_io_mishmash_common_rpc_MutationServerMessage, }, }; exports.MishmashServiceClient = grpc.makeGenericClientConstructor(MishmashServiceService);