https://github.com/wawandco/goechoservice
A sample Thrift service with Go.
https://github.com/wawandco/goechoservice
golang http thrift
Last synced: 11 days ago
JSON representation
A sample Thrift service with Go.
- Host: GitHub
- URL: https://github.com/wawandco/goechoservice
- Owner: wawandco
- License: mit
- Created: 2022-01-25T21:09:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-10T22:50:09.000Z (over 4 years ago)
- Last Synced: 2025-02-28T22:05:53.498Z (over 1 year ago)
- Topics: golang, http, thrift
- Language: Go
- Homepage: https://wawand.co
- Size: 17.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Echo Service (Thrift)
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.
## Running the service
Using this code requires Go 1.17+ and thrift 1.15 installed in the development machine.
### Generating Thrift code
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
```
### Running the service
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`.
## Service endpoints
The services responds to 4 endpoints, each of which is documented below.
#### `GET /thrift`
Responds with `polo` in plain text.
#### `POST /thrift`
Processes a Thrift request for the echo service in the binary protocol.
#### `GET /thrift/json`
Responds with `polo` in plain text.
#### `POST /thrift/json`
Processes a Thrift request for the echo service in the JSON protocol.