This repository is a good starting point if one wants to learn about gRPC and how to develop APIs using it. Pre-requisites for this is some knowledge in Golang, Protobuf and APIs.
Steps to run the project:
- install "protoc" compiler and protobuf, grpc packages for golang sudo snap install protobuf --classic OR go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
go get -u google.golang.org/protobuf/cmd/protoc-gen-go go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc
-
prepare go vendors by running make vendor
-
build proto files present in proto directories by running make proto
this will generated go code for grpc and protobuf. It runs below command: protoc -I=<proto_files_src_dir> --go_out=<path_for_generated_files> --go_opt=paths=source_relative --go-grpc_out=<path_for_generated_grpc_files> --go-grpc_opt=paths=source_relative <list_of_proto_files>
- build client and server builds make client server this should create two builds(server and client) in build directory
