summaryrefslogtreecommitdiff
path: root/tests/monster_test_grpc.js
blob: c12d78954df6492fee41bef88f5c5c7d7d280d71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Generated GRPC code for FlatBuffers TS *** DO NOT EDIT ***
import { flatbuffers } from 'flatbuffers';
import *  as MonsterStorage_fbs from './monster_test_generated';

var grpc = require('grpc');

function serialize_Stat(buffer_args) {
  if (!(buffer_args instanceof MonsterStorage_fbs.Stat)) {
    throw new Error('Expected argument of type MonsterStorage_fbs.Stat');
  }
  return buffer_args.serialize();
}

function deserialize_Stat(buffer) {
  return MonsterStorage_fbs.Stat.getRootAsStat(new flatbuffers.ByteBuffer(buffer))
}


function serialize_Monster(buffer_args) {
  if (!(buffer_args instanceof MonsterStorage_fbs.Monster)) {
    throw new Error('Expected argument of type MonsterStorage_fbs.Monster');
  }
  return buffer_args.serialize();
}

function deserialize_Monster(buffer) {
  return MonsterStorage_fbs.Monster.getRootAsMonster(new flatbuffers.ByteBuffer(buffer))
}




var MonsterStorageService = exports.MonsterStorageService = {
  Store: {
    path: '/MyGame.Example.MonsterStorage/Store',
    requestStream: false,
    responseStream: false,
    requestType: flatbuffers.ByteBuffer,
    responseType: MonsterStorage_fbs.Stat,
    requestSerialize: serialize_Monster,
    requestDeserialize: deserialize_Monster,
    responseSerialize: serialize_Stat,
    responseDeserialize: deserialize_Stat,
  },
  Retrieve: {
    path: '/MyGame.Example.MonsterStorage/Retrieve',
    requestStream: false,
    responseStream: true,
    requestType: flatbuffers.ByteBuffer,
    responseType: MonsterStorage_fbs.Monster,
    requestSerialize: serialize_Stat,
    requestDeserialize: deserialize_Stat,
    responseSerialize: serialize_Monster,
    responseDeserialize: deserialize_Monster,
  },
  GetMaxHitPoint: {
    path: '/MyGame.Example.MonsterStorage/GetMaxHitPoint',
    requestStream: true,
    responseStream: false,
    requestType: flatbuffers.ByteBuffer,
    responseType: MonsterStorage_fbs.Stat,
    requestSerialize: serialize_Monster,
    requestDeserialize: deserialize_Monster,
    responseSerialize: serialize_Stat,
    responseDeserialize: deserialize_Stat,
  },
  GetMinMaxHitPoints: {
    path: '/MyGame.Example.MonsterStorage/GetMinMaxHitPoints',
    requestStream: true,
    responseStream: true,
    requestType: flatbuffers.ByteBuffer,
    responseType: MonsterStorage_fbs.Stat,
    requestSerialize: serialize_Monster,
    requestDeserialize: deserialize_Monster,
    responseSerialize: serialize_Stat,
    responseDeserialize: deserialize_Stat,
  },
};
exports.MonsterStorageClient = grpc.makeGenericClientConstructor(MonsterStorageService);