[add] first
This commit is contained in:
14
benchmark/protocols/PtlTest.ts
Normal file
14
benchmark/protocols/PtlTest.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { uint } from 'tsbuffer-schema';
|
||||
export interface ReqTest {
|
||||
a?: uint;
|
||||
b?: string;
|
||||
c?: boolean;
|
||||
d?: Uint8Array;
|
||||
}
|
||||
|
||||
export interface ResTest {
|
||||
a?: uint;
|
||||
b?: string;
|
||||
c?: boolean;
|
||||
d?: Uint8Array;
|
||||
}
|
||||
104
benchmark/protocols/proto.ts
Normal file
104
benchmark/protocols/proto.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import { ServiceProto } from 'tsrpc-proto';
|
||||
import { ReqTest, ResTest } from './PtlTest'
|
||||
|
||||
export interface ServiceType {
|
||||
api: {
|
||||
"Test": {
|
||||
req: ReqTest,
|
||||
res: ResTest
|
||||
}
|
||||
},
|
||||
msg: {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export const serviceProto: ServiceProto<ServiceType> = {
|
||||
"services": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "Test",
|
||||
"type": "api"
|
||||
}
|
||||
],
|
||||
"types": {
|
||||
"PtlTest/ReqTest": {
|
||||
"type": "Interface",
|
||||
"properties": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "a",
|
||||
"type": {
|
||||
"type": "Number",
|
||||
"scalarType": "uint"
|
||||
},
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "b",
|
||||
"type": {
|
||||
"type": "String"
|
||||
},
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "c",
|
||||
"type": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "d",
|
||||
"type": {
|
||||
"type": "Buffer",
|
||||
"arrayType": "Uint8Array"
|
||||
},
|
||||
"optional": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"PtlTest/ResTest": {
|
||||
"type": "Interface",
|
||||
"properties": [
|
||||
{
|
||||
"id": 0,
|
||||
"name": "a",
|
||||
"type": {
|
||||
"type": "Number",
|
||||
"scalarType": "uint"
|
||||
},
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"id": 1,
|
||||
"name": "b",
|
||||
"type": {
|
||||
"type": "String"
|
||||
},
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"name": "c",
|
||||
"type": {
|
||||
"type": "Boolean"
|
||||
},
|
||||
"optional": true
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "d",
|
||||
"type": {
|
||||
"type": "Buffer",
|
||||
"arrayType": "Uint8Array"
|
||||
},
|
||||
"optional": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user