# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# README
Minimal Go GRPC Gateway Example
This project combines the following technologies in the simplest example possible:
- GoLang 1.21 with Go Modules
- GRPC Hello World example
- GRPC Gateway annotations added to the Hello World proto
- Make targets to simplify generating, building, and running the project
How to run the code
go build greeter_grpc_client/main.go
Build the GRPC clientgo build greeter_grpc_server/main.go
Build the GRPC servergo build greeter_http_client/main.go
Build the HTTP clientgo build greeter_http_server/main.go
Build the HTTP server- Run both servers:
make -j 2 server
- Run both clients:
make -j 2 client
- You can also hit the HTTP server via REST after starting it up:
GET: http://localhost:8081/v1/sayhello/Sean
GET: http://localhost:8081/v1/saygoodbye/Sean
How to make changes:
- Modify the
helloworld/helloworld.proto
Greeter service with your new RPCs - Make sure to annotate the rpc(s) correctly for GRPC Gateway support
- Run
make protoc
to generate the code for the GRPC and HTTP servers - Update
greeter_grpc_server/main.go
withfunc (s *server)...
to fulfill the updated Greeter service interface generated by protobuf compiler - Update
greeter_grpc_client/main.go
to call your new endpoint via GRPC - Update
greeter_http_client/main.go
to call your new endpoint via HTTP - Run both servers:
make -j 2 grpc-server http-server
- Run both clients:
make -j 2 grpc-client http-client
Resources:
- https://grpc.io/docs/languages/go/basics/
- https://kylewbanks.com/blog/running-multiple-make-targets-concurrently
- https://github.com/grpc-ecosystem/grpc-gateway
- https://github.com/grpc/grpc-go
- https://github.com/grpc/grpc-go/tree/master/examples/helloworld
https://www.harrisboats.com/build-and-price/boat-configurator.HSOL25.html 154875 after options + tax 450 = 4 hours 344 rentals @ 450 per rental with 4 hours per rental = 1376 hours of boat before losing money. about 16% of an entire year. 1376 hours