Skip to content

Commit 2cfad8a

Browse files
author
Adriano Santos
committed
Merge remote-tracking branch 'upstream/master'
2 parents 17f4e14 + 41cc421 commit 2cfad8a

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed
Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
defmodule Helloworld.HelloRequest do
22
@moduledoc false
3-
43
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
54

65
field :name, 1, type: :string
76
end
87

98
defmodule Helloworld.HelloRequestFrom do
109
@moduledoc false
11-
1210
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
1311

1412
field :name, 1, type: :string
@@ -17,9 +15,41 @@ end
1715

1816
defmodule Helloworld.HelloReply do
1917
@moduledoc false
20-
2118
use Protobuf, protoc_gen_elixir_version: "0.14.1", syntax: :proto3
2219

2320
field :message, 1, type: :string
2421
field :today, 2, type: Google.Protobuf.Timestamp
2522
end
23+
24+
defmodule Helloworld.Greeter.Service do
25+
@moduledoc false
26+
use GRPC.Service, name: "helloworld.Greeter", protoc_gen_elixir_version: "0.14.1"
27+
28+
rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply, %{
29+
http: %{
30+
type: Google.Api.PbExtension,
31+
value: %Google.Api.HttpRule{
32+
selector: "",
33+
body: "",
34+
additional_bindings: [],
35+
response_body: "",
36+
pattern: {:get, "/v1/greeter/{name}"},
37+
__unknown_fields__: []
38+
}
39+
}
40+
})
41+
42+
rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply, %{
43+
http: %{
44+
type: Google.Api.PbExtension,
45+
value: %Google.Api.HttpRule{
46+
selector: "",
47+
body: "*",
48+
additional_bindings: [],
49+
response_body: "",
50+
pattern: {:post, "/v1/greeter"},
51+
__unknown_fields__: []
52+
}
53+
}
54+
})
55+
end

examples/helloworld_transcoding/mix.exs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ defmodule Helloworld.Mixfile do
2121
{:grpc, path: "../../"},
2222
{:protobuf, "~> 0.14"},
2323
{:jason, "~> 1.3.0"},
24-
{:google_protos, "~> 0.3.0"}
24+
{:google_protos, "~> 0.3.0"},
25+
{:protobuf_generate, "~> 0.1", only: [:dev, :test]}
2526
]
2627
end
2728
end

examples/helloworld_transcoding/mix.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
88
"mint": {:hex, :mint, "1.7.1", "113fdb2b2f3b59e47c7955971854641c61f378549d73e829e1768de90fc1abf1", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0 or ~> 1.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "fceba0a4d0f24301ddee3024ae116df1c3f4bb7a563a731f45fdfeb9d39a231b"},
99
"protobuf": {:hex, :protobuf, "0.14.1", "9ac0582170df27669ccb2ef6cb0a3d55020d58896edbba330f20d0748881530a", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "39a9d49d346e3ed597e5ae3168a43d9603870fc159419617f584cdf6071f0e25"},
10+
"protobuf_generate": {:hex, :protobuf_generate, "0.1.1", "f6098b85161dcfd48a4f6f1abee4ee5e057981dfc50aafb1aa4bd5b0529aa89b", [:mix], [{:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "93a38c8e2aba2a17e293e9ef1359122741f717103984aa6d1ebdca0efb17ab9d"},
1011
"ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"},
1112
"telemetry": {:hex, :telemetry, "1.3.0", "fedebbae410d715cf8e7062c96a1ef32ec22e764197f70cda73d82778d61e7a2", [:rebar3], [], "hexpm", "7015fc8919dbe63764f4b4b87a95b7c0996bd539e0d499be6ec9d7f3875b79e6"},
1213
}

0 commit comments

Comments
 (0)