Defining an interface definition language file
The gRPC service that we are developing is going to support the following functionality:
- The server should return its date and time to the client
- The server should return a randomly generated password of a given length to the client
- The server should return random integers to the client
Before we begin developing the gRPC client and server for our service, we need to define the IDL file. We need a separate GitHub repository to host the files related to the IDL file, which is going to be https://github.com/mactsouk/protoapi.
Next, we are going to present the IDL file, which is called protoapi.proto
:
syntax = "proto3";
The presented file uses the proto3
version of the protocol buffers language—there is also an older version of the language named proto2
, which has some minor syntax differences. If you do not specify that you want to use proto3
, then the protocol buffer compiler...