O'Reilly logo

Go Web Development Cookbook by Arpit Aggarwal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it…

  1. Create hello.proto inside the proto directory and define a service interface with the name Say, which has two datatypes—Request and Response, as follows:
syntax = "proto3";service Say {  rpc Hello(Request) returns (Response) {}}message Request {  string name = 1;}message Response {  string msg = 1;}
  1. Compile hello.proto with the following command:
$ protoc --go_out=plugins=micro:. hello.proto

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required