Build simple gRPC server with Go
- 1 minPurpose
Provide a sample example code for GRPC Web Services in Golang.
Installation
Please refer to Makefile and Dockerfile for install and build instructions.
cd grpc-example/helloworld_buf_gw
make build
make build-container
Project Building
We shall do these projects in steps. Please follow accordingly
-
helloworld_proto
Basic HelloWorld App with protobuf
-
helloworld_buf
Basic HelloWorld App with buf (instead of using protobuf)
-
helloworld_buf_api
Basic HelloWorld App with buf + GRPC-Web
-
helloworld_buf_gw
Basic HelloWorld App with buf + GRPC-Web + Gateway
-
helloworld_buf_ts
Basic helloworld App with buf + GRPC-Web + Gateway + TypeScript
Topic Details
Please refer to below “Web Resources” for a deeper understanding of this project.
Testing
- Run Server
cd helloworld_buf_gw make run OR make test-container
Next Steps
-
Follow the below links for source code and dockerfile
I hope that these references will make getting started extremely easy.
Enjoy!
Web Resources:
- GRPC QuickStart
- GRPC Tutorial
- Generating Stubs
- grpc api configuration
- customizing openapi output
- grpc-gateway
- generating_stubs
- grpc api configuration
- customizing openapi output
DISCLAIMER: All views expressed on this site are my own and do not represent the opinions of any entity whatsoever with which I have been, am now, or will be affiliated. Any collateral used is referenced in the Web Resources or others sections on this page. The information provided on this website does not constitute investment advice, financial advice, or trading advice.