How to use the @creditkarma/thrift-server-core.BinaryProtocol function in @creditkarma/thrift-server-core

To help you get started, we’ve selected a few @creditkarma/thrift-server-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / TcpConnection.spec.ts View on Github external
socket.addListener('data', (chunk: Buffer) => {
                        if (count < 1) {
                            count += 1
                            const upgradeResponse: TTwitter.IUpgradeReply = {}
                            const writer: thrift.TTransport = new thrift.BufferedTransport()
                            const output: thrift.TProtocol = new thrift.BinaryProtocol(
                                writer,
                            )
                            output.writeMessageBegin(
                                'add',
                                thrift.MessageType.CALL,
                                1,
                            )
                            TTwitter.UpgradeReplyCodec.encode(
                                upgradeResponse,
                                output,
                            )
                            output.writeMessageEnd()
                            socket.write(frameCodec.encode(writer.flush()))
                        } else {
                            const responseHeader = new TTwitter.ResponseHeader(
                                {},
github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / TcpConnection.spec.ts View on Github external
socket.addListener('data', (chunk: Buffer) => {
                        const meta: IMetadata = { traceId: 9 }
                        const writer: thrift.TTransport = new thrift.BufferedTransport()
                        const output: thrift.TProtocol = new thrift.BinaryProtocol(
                            writer,
                        )
                        output.writeMessageBegin(
                            'add',
                            thrift.MessageType.CALL,
                            1,
                        )
                        const result = new Calculator.Add__Result({
                            success: 89,
                        })
                        result.write(output)
                        output.writeMessageEnd()
                        const data: Buffer = writer.flush()

                        thrift
                            .appendThriftObject(meta, data, MetadataCodec)
github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / HttpConnection.spec.ts View on Github external
output.writeMessageBegin(
                                'add',
                                thrift.MessageType.CALL,
                                1,
                            )
                            TTwitter.UpgradeReplyCodec.encode(
                                upgradeResponse,
                                output,
                            )
                            output.writeMessageEnd()
                            res.writeHead(200)
                            res.end(writer.flush())
                        } else {
                            const responseHeader: TTwitter.IResponseHeader = {}
                            const writer: thrift.TTransport = new thrift.BufferedTransport()
                            const output: thrift.TProtocol = new thrift.BinaryProtocol(
                                writer,
                            )
                            output.writeMessageBegin(
                                'add',
                                thrift.MessageType.CALL,
                                1,
                            )
                            const result = new Calculator.Add__Result({
                                success: 61,
                            })
                            result.write(output)
                            output.writeMessageEnd()
                            const data: Buffer = writer.flush()

                            thrift
                                .appendThriftObject(
github creditkarma / thrift-server / packages / thrift-integration / src / client / connections / HttpConnection.spec.ts View on Github external
(
                        req: http.IncomingMessage,
                        res: http.ServerResponse,
                    ): void => {
                        if (count < 1) {
                            count += 1
                            const upgradeResponse: TTwitter.IUpgradeReply = {}
                            const writer: thrift.TTransport = new thrift.BufferedTransport()
                            const output: thrift.TProtocol = new thrift.BinaryProtocol(
                                writer,
                            )
                            output.writeMessageBegin(
                                'add',
                                thrift.MessageType.CALL,
                                1,
                            )
                            TTwitter.UpgradeReplyCodec.encode(
                                upgradeResponse,
                                output,
                            )
                            output.writeMessageEnd()
                            res.writeHead(200)
                            res.end(writer.flush())
                        } else {
                            const responseHeader: TTwitter.IResponseHeader = {}