Methods
checkMsg
- checkMsg(msg: object, protos: object): boolean
-
Parameters
-
msg: object
-
protos: object
Returns boolean
encode
- encode(route: string, msg: object): Buffer
-
Parameters
-
route: string
-
msg: object
Returns Buffer
encodeArray
- encodeArray(array: Array<number>, proto: object, offset: number, buffer: Buffer, protos: object): number
-
Parameters
-
array: Array<number>
-
proto: object
-
offset: number
-
buffer: Buffer
-
protos: object
Returns number
encodeMsg
- encodeMsg(buffer: Buffer, offset: number, protos: object, msg: object): number
-
Parameters
-
buffer: Buffer
-
offset: number
-
protos: object
-
msg: object
Returns number
encodeProp
- encodeProp(value: any, type: string, offset: number, buffer: Buffer, protos?: object): number
-
Parameters
-
value: any
-
type: string
-
offset: number
-
buffer: Buffer
-
Optional protos: object
Returns number
encodeTag
- encodeTag(type: "string" | "uInt32" | "sInt32" | "int32" | "float" | "double" | "message", tag: number): number[]
-
Parameters
-
type: "string" | "uInt32" | "sInt32" | "int32" | "float" | "double" | "message"
-
tag: number
Returns number[]
writeBytes
- writeBytes(buffer: Buffer, offset: number, bytes: Array<number>): number
-
Parameters
-
buffer: Buffer
-
offset: number
-
bytes: Array<number>
Returns number
Check if the msg follow the defination in the protos