たとえば次のような「user.proto」というプロトコル定義ファイルを用意し、これを変換する例を見てみよう。 syntax = "proto3"; message Picture { uint32 id = 1; uint32 width = 2; uint32 height = 3; enum PictureType { PNG = 0; JPEG = 1; GIF = 2; } PictureType type = 4; } message User { uint32 id = 1; string nickname = 2; string mail_address = 3; enum UserType { NORMAL = 0; ADMINISTRATOR = 1; GUEST = 2; DISABLED = 3; } UserType user_type = 4; repeated
![サービス間通信のための新技術「gRPC」入門 | さくらのナレッジ](https://cdn-ak-scissors.b.st-hatena.com/image/square/9be9263f29fd7824449750690aaea1f2183be1f2/height=288;version=1;width=512/https%3A%2F%2Fknowledge.sakura.ad.jp%2Fwp-content%2Fuploads%2F2020%2F04%2Fgrpc-1200x630.png)