elixir-grpc / grpc

An Elixir implementation of gRPC

Home Page:https://hex.pm/packages/grpc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Imports

arnaud-lb opened this issue · comments

This package doesn't seem to support files that have import statements. Is there a way to use such files currently ?

exprotobuf seems to support import statements when providing all the imported files explicitly, however I can't find a way to do that with grpc-elixir.

It's indeed an issue. I'm trying to support this recently. exprotobuf and gpb support import, but some work is still needed to integrate with gRPC.

Some thoughts about this feature: The current implement(mix task) and protoc-erl(what gpb implements) may be wrong. The right solution should be writing a plugin for the official protoc as here mentions(though the doc doesn't provide details about writing a plugin).

it's defined here:

A plugin is just a program which reads a CodeGeneratorRequest protocol buffer from standard input and then writes a CodeGeneratorResponse protocol buffer to standard output.

and the definition for those are given here:
https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.compiler.plugin.pb

I might take a stab at it when cycles free up

@alexander-alvarez Thank you. I already found it last month. btw, I'm trying to implement that by Elixir recently, but it will take some time 😀

@tony612 you doing it as a separate application?

@alexander-alvarez I'm trying to create a plugin for protoc to generate the Elixir code from the proto file.

exprotobuf is replaced by protobuf now. So import has been supported. Doc is coming :)