/poc-grpc-golang

POC of a gRPC project in Golang 🐿

Primary LanguageGo

gRPC (Google Remote Procedure Call) Golang

This code's has been inspired from from the grpc.io site.

POC of a gRPC project in Golang 🐿

Explanation comparing to a REST API

  • helloworld/helloworld.proto file is like a Controller class. It's where you will configure the endpoint (in gRPC, those are method names) and the DTO for request and response.

  • greeter_server/main.go file is like a Service class. It's where you will implement all the method business rules.

  • greeter_client/main.go file is an example of a programatic way to consume a gRPC method from the helloworld.proto and greeter_server/main.go files.

Run

Hello World

From the root directory:

Run the server:

go run greeter_server/main.go

From another terminal window, run the client:

go run greeter_client/main.go

Usage

Importing the helloworld/helloworld.proto file.

bloomRPC

Locally

Server

Client