|
| 1 | +defmodule Stream.HelloRequest do |
| 2 | + @moduledoc false |
| 3 | + |
| 4 | + use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 |
| 5 | + |
| 6 | + def descriptor do |
| 7 | + # credo:disable-for-next-line |
| 8 | + %Google.Protobuf.DescriptorProto{ |
| 9 | + name: "HelloRequest", |
| 10 | + field: [ |
| 11 | + %Google.Protobuf.FieldDescriptorProto{ |
| 12 | + name: "name", |
| 13 | + extendee: nil, |
| 14 | + number: 1, |
| 15 | + label: :LABEL_OPTIONAL, |
| 16 | + type: :TYPE_STRING, |
| 17 | + type_name: nil, |
| 18 | + default_value: nil, |
| 19 | + options: nil, |
| 20 | + oneof_index: nil, |
| 21 | + json_name: "name", |
| 22 | + proto3_optional: nil, |
| 23 | + __unknown_fields__: [] |
| 24 | + } |
| 25 | + ], |
| 26 | + nested_type: [], |
| 27 | + enum_type: [], |
| 28 | + extension_range: [], |
| 29 | + extension: [], |
| 30 | + options: nil, |
| 31 | + oneof_decl: [], |
| 32 | + reserved_range: [], |
| 33 | + reserved_name: [], |
| 34 | + __unknown_fields__: [] |
| 35 | + } |
| 36 | + end |
| 37 | + |
| 38 | + field(:name, 1, type: :string) |
| 39 | +end |
| 40 | + |
| 41 | +defmodule Stream.HelloReply do |
| 42 | + @moduledoc false |
| 43 | + |
| 44 | + use Protobuf, protoc_gen_elixir_version: "0.14.0", syntax: :proto3 |
| 45 | + |
| 46 | + def descriptor do |
| 47 | + # credo:disable-for-next-line |
| 48 | + %Google.Protobuf.DescriptorProto{ |
| 49 | + name: "HelloReply", |
| 50 | + field: [ |
| 51 | + %Google.Protobuf.FieldDescriptorProto{ |
| 52 | + name: "message", |
| 53 | + extendee: nil, |
| 54 | + number: 1, |
| 55 | + label: :LABEL_OPTIONAL, |
| 56 | + type: :TYPE_STRING, |
| 57 | + type_name: nil, |
| 58 | + default_value: nil, |
| 59 | + options: nil, |
| 60 | + oneof_index: nil, |
| 61 | + json_name: "message", |
| 62 | + proto3_optional: nil, |
| 63 | + __unknown_fields__: [] |
| 64 | + } |
| 65 | + ], |
| 66 | + nested_type: [], |
| 67 | + enum_type: [], |
| 68 | + extension_range: [], |
| 69 | + extension: [], |
| 70 | + options: nil, |
| 71 | + oneof_decl: [], |
| 72 | + reserved_range: [], |
| 73 | + reserved_name: [], |
| 74 | + __unknown_fields__: [] |
| 75 | + } |
| 76 | + end |
| 77 | + |
| 78 | + field(:message, 1, type: :string) |
| 79 | +end |
| 80 | + |
| 81 | +defmodule Stream.EchoServer.Service do |
| 82 | + @moduledoc false |
| 83 | + |
| 84 | + use GRPC.Service, name: "stream.EchoServer", protoc_gen_elixir_version: "0.14.0" |
| 85 | + |
| 86 | + def descriptor do |
| 87 | + # credo:disable-for-next-line |
| 88 | + %Google.Protobuf.ServiceDescriptorProto{ |
| 89 | + name: "EchoServer", |
| 90 | + method: [ |
| 91 | + %Google.Protobuf.MethodDescriptorProto{ |
| 92 | + name: "SayUnaryHello", |
| 93 | + input_type: ".stream.HelloRequest", |
| 94 | + output_type: ".stream.HelloReply", |
| 95 | + options: %Google.Protobuf.MethodOptions{ |
| 96 | + deprecated: false, |
| 97 | + idempotency_level: :IDEMPOTENCY_UNKNOWN, |
| 98 | + features: nil, |
| 99 | + uninterpreted_option: [], |
| 100 | + __pb_extensions__: %{}, |
| 101 | + __unknown_fields__: [] |
| 102 | + }, |
| 103 | + client_streaming: false, |
| 104 | + server_streaming: false, |
| 105 | + __unknown_fields__: [] |
| 106 | + }, |
| 107 | + %Google.Protobuf.MethodDescriptorProto{ |
| 108 | + name: "SayServerHello", |
| 109 | + input_type: ".stream.HelloRequest", |
| 110 | + output_type: ".stream.HelloReply", |
| 111 | + options: %Google.Protobuf.MethodOptions{ |
| 112 | + deprecated: false, |
| 113 | + idempotency_level: :IDEMPOTENCY_UNKNOWN, |
| 114 | + features: nil, |
| 115 | + uninterpreted_option: [], |
| 116 | + __pb_extensions__: %{}, |
| 117 | + __unknown_fields__: [] |
| 118 | + }, |
| 119 | + client_streaming: false, |
| 120 | + server_streaming: true, |
| 121 | + __unknown_fields__: [] |
| 122 | + }, |
| 123 | + %Google.Protobuf.MethodDescriptorProto{ |
| 124 | + name: "SayBidStreamHello", |
| 125 | + input_type: ".stream.HelloRequest", |
| 126 | + output_type: ".stream.HelloReply", |
| 127 | + options: %Google.Protobuf.MethodOptions{ |
| 128 | + deprecated: false, |
| 129 | + idempotency_level: :IDEMPOTENCY_UNKNOWN, |
| 130 | + features: nil, |
| 131 | + uninterpreted_option: [], |
| 132 | + __pb_extensions__: %{}, |
| 133 | + __unknown_fields__: [] |
| 134 | + }, |
| 135 | + client_streaming: true, |
| 136 | + server_streaming: true, |
| 137 | + __unknown_fields__: [] |
| 138 | + } |
| 139 | + ], |
| 140 | + options: nil, |
| 141 | + __unknown_fields__: [] |
| 142 | + } |
| 143 | + end |
| 144 | + |
| 145 | + rpc(:SayUnaryHello, Stream.HelloRequest, Stream.HelloReply) |
| 146 | + |
| 147 | + rpc(:SayServerHello, Stream.HelloRequest, stream(Stream.HelloReply)) |
| 148 | + |
| 149 | + rpc(:SayBidStreamHello, stream(Stream.HelloRequest), stream(Stream.HelloReply)) |
| 150 | +end |
| 151 | + |
| 152 | +defmodule Stream.EchoServer.Stub do |
| 153 | + @moduledoc false |
| 154 | + |
| 155 | + use GRPC.Stub, service: Stream.EchoServer.Service |
| 156 | +end |
0 commit comments