This project implements both an HTTP server and a gRPC server to fetch crypto prices. This is an example of how to strucutre a go service by separating concerns and implementing fully functional servers and clients with a very low number of external dependencies.
To run it locally, run make run
.
To generate proto files, run make proto
.
The HTTP server will listen on port 8080
by default.
The gRPC server will listen on port 8000
by default.
The ticker (BTC, ETH...) will be extracted from the query params on the /price
route (GET).
logging.go
: middleware used for loggingmetrics.go
: middleware used for metricsservice.go
: where the mocked price fetching service is definedjson_api.go
: where the json api server is definedgrpc_server.go
: where the grpc server is defined/types
: where all the shared types are defined/client
: where the clients (http and grpc) are defined/proto
: where the proto file and go generated grpc files are
[x] Use 3rd party service to fetch real crypto prices
[ ] Dockerize service