How to do it...

These steps cover writing and running your application:

  1. From your terminal/console application, create and navigate to the chapter7/grpcjson directory.
  1. Copy tests from https://github.com/agtorre/go-cookbook/tree/master/chapter7/grpcjson or use this as an exercise to write some of your own code.
  2. Create a new directory named keyvalue and navigate to it.
  3. Create a file called keyvalue.proto with the following contents:
        syntax = "proto3";        package keyvalue;        service KeyValue{            rpc Set(SetKeyValueRequest) returns (KeyValueResponse){}            rpc Get(GetKeyValueRequest) returns (KeyValueResponse){}        }        message SetKeyValueRequest {            string key = 1;            string value = 2;        }        message GetKeyValueRequest{            string key = 1;        } message KeyValueResponse{ ...

Get Go Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.