These steps cover writing and running your application:
- From your terminal/console application, create and navigate to the chapter7/grpcjson directory.
- 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.
- Create a new directory named keyvalue and navigate to it.
- 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{ ...