This is a simple POC for an echo service using Thrift. The goal is to validate the implementation of a thrift Go service mounted within an HTTP server.
Using this code requires Go 1.17+ and thrift 1.15 installed in the development machine.
Before attempting to run the code you will need to generate the thrift layers by running the following command within the project root folder:
thrift --gen go echoservice.thrift
Once those have been generated you can run the service locally with
go run ./cmd/service
That will start the service on the port 9090
.
The services responds to 4 endpoints, each of which is documented below.
Responds with polo
in plain text.
Processes a Thrift request for the echo service in the binary protocol.
Responds with polo
in plain text.
Processes a Thrift request for the echo service in the JSON protocol.