Packages
A pure Elixir implementation of Google Protobuf.
Security advisory:
This version has known vulnerabilities.
View advisories
Current section
Files
Jump to
Current section
Files
priv/templates/service.ex.eex
defmodule <%= mod_name %>.Service do
@moduledoc false
use GRPC.Service, name: <%= inspect(name) %>
<%= if not is_nil(desc) do %>
def descriptor do
# credo:disable-for-next-line
<%= desc.__struct__ %>.decode(
<%= desc.__struct__.encode(desc |> Map.from_struct() |> Enum.filter(fn {_, x} -> x != nil end) |> desc.__struct__.new()) |> inspect(limit: :infinity) %>
)
end
<% end %>
<%= Enum.map methods, fn(method) -> %>
rpc <%= method %>
<% end %>
end
defmodule <%= mod_name %>.Stub do
@moduledoc false
use GRPC.Stub, service: <%= mod_name %>.Service
end