Skip to content

Latest commit

 

History

History

helloworldgrpc

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

helloworldgrpc

This example illustrates how to expose helloworld as gRPC APIs.

Prerequisites

  • Protocol buffer compiler v3
  • Go plugins for the protocol compiler

See gRPC Go Quickstart for installation instructions.

Generate the code

$ go generate

Test the server

Run the server:

$ go run cmd/main.go
2021/07/04 18:18:00 server listening at [::]:8080

Consume by grpcurl:

$ grpcurl -plaintext -d '{"name": "Tracey"}' :8080 pb.Service/SayHello
{
  "message": "Hello Tracey"
}