Done while following this guide Udemy course: https://www.udemy.com/grpc-golang/
Three different go packages. All have to do with learning gRPC and are independent from each other
- Demoes types of gRPC communication (check it's proto file)
- Uses SSL unlike the other two services
- Proper gRPC error handling examples
- Proper deadline examples
- Lessons learned from greet. Where greet was instructor lead, calculator was meant for students to figure out their own solution
- Not sure if it has proper eror/deadline examples. I might have implemented some.
- CRUD demonstration with a "blog" app.
- Instructor lead, but I deviated and used DynamoDB.
- If you are using my
docker-compose.yml
, there will be no need to worry about AWS credentials and region setup as I'm using a "dynamodb-local" image to provide the DynamoDB functionality. - Only of the three that uses DynamoDB
- Not sure if it has proper eror/deadline examples. I might have implemented some.
Requires:
- docker
- docker-compose
- Optional (if you want to mess around with files directly without docker-compose)
- GoLang 1.12+
- Properly set-up GoLang environment (GOROOT/GOHOME)
- make
docker-compose up
Skip this if you just want to explore with Evans
## GREET
# Grabbing the SSL cert. Needed for greet_client because that has an SSL example
docker cp grpc_greet_1:/code/ssl/server.crt ssl/server.crt
go run github.com/Kaurin/gRPC/greet/greet_client
## CALCULATOR
go run github.com/Kaurin/gRPC/calculator/calculator_client
### BLOG
go run github.com/Kaurin/gRPC/blog/blog_client
Unfortunately, Evans doesn't support a simple "go get -u" :(
# Install the "evans" utility. Check the Makefile for details
make evans
## GREET
# Grabbing the SSL cert. Needed for greet_client because that has an SSL example
docker cp grpc_greet_1:/code/ssl/server.crt ssl/server.crt
evans -p 50052 --tls --host localhost --cacert ssl/server.crt --reflection
## CALCULATOR
evans -p 50053 -r
## BLOG
evans -p 50051 -r
What you want in all three is to use call <functionName>
.
Evans has tab-compoletion, but if you want to see all functions in a given run, then use show rpc
.
Also, you can use ctrl+d
to end sending messages in examples that require it, or to just bail on input.
Don't forget to run:
docker-compose down
WARNING Please make sure to read the makefile before running the command
make cleanimages