LoginSignup
0
0

GoLand で gRPCリクエストを発行するための設定

Last updated at Posted at 2024-05-03

GoLandのHTTP Clientは、gRPCのリクエストも発行することができる。ただし初期設定だと、google.protobuf.Timestamp や google.protobuf.FieldMask を含むリクエストを発行したとき、以下のようなエラーが発生してしまう。

com.intellij.grpc.requests.RejectedRPCException: An error occurred during protocol buffers file binary assembly. Details are logged

GoLandのHTTP Client が TimestampやFieldMaskを解釈できないのが原因。

GoLandのHTTP Clientに、google.protobuf.Timestamp の定義を教えてやれば、問題は解決する。

以下、具体的な手順。

  1. 以下のGitリポジトリをcloneする
  2. GolandのProtocol Buffersの設定のImport Pathsに以下を追加する(下図)
    • <root-dir>/protobuf/src

image.png

多分、GoLand以外のJetbrainのIDEでも同じ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0