From b2a5edd157cdf4af934dcc59288a2c8161f16cd1 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 14 Feb 2024 17:29:21 -0300 Subject: [PATCH 01/48] Update protos and some internals structures --- compile-pb.sh | 2 + lib/actors/config/persistent_term_config.ex | 11 + lib/spawn/actors/actor.pb.ex | 1195 +++++----- lib/spawn/actors/protocol.pb.ex | 1949 ++++++++--------- lib/spawn/actors/state.pb.ex | 87 +- lib/spawn/google/protobuf/any.pb.ex | 52 +- .../grpc/reflection/v1alpha/reflection.pb.ex | 578 +++++ .../functions/protocol/actors/actor.proto | 2 + .../grpc/reflection/v1alpha/reflection.proto | 136 ++ priv/templates/grpc_endpoint.ex.eex | 16 + priv/templates/grpc_service.ex.eex | 30 + .../proxy/lib/proxy/grpc/code_generator.ex | 157 ++ spawn_proxy/proxy/lib/proxy/grpc/parser.ex | 95 + .../proxy/lib/proxy/grpc/proto_util.ex | 82 + .../proxy/lib/proxy/grpc/reflection.ex | 214 ++ .../lib/proxy/grpc/reflection/service.ex | 45 + .../proxy/lib/proxy/grpc/supervisor.ex | 27 + spawn_proxy/proxy/lib/proxy/supervisor.ex | 2 +- spawn_proxy/proxy/mix.exs | 1 + 19 files changed, 3022 insertions(+), 1659 deletions(-) create mode 100644 lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex create mode 100644 priv/protos/grpc/reflection/v1alpha/reflection.proto create mode 100644 priv/templates/grpc_endpoint.ex.eex create mode 100644 priv/templates/grpc_service.ex.eex create mode 100644 spawn_proxy/proxy/lib/proxy/grpc/code_generator.ex create mode 100644 spawn_proxy/proxy/lib/proxy/grpc/parser.ex create mode 100644 spawn_proxy/proxy/lib/proxy/grpc/proto_util.ex create mode 100644 spawn_proxy/proxy/lib/proxy/grpc/reflection.ex create mode 100644 spawn_proxy/proxy/lib/proxy/grpc/reflection/service.ex create mode 100644 spawn_proxy/proxy/lib/proxy/grpc/supervisor.ex diff --git a/compile-pb.sh b/compile-pb.sh index de0cf0a4..890fcd28 100755 --- a/compile-pb.sh +++ b/compile-pb.sh @@ -4,6 +4,8 @@ set -o nounset set -o errexit set -o pipefail +protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib/spawn/grpc --proto_path=priv/protos/grpc/ priv/protos/grpc/reflection/v1alpha/reflection.proto + protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/any.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/actor.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/protocol.proto diff --git a/lib/actors/config/persistent_term_config.ex b/lib/actors/config/persistent_term_config.ex index faf9bbc3..260dc0e4 100644 --- a/lib/actors/config/persistent_term_config.ex +++ b/lib/actors/config/persistent_term_config.ex @@ -26,6 +26,7 @@ if Code.ensure_loaded?(:persistent_term) do {:delayed_invokes, "true"}, {:deployment_mode, "sidecar"}, {:http_port, "9001"}, + {:http_num_acceptors, "150"} {:internal_nats_hosts, "nats://127.0.0.1:4222"}, {:internal_nats_tls, "false"}, {:internal_nats_auth, "false"}, @@ -221,6 +222,16 @@ if Code.ensure_loaded?(:persistent_term) do value end + defp load_env({:http_num_acceptors, default}) do + value = + env("PROXY_HTTP_NUM_ACCEPTORS", default) + |> String.to_integer() + + :persistent_term.put({__MODULE__, :http_num_acceptors}, value) + + value + end + defp load_env({:internal_nats_hosts, default}) do value = env("SPAWN_INTERNAL_NATS_HOSTS", default) :persistent_term.put({__MODULE__, :internal_nats_hosts}, value) diff --git a/lib/spawn/actors/actor.pb.ex b/lib/spawn/actors/actor.pb.ex index 7075d8fc..0ba90118 100644 --- a/lib/spawn/actors/actor.pb.ex +++ b/lib/spawn/actors/actor.pb.ex @@ -1,1202 +1,1195 @@ defmodule Eigr.Functions.Protocol.Actors.Kind do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.EnumDescriptorProto{ + __unknown_fields__: [], name: "Kind", + options: nil, + reserved_name: [], + reserved_range: [], value: [ %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "UNKNOW_KIND", number: 0, - options: nil, - __unknown_fields__: [] + options: nil }, %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "NAMED", number: 1, - options: nil, - __unknown_fields__: [] + options: nil }, %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "UNNAMED", number: 2, - options: nil, - __unknown_fields__: [] + options: nil }, %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "POOLED", number: 3, - options: nil, - __unknown_fields__: [] + options: nil }, %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "PROXY", number: 4, - options: nil, - __unknown_fields__: [] + options: nil } - ], - options: nil, - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] + ] } end - field(:UNKNOW_KIND, 0) - field(:NAMED, 1) - field(:UNNAMED, 2) - field(:POOLED, 3) - field(:PROXY, 4) + field :UNKNOW_KIND, 0 + field :NAMED, 1 + field :UNNAMED, 2 + field :POOLED, 3 + field :PROXY, 4 end - defmodule Eigr.Functions.Protocol.Actors.Registry.ActorsEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorsEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor", - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor" } ], + name: "ActorsEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:key, 1, type: :string) - field(:value, 2, type: Eigr.Functions.Protocol.Actors.Actor) + field :key, 1, type: :string + field :value, 2, type: Eigr.Functions.Protocol.Actors.Actor end - defmodule Eigr.Functions.Protocol.Actors.Registry do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Registry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "actors", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "actors", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Registry.ActorsEntry", - default_value: nil, - options: nil, + name: "actors", + number: 1, oneof_index: nil, - json_name: "actors", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Registry.ActorsEntry" } ], + name: "Registry", nested_type: [ %Google.Protobuf.DescriptorProto{ - name: "ActorsEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor", - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor" } ], + name: "ActorsEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } ], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:actors, 1, + field :actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.Registry.ActorsEntry, map: true - ) end - defmodule Eigr.Functions.Protocol.Actors.ActorSystem do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorSystem", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "name", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "name", + number: 1, oneof_index: nil, - json_name: "name", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "registry", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "registry", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Registry", - default_value: nil, - options: nil, + name: "registry", + number: 2, oneof_index: nil, - json_name: "registry", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Registry" } ], + name: "ActorSystem", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:name, 1, type: :string) - field(:registry, 2, type: Eigr.Functions.Protocol.Actors.Registry) + field :name, 1, type: :string + field :registry, 2, type: Eigr.Functions.Protocol.Actors.Registry end - defmodule Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorSnapshotStrategy", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "timeout", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "timeout", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.TimeoutStrategy", - default_value: nil, - options: nil, + name: "timeout", + number: 1, oneof_index: 0, - json_name: "timeout", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.TimeoutStrategy" } ], + name: "ActorSnapshotStrategy", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], name: "strategy", - options: nil, - __unknown_fields__: [] + options: nil } ], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - oneof(:strategy, 0) + oneof :strategy, 0 - field(:timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0) + field :timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0 end - defmodule Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorDeactivationStrategy", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "timeout", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "timeout", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.TimeoutStrategy", - default_value: nil, - options: nil, + name: "timeout", + number: 1, oneof_index: 0, - json_name: "timeout", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.TimeoutStrategy" } ], + name: "ActorDeactivationStrategy", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], name: "strategy", - options: nil, - __unknown_fields__: [] + options: nil } ], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - oneof(:strategy, 0) + oneof :strategy, 0 - field(:timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0) + field :timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0 end - defmodule Eigr.Functions.Protocol.Actors.TimeoutStrategy do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "TimeoutStrategy", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "timeout", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "timeout", label: :LABEL_OPTIONAL, - type: :TYPE_INT64, - type_name: nil, - default_value: nil, - options: nil, + name: "timeout", + number: 1, oneof_index: nil, - json_name: "timeout", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT64, + type_name: nil } ], + name: "TimeoutStrategy", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:timeout, 1, type: :int64) + field :timeout, 1, type: :int64 end - defmodule Eigr.Functions.Protocol.Actors.Action do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Action", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "name", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "name", + number: 1, oneof_index: nil, - json_name: "name", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "Action", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:name, 1, type: :string) + field :name, 1, type: :string end - defmodule Eigr.Functions.Protocol.Actors.FixedTimerAction do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "FixedTimerAction", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "seconds", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "seconds", label: :LABEL_OPTIONAL, - type: :TYPE_INT32, - type_name: nil, - default_value: nil, - options: nil, + name: "seconds", + number: 1, oneof_index: nil, - json_name: "seconds", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT32, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "action", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "action", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Action", - default_value: nil, - options: nil, + name: "action", + number: 2, oneof_index: nil, - json_name: "action", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Action" } ], + name: "FixedTimerAction", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:seconds, 1, type: :int32) - field(:action, 2, type: Eigr.Functions.Protocol.Actors.Action) + field :seconds, 1, type: :int32 + field :action, 2, type: Eigr.Functions.Protocol.Actors.Action end - defmodule Eigr.Functions.Protocol.Actors.ActorState.TagsEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "TagsEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "TagsEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:key, 1, type: :string) - field(:value, 2, type: :string) + field :key, 1, type: :string + field :value, 2, type: :string end - defmodule Eigr.Functions.Protocol.Actors.ActorState do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorState", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "tags", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "tags", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState.TagsEntry", - default_value: nil, - options: nil, + name: "tags", + number: 1, oneof_index: nil, - json_name: "tags", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState.TagsEntry" }, %Google.Protobuf.FieldDescriptorProto{ - name: "state", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "state", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any", - default_value: nil, - options: nil, + name: "state", + number: 2, oneof_index: nil, - json_name: "state", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" } ], + name: "ActorState", nested_type: [ %Google.Protobuf.DescriptorProto{ - name: "TagsEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "TagsEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } ], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:tags, 1, + field :tags, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorState.TagsEntry, map: true - ) - field(:state, 2, type: Google.Protobuf.Any) + field :state, 2, type: Google.Protobuf.Any end - defmodule Eigr.Functions.Protocol.Actors.Metadata.TagsEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "TagsEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "TagsEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:key, 1, type: :string) - field(:value, 2, type: :string) + field :key, 1, type: :string + field :value, 2, type: :string end - defmodule Eigr.Functions.Protocol.Actors.Metadata do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Metadata", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "channel_group", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "channelGroup", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Channel", - default_value: nil, - options: nil, + name: "channel_group", + number: 1, oneof_index: nil, - json_name: "channelGroup", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Channel" }, %Google.Protobuf.FieldDescriptorProto{ - name: "tags", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "tags", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Metadata.TagsEntry", - default_value: nil, - options: nil, + name: "tags", + number: 2, oneof_index: nil, - json_name: "tags", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Metadata.TagsEntry" } ], + name: "Metadata", nested_type: [ %Google.Protobuf.DescriptorProto{ - name: "TagsEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "TagsEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } ], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:channel_group, 1, + field :channel_group, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.Channel, json_name: "channelGroup" - ) - field(:tags, 2, + field :tags, 2, repeated: true, type: Eigr.Functions.Protocol.Actors.Metadata.TagsEntry, map: true - ) end - defmodule Eigr.Functions.Protocol.Actors.Channel do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Channel", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "topic", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "topic", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "topic", + number: 1, oneof_index: nil, - json_name: "topic", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "action", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "action", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "action", + number: 2, oneof_index: nil, - json_name: "action", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "Channel", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:topic, 1, type: :string) - field(:action, 2, type: :string) + field :topic, 1, type: :string + field :action, 2, type: :string end - defmodule Eigr.Functions.Protocol.Actors.ActorSettings do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorSettings", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "kind", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "kind", label: :LABEL_OPTIONAL, - type: :TYPE_ENUM, - type_name: ".eigr.functions.protocol.actors.Kind", - default_value: nil, - options: nil, + name: "kind", + number: 1, oneof_index: nil, - json_name: "kind", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_ENUM, + type_name: ".eigr.functions.protocol.actors.Kind" }, %Google.Protobuf.FieldDescriptorProto{ - name: "stateful", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "stateful", label: :LABEL_OPTIONAL, - type: :TYPE_BOOL, - type_name: nil, - default_value: nil, - options: nil, + name: "stateful", + number: 2, oneof_index: nil, - json_name: "stateful", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_BOOL, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "snapshot_strategy", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "snapshotStrategy", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSnapshotStrategy", - default_value: nil, - options: nil, + name: "snapshot_strategy", + number: 3, oneof_index: nil, - json_name: "snapshotStrategy", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSnapshotStrategy" }, %Google.Protobuf.FieldDescriptorProto{ - name: "deactivation_strategy", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "deactivationStrategy", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorDeactivationStrategy", - default_value: nil, - options: nil, + name: "deactivation_strategy", + number: 4, oneof_index: nil, - json_name: "deactivationStrategy", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorDeactivationStrategy" }, %Google.Protobuf.FieldDescriptorProto{ - name: "min_pool_size", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 5, + json_name: "minPoolSize", label: :LABEL_OPTIONAL, - type: :TYPE_INT32, - type_name: nil, - default_value: nil, - options: nil, + name: "min_pool_size", + number: 5, oneof_index: nil, - json_name: "minPoolSize", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT32, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "max_pool_size", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 6, + json_name: "maxPoolSize", label: :LABEL_OPTIONAL, - type: :TYPE_INT32, - type_name: nil, - default_value: nil, - options: nil, + name: "max_pool_size", + number: 6, oneof_index: nil, - json_name: "maxPoolSize", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT32, + type_name: nil } ], + name: "ActorSettings", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:kind, 1, type: Eigr.Functions.Protocol.Actors.Kind, enum: true) - field(:stateful, 2, type: :bool) + field :kind, 1, type: Eigr.Functions.Protocol.Actors.Kind, enum: true + field :stateful, 2, type: :bool - field(:snapshot_strategy, 3, + field :snapshot_strategy, 3, type: Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy, json_name: "snapshotStrategy" - ) - field(:deactivation_strategy, 4, + field :deactivation_strategy, 4, type: Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy, json_name: "deactivationStrategy" - ) - field(:min_pool_size, 5, type: :int32, json_name: "minPoolSize") - field(:max_pool_size, 6, type: :int32, json_name: "maxPoolSize") + field :min_pool_size, 5, type: :int32, json_name: "minPoolSize" + field :max_pool_size, 6, type: :int32, json_name: "maxPoolSize" end - defmodule Eigr.Functions.Protocol.Actors.ActorId do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorId", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "name", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "name", + number: 1, oneof_index: nil, - json_name: "name", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "system", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "system", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "system", + number: 2, oneof_index: nil, - json_name: "system", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "parent", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "parent", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "parent", + number: 3, oneof_index: nil, - json_name: "parent", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "ActorId", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:name, 1, type: :string) - field(:system, 2, type: :string) - field(:parent, 3, type: :string) + field :name, 1, type: :string + field :system, 2, type: :string + field :parent, 3, type: :string end - defmodule Eigr.Functions.Protocol.Actors.Actor do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Actor", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "id", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "id", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId", - default_value: nil, - options: nil, + name: "id", + number: 1, oneof_index: nil, - json_name: "id", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" }, %Google.Protobuf.FieldDescriptorProto{ - name: "state", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "state", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState", - default_value: nil, - options: nil, + name: "state", + number: 2, oneof_index: nil, - json_name: "state", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState" }, %Google.Protobuf.FieldDescriptorProto{ - name: "metadata", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 6, + json_name: "metadata", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Metadata", - default_value: nil, - options: nil, + name: "metadata", + number: 6, oneof_index: nil, - json_name: "metadata", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Metadata" }, %Google.Protobuf.FieldDescriptorProto{ - name: "settings", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "settings", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSettings", - default_value: nil, - options: nil, + name: "settings", + number: 3, oneof_index: nil, - json_name: "settings", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSettings" }, %Google.Protobuf.FieldDescriptorProto{ - name: "actions", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "actions", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Action", - default_value: nil, - options: nil, + name: "actions", + number: 4, oneof_index: nil, - json_name: "actions", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Action" }, %Google.Protobuf.FieldDescriptorProto{ - name: "timer_actions", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 5, + json_name: "timerActions", label: :LABEL_REPEATED, + name: "timer_actions", + number: 5, + oneof_index: nil, + options: nil, + proto3_optional: nil, type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.FixedTimerAction", + type_name: ".eigr.functions.protocol.actors.FixedTimerAction" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], default_value: nil, - options: nil, + extendee: nil, + json_name: "serviceName", + label: :LABEL_OPTIONAL, + name: "service_name", + number: 7, oneof_index: nil, - json_name: "timerActions", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "Actor", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:id, 1, type: Eigr.Functions.Protocol.Actors.ActorId) - field(:state, 2, type: Eigr.Functions.Protocol.Actors.ActorState) - field(:metadata, 6, type: Eigr.Functions.Protocol.Actors.Metadata) - field(:settings, 3, type: Eigr.Functions.Protocol.Actors.ActorSettings) - field(:actions, 4, repeated: true, type: Eigr.Functions.Protocol.Actors.Action) + field :id, 1, type: Eigr.Functions.Protocol.Actors.ActorId + field :state, 2, type: Eigr.Functions.Protocol.Actors.ActorState + field :metadata, 6, type: Eigr.Functions.Protocol.Actors.Metadata + field :settings, 3, type: Eigr.Functions.Protocol.Actors.ActorSettings + field :actions, 4, repeated: true, type: Eigr.Functions.Protocol.Actors.Action - field(:timer_actions, 5, + field :timer_actions, 5, repeated: true, type: Eigr.Functions.Protocol.Actors.FixedTimerAction, json_name: "timerActions" - ) + + field :service_name, 7, type: :string, json_name: "serviceName" end diff --git a/lib/spawn/actors/protocol.pb.ex b/lib/spawn/actors/protocol.pb.ex index 9ce95842..6348af8b 100644 --- a/lib/spawn/actors/protocol.pb.ex +++ b/lib/spawn/actors/protocol.pb.ex @@ -1,1892 +1,1867 @@ defmodule Eigr.Functions.Protocol.Status do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.EnumDescriptorProto{ + __unknown_fields__: [], name: "Status", + options: nil, + reserved_name: [], + reserved_range: [], value: [ %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "UNKNOWN", number: 0, - options: nil, - __unknown_fields__: [] + options: nil }, %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "OK", number: 1, - options: nil, - __unknown_fields__: [] + options: nil }, %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "ACTOR_NOT_FOUND", number: 2, - options: nil, - __unknown_fields__: [] + options: nil }, %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], name: "ERROR", number: 3, - options: nil, - __unknown_fields__: [] + options: nil } - ], - options: nil, - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] + ] } end - field(:UNKNOWN, 0) - field(:OK, 1) - field(:ACTOR_NOT_FOUND, 2) - field(:ERROR, 3) + field :UNKNOWN, 0 + field :OK, 1 + field :ACTOR_NOT_FOUND, 2 + field :ERROR, 3 end - defmodule Eigr.Functions.Protocol.Context.MetadataEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "MetadataEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "MetadataEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:key, 1, type: :string) - field(:value, 2, type: :string) + field :key, 1, type: :string + field :value, 2, type: :string end - defmodule Eigr.Functions.Protocol.Context.TagsEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "TagsEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "TagsEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:key, 1, type: :string) - field(:value, 2, type: :string) + field :key, 1, type: :string + field :value, 2, type: :string end - defmodule Eigr.Functions.Protocol.Context do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Context", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "state", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "state", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any", - default_value: nil, - options: nil, + name: "state", + number: 1, oneof_index: nil, - json_name: "state", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" }, %Google.Protobuf.FieldDescriptorProto{ - name: "metadata", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "metadata", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context.MetadataEntry", - default_value: nil, - options: nil, + name: "metadata", + number: 4, oneof_index: nil, - json_name: "metadata", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context.MetadataEntry" }, %Google.Protobuf.FieldDescriptorProto{ - name: "tags", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 5, + json_name: "tags", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context.TagsEntry", - default_value: nil, - options: nil, + name: "tags", + number: 5, oneof_index: nil, - json_name: "tags", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context.TagsEntry" }, %Google.Protobuf.FieldDescriptorProto{ - name: "caller", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "caller", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId", - default_value: nil, - options: nil, + name: "caller", + number: 2, oneof_index: nil, - json_name: "caller", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" }, %Google.Protobuf.FieldDescriptorProto{ - name: "self", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "self", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId", - default_value: nil, - options: nil, + name: "self", + number: 3, oneof_index: nil, - json_name: "self", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" } ], + name: "Context", nested_type: [ %Google.Protobuf.DescriptorProto{ - name: "MetadataEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "MetadataEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] }, %Google.Protobuf.DescriptorProto{ - name: "TagsEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "TagsEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } ], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:state, 1, type: Google.Protobuf.Any) + field :state, 1, type: Google.Protobuf.Any - field(:metadata, 4, + field :metadata, 4, repeated: true, type: Eigr.Functions.Protocol.Context.MetadataEntry, map: true - ) - field(:tags, 5, repeated: true, type: Eigr.Functions.Protocol.Context.TagsEntry, map: true) - field(:caller, 2, type: Eigr.Functions.Protocol.Actors.ActorId) - field(:self, 3, type: Eigr.Functions.Protocol.Actors.ActorId) + field :tags, 5, repeated: true, type: Eigr.Functions.Protocol.Context.TagsEntry, map: true + field :caller, 2, type: Eigr.Functions.Protocol.Actors.ActorId + field :self, 3, type: Eigr.Functions.Protocol.Actors.ActorId end - defmodule Eigr.Functions.Protocol.Noop do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Noop", - field: [], - nested_type: [], + __unknown_fields__: [], enum_type: [], - extension_range: [], extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] + extension_range: [], + field: [], + name: "Noop", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] } end end - defmodule Eigr.Functions.Protocol.JSONType do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "JSONType", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "content", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "content", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "content", + number: 1, oneof_index: nil, - json_name: "content", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "JSONType", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:content, 1, type: :string) + field :content, 1, type: :string end - defmodule Eigr.Functions.Protocol.RegistrationRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "RegistrationRequest", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "service_info", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "serviceInfo", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.ServiceInfo", - default_value: nil, - options: nil, + name: "service_info", + number: 1, oneof_index: nil, - json_name: "serviceInfo", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.ServiceInfo" }, %Google.Protobuf.FieldDescriptorProto{ - name: "actor_system", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "actorSystem", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem", - default_value: nil, - options: nil, + name: "actor_system", + number: 2, oneof_index: nil, - json_name: "actorSystem", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem" } ], + name: "RegistrationRequest", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:service_info, 1, type: Eigr.Functions.Protocol.ServiceInfo, json_name: "serviceInfo") + field :service_info, 1, type: Eigr.Functions.Protocol.ServiceInfo, json_name: "serviceInfo" - field(:actor_system, 2, + field :actor_system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem, json_name: "actorSystem" - ) end - defmodule Eigr.Functions.Protocol.RegistrationResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "RegistrationResponse", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "status", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "status", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus", - default_value: nil, - options: nil, + name: "status", + number: 1, oneof_index: nil, - json_name: "status", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus" }, %Google.Protobuf.FieldDescriptorProto{ - name: "proxy_info", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "proxyInfo", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.ProxyInfo", - default_value: nil, - options: nil, + name: "proxy_info", + number: 2, oneof_index: nil, - json_name: "proxyInfo", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.ProxyInfo" } ], + name: "RegistrationResponse", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) - field(:proxy_info, 2, type: Eigr.Functions.Protocol.ProxyInfo, json_name: "proxyInfo") + field :status, 1, type: Eigr.Functions.Protocol.RequestStatus + field :proxy_info, 2, type: Eigr.Functions.Protocol.ProxyInfo, json_name: "proxyInfo" end - defmodule Eigr.Functions.Protocol.ServiceInfo do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ServiceInfo", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "service_name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "serviceName", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "service_name", + number: 1, oneof_index: nil, - json_name: "serviceName", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "service_version", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "serviceVersion", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "service_version", + number: 2, oneof_index: nil, - json_name: "serviceVersion", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "service_runtime", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "serviceRuntime", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "service_runtime", + number: 3, oneof_index: nil, - json_name: "serviceRuntime", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "support_library_name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "supportLibraryName", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "support_library_name", + number: 4, oneof_index: nil, - json_name: "supportLibraryName", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "support_library_version", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 5, + json_name: "supportLibraryVersion", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "support_library_version", + number: 5, oneof_index: nil, - json_name: "supportLibraryVersion", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "protocol_major_version", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 6, + json_name: "protocolMajorVersion", label: :LABEL_OPTIONAL, - type: :TYPE_INT32, - type_name: nil, - default_value: nil, - options: nil, + name: "protocol_major_version", + number: 6, oneof_index: nil, - json_name: "protocolMajorVersion", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT32, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "protocol_minor_version", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 7, + json_name: "protocolMinorVersion", label: :LABEL_OPTIONAL, - type: :TYPE_INT32, - type_name: nil, - default_value: nil, - options: nil, + name: "protocol_minor_version", + number: 7, oneof_index: nil, - json_name: "protocolMinorVersion", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT32, + type_name: nil } ], + name: "ServiceInfo", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:service_name, 1, type: :string, json_name: "serviceName") - field(:service_version, 2, type: :string, json_name: "serviceVersion") - field(:service_runtime, 3, type: :string, json_name: "serviceRuntime") - field(:support_library_name, 4, type: :string, json_name: "supportLibraryName") - field(:support_library_version, 5, type: :string, json_name: "supportLibraryVersion") - field(:protocol_major_version, 6, type: :int32, json_name: "protocolMajorVersion") - field(:protocol_minor_version, 7, type: :int32, json_name: "protocolMinorVersion") + field :service_name, 1, type: :string, json_name: "serviceName" + field :service_version, 2, type: :string, json_name: "serviceVersion" + field :service_runtime, 3, type: :string, json_name: "serviceRuntime" + field :support_library_name, 4, type: :string, json_name: "supportLibraryName" + field :support_library_version, 5, type: :string, json_name: "supportLibraryVersion" + field :protocol_major_version, 6, type: :int32, json_name: "protocolMajorVersion" + field :protocol_minor_version, 7, type: :int32, json_name: "protocolMinorVersion" end - defmodule Eigr.Functions.Protocol.SpawnRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "SpawnRequest", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "actors", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "actors", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId", - default_value: nil, - options: nil, + name: "actors", + number: 1, oneof_index: nil, - json_name: "actors", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" } ], + name: "SpawnRequest", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorId) + field :actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorId end - defmodule Eigr.Functions.Protocol.SpawnResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "SpawnResponse", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "status", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "status", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus", - default_value: nil, - options: nil, + name: "status", + number: 1, oneof_index: nil, - json_name: "status", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus" } ], + name: "SpawnResponse", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) + field :status, 1, type: Eigr.Functions.Protocol.RequestStatus end - defmodule Eigr.Functions.Protocol.ProxyInfo do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ProxyInfo", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "protocol_major_version", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "protocolMajorVersion", label: :LABEL_OPTIONAL, - type: :TYPE_INT32, - type_name: nil, - default_value: nil, - options: nil, + name: "protocol_major_version", + number: 1, oneof_index: nil, - json_name: "protocolMajorVersion", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT32, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "protocol_minor_version", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "protocolMinorVersion", label: :LABEL_OPTIONAL, - type: :TYPE_INT32, - type_name: nil, - default_value: nil, - options: nil, + name: "protocol_minor_version", + number: 2, oneof_index: nil, - json_name: "protocolMinorVersion", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT32, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "proxy_name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "proxyName", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "proxy_name", + number: 3, oneof_index: nil, - json_name: "proxyName", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "proxy_version", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "proxyVersion", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "proxy_version", + number: 4, oneof_index: nil, - json_name: "proxyVersion", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "ProxyInfo", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:protocol_major_version, 1, type: :int32, json_name: "protocolMajorVersion") - field(:protocol_minor_version, 2, type: :int32, json_name: "protocolMinorVersion") - field(:proxy_name, 3, type: :string, json_name: "proxyName") - field(:proxy_version, 4, type: :string, json_name: "proxyVersion") + field :protocol_major_version, 1, type: :int32, json_name: "protocolMajorVersion" + field :protocol_minor_version, 2, type: :int32, json_name: "protocolMinorVersion" + field :proxy_name, 3, type: :string, json_name: "proxyName" + field :proxy_version, 4, type: :string, json_name: "proxyVersion" end - defmodule Eigr.Functions.Protocol.SideEffect do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "SideEffect", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "request", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "request", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.InvocationRequest", - default_value: nil, - options: nil, + name: "request", + number: 1, oneof_index: nil, - json_name: "request", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.InvocationRequest" } ], + name: "SideEffect", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:request, 1, type: Eigr.Functions.Protocol.InvocationRequest) + field :request, 1, type: Eigr.Functions.Protocol.InvocationRequest end - defmodule Eigr.Functions.Protocol.Broadcast do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Broadcast", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "channel_group", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "channelGroup", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "channel_group", + number: 1, oneof_index: nil, - json_name: "channelGroup", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any", - default_value: nil, - options: nil, + name: "value", + number: 3, oneof_index: 0, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" }, %Google.Protobuf.FieldDescriptorProto{ - name: "noop", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "noop", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop", - default_value: nil, - options: nil, + name: "noop", + number: 4, oneof_index: 0, - json_name: "noop", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" } ], + name: "Broadcast", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], name: "payload", - options: nil, - __unknown_fields__: [] + options: nil } ], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - oneof(:payload, 0) + oneof :payload, 0 - field(:channel_group, 1, type: :string, json_name: "channelGroup") - field(:value, 3, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 4, type: Eigr.Functions.Protocol.Noop, oneof: 0) + field :channel_group, 1, type: :string, json_name: "channelGroup" + field :value, 3, type: Google.Protobuf.Any, oneof: 0 + field :noop, 4, type: Eigr.Functions.Protocol.Noop, oneof: 0 end - defmodule Eigr.Functions.Protocol.Pipe do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Pipe", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "actor", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "actor", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "actor", + number: 1, oneof_index: nil, - json_name: "actor", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "action_name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "actionName", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "action_name", + number: 2, oneof_index: nil, - json_name: "actionName", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "Pipe", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:actor, 1, type: :string) - field(:action_name, 2, type: :string, json_name: "actionName") + field :actor, 1, type: :string + field :action_name, 2, type: :string, json_name: "actionName" end - defmodule Eigr.Functions.Protocol.Forward do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Forward", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "actor", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "actor", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "actor", + number: 1, oneof_index: nil, - json_name: "actor", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "action_name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "actionName", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "action_name", + number: 2, oneof_index: nil, - json_name: "actionName", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "Forward", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:actor, 1, type: :string) - field(:action_name, 2, type: :string, json_name: "actionName") + field :actor, 1, type: :string + field :action_name, 2, type: :string, json_name: "actionName" end - defmodule Eigr.Functions.Protocol.Workflow do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Workflow", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "broadcast", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "broadcast", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Broadcast", - default_value: nil, - options: nil, + name: "broadcast", + number: 2, oneof_index: nil, - json_name: "broadcast", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Broadcast" }, %Google.Protobuf.FieldDescriptorProto{ - name: "effects", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "effects", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.SideEffect", - default_value: nil, - options: nil, + name: "effects", + number: 1, oneof_index: nil, - json_name: "effects", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.SideEffect" }, %Google.Protobuf.FieldDescriptorProto{ - name: "pipe", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "pipe", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Pipe", - default_value: nil, - options: nil, + name: "pipe", + number: 3, oneof_index: 0, - json_name: "pipe", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Pipe" }, %Google.Protobuf.FieldDescriptorProto{ - name: "forward", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "forward", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Forward", - default_value: nil, - options: nil, + name: "forward", + number: 4, oneof_index: 0, - json_name: "forward", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Forward" } ], + name: "Workflow", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], name: "routing", - options: nil, - __unknown_fields__: [] + options: nil } ], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - oneof(:routing, 0) + oneof :routing, 0 - field(:broadcast, 2, type: Eigr.Functions.Protocol.Broadcast) - field(:effects, 1, repeated: true, type: Eigr.Functions.Protocol.SideEffect) - field(:pipe, 3, type: Eigr.Functions.Protocol.Pipe, oneof: 0) - field(:forward, 4, type: Eigr.Functions.Protocol.Forward, oneof: 0) + field :broadcast, 2, type: Eigr.Functions.Protocol.Broadcast + field :effects, 1, repeated: true, type: Eigr.Functions.Protocol.SideEffect + field :pipe, 3, type: Eigr.Functions.Protocol.Pipe, oneof: 0 + field :forward, 4, type: Eigr.Functions.Protocol.Forward, oneof: 0 end - defmodule Eigr.Functions.Protocol.InvocationRequest.MetadataEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "MetadataEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "MetadataEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:key, 1, type: :string) - field(:value, 2, type: :string) + field :key, 1, type: :string + field :value, 2, type: :string end - defmodule Eigr.Functions.Protocol.InvocationRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "InvocationRequest", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "system", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "system", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem", - default_value: nil, - options: nil, + name: "system", + number: 1, oneof_index: nil, - json_name: "system", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem" }, %Google.Protobuf.FieldDescriptorProto{ - name: "actor", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "actor", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor", - default_value: nil, - options: nil, + name: "actor", + number: 2, oneof_index: nil, - json_name: "actor", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor" }, %Google.Protobuf.FieldDescriptorProto{ - name: "action_name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "actionName", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "action_name", + number: 3, oneof_index: nil, - json_name: "actionName", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any", - default_value: nil, - options: nil, + name: "value", + number: 4, oneof_index: 0, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" }, %Google.Protobuf.FieldDescriptorProto{ - name: "noop", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 7, + json_name: "noop", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop", - default_value: nil, - options: nil, + name: "noop", + number: 7, oneof_index: 0, - json_name: "noop", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" }, %Google.Protobuf.FieldDescriptorProto{ - name: "async", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 5, + json_name: "async", label: :LABEL_OPTIONAL, - type: :TYPE_BOOL, - type_name: nil, - default_value: nil, - options: nil, + name: "async", + number: 5, oneof_index: nil, - json_name: "async", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_BOOL, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "caller", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 6, + json_name: "caller", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId", - default_value: nil, - options: nil, + name: "caller", + number: 6, oneof_index: nil, - json_name: "caller", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" }, %Google.Protobuf.FieldDescriptorProto{ - name: "metadata", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 8, + json_name: "metadata", label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.InvocationRequest.MetadataEntry", - default_value: nil, - options: nil, + name: "metadata", + number: 8, oneof_index: nil, - json_name: "metadata", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.InvocationRequest.MetadataEntry" }, %Google.Protobuf.FieldDescriptorProto{ - name: "scheduled_to", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 9, + json_name: "scheduledTo", label: :LABEL_OPTIONAL, - type: :TYPE_INT64, - type_name: nil, - default_value: nil, - options: nil, + name: "scheduled_to", + number: 9, oneof_index: nil, - json_name: "scheduledTo", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT64, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "pooled", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 10, + json_name: "pooled", label: :LABEL_OPTIONAL, - type: :TYPE_BOOL, - type_name: nil, - default_value: nil, - options: nil, + name: "pooled", + number: 10, oneof_index: nil, - json_name: "pooled", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_BOOL, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "register_ref", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 11, + json_name: "registerRef", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "register_ref", + number: 11, oneof_index: nil, - json_name: "registerRef", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "InvocationRequest", nested_type: [ %Google.Protobuf.DescriptorProto{ - name: "MetadataEntry", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "key", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "key", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "key", + number: 1, oneof_index: nil, - json_name: "key", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "MetadataEntry", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], + oneof_decl: [], options: %Google.Protobuf.MessageOptions{ - message_set_wire_format: false, - no_standard_descriptor_accessor: false, + __pb_extensions__: %{}, + __unknown_fields__: [], deprecated: false, map_entry: true, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] }, - oneof_decl: [], - reserved_range: [], reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } ], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], name: "payload", - options: nil, - __unknown_fields__: [] + options: nil } ], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - oneof(:payload, 0) + oneof :payload, 0 - field(:system, 1, type: Eigr.Functions.Protocol.Actors.ActorSystem) - field(:actor, 2, type: Eigr.Functions.Protocol.Actors.Actor) - field(:action_name, 3, type: :string, json_name: "actionName") - field(:value, 4, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 7, type: Eigr.Functions.Protocol.Noop, oneof: 0) - field(:async, 5, type: :bool) - field(:caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId) + field :system, 1, type: Eigr.Functions.Protocol.Actors.ActorSystem + field :actor, 2, type: Eigr.Functions.Protocol.Actors.Actor + field :action_name, 3, type: :string, json_name: "actionName" + field :value, 4, type: Google.Protobuf.Any, oneof: 0 + field :noop, 7, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field :async, 5, type: :bool + field :caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId - field(:metadata, 8, + field :metadata, 8, repeated: true, type: Eigr.Functions.Protocol.InvocationRequest.MetadataEntry, map: true - ) - field(:scheduled_to, 9, type: :int64, json_name: "scheduledTo") - field(:pooled, 10, type: :bool) - field(:register_ref, 11, type: :string, json_name: "registerRef") + field :scheduled_to, 9, type: :int64, json_name: "scheduledTo" + field :pooled, 10, type: :bool + field :register_ref, 11, type: :string, json_name: "registerRef" end - defmodule Eigr.Functions.Protocol.ActorInvocation do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorInvocation", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "actor", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "actor", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId", - default_value: nil, - options: nil, + name: "actor", + number: 1, oneof_index: nil, - json_name: "actor", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" }, %Google.Protobuf.FieldDescriptorProto{ - name: "action_name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "actionName", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "action_name", + number: 2, oneof_index: nil, - json_name: "actionName", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "current_context", - extendee: nil, - number: 3, - label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context", + __unknown_fields__: [], default_value: nil, - options: nil, - oneof_index: nil, + extendee: nil, json_name: "currentContext", + label: :LABEL_OPTIONAL, + name: "current_context", + number: 3, + oneof_index: nil, + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context" }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any", - default_value: nil, - options: nil, + name: "value", + number: 4, oneof_index: 0, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" }, %Google.Protobuf.FieldDescriptorProto{ - name: "noop", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 5, + json_name: "noop", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop", - default_value: nil, - options: nil, + name: "noop", + number: 5, oneof_index: 0, - json_name: "noop", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" }, %Google.Protobuf.FieldDescriptorProto{ - name: "caller", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 6, + json_name: "caller", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId", - default_value: nil, - options: nil, + name: "caller", + number: 6, oneof_index: nil, - json_name: "caller", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" } ], + name: "ActorInvocation", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], name: "payload", - options: nil, - __unknown_fields__: [] + options: nil } ], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - oneof(:payload, 0) + oneof :payload, 0 - field(:actor, 1, type: Eigr.Functions.Protocol.Actors.ActorId) - field(:action_name, 2, type: :string, json_name: "actionName") - field(:current_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "currentContext") - field(:value, 4, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0) - field(:caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId) + field :actor, 1, type: Eigr.Functions.Protocol.Actors.ActorId + field :action_name, 2, type: :string, json_name: "actionName" + field :current_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "currentContext" + field :value, 4, type: Google.Protobuf.Any, oneof: 0 + field :noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field :caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId end - defmodule Eigr.Functions.Protocol.ActorInvocationResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "ActorInvocationResponse", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "actor_name", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "actorName", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "actor_name", + number: 1, oneof_index: nil, - json_name: "actorName", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "actor_system", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "actorSystem", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "actor_system", + number: 2, oneof_index: nil, - json_name: "actorSystem", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "updated_context", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "updatedContext", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context", - default_value: nil, - options: nil, + name: "updated_context", + number: 3, oneof_index: nil, - json_name: "updatedContext", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context" }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any", - default_value: nil, - options: nil, + name: "value", + number: 4, oneof_index: 0, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" }, %Google.Protobuf.FieldDescriptorProto{ - name: "noop", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 6, + json_name: "noop", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop", - default_value: nil, - options: nil, + name: "noop", + number: 6, oneof_index: 0, - json_name: "noop", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" }, %Google.Protobuf.FieldDescriptorProto{ - name: "workflow", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 5, + json_name: "workflow", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Workflow", - default_value: nil, - options: nil, + name: "workflow", + number: 5, oneof_index: nil, - json_name: "workflow", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Workflow" }, %Google.Protobuf.FieldDescriptorProto{ - name: "checkpoint", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 7, + json_name: "checkpoint", label: :LABEL_OPTIONAL, - type: :TYPE_BOOL, - type_name: nil, - default_value: nil, - options: nil, + name: "checkpoint", + number: 7, oneof_index: nil, - json_name: "checkpoint", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_BOOL, + type_name: nil } ], + name: "ActorInvocationResponse", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], name: "payload", - options: nil, - __unknown_fields__: [] + options: nil } ], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - oneof(:payload, 0) + oneof :payload, 0 - field(:actor_name, 1, type: :string, json_name: "actorName") - field(:actor_system, 2, type: :string, json_name: "actorSystem") - field(:updated_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "updatedContext") - field(:value, 4, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 6, type: Eigr.Functions.Protocol.Noop, oneof: 0) - field(:workflow, 5, type: Eigr.Functions.Protocol.Workflow) - field(:checkpoint, 7, type: :bool) + field :actor_name, 1, type: :string, json_name: "actorName" + field :actor_system, 2, type: :string, json_name: "actorSystem" + field :updated_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "updatedContext" + field :value, 4, type: Google.Protobuf.Any, oneof: 0 + field :noop, 6, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field :workflow, 5, type: Eigr.Functions.Protocol.Workflow + field :checkpoint, 7, type: :bool end - defmodule Eigr.Functions.Protocol.InvocationResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "InvocationResponse", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "status", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "status", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus", - default_value: nil, - options: nil, + name: "status", + number: 1, oneof_index: nil, - json_name: "status", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus" }, %Google.Protobuf.FieldDescriptorProto{ - name: "system", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "system", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem", - default_value: nil, - options: nil, + name: "system", + number: 2, oneof_index: nil, - json_name: "system", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem" }, %Google.Protobuf.FieldDescriptorProto{ - name: "actor", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 3, + json_name: "actor", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor", - default_value: nil, - options: nil, + name: "actor", + number: 3, oneof_index: nil, - json_name: "actor", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor" }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 4, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any", - default_value: nil, - options: nil, + name: "value", + number: 4, oneof_index: 0, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" }, %Google.Protobuf.FieldDescriptorProto{ - name: "noop", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 5, + json_name: "noop", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop", - default_value: nil, - options: nil, + name: "noop", + number: 5, oneof_index: 0, - json_name: "noop", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" } ], + name: "InvocationResponse", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], name: "payload", - options: nil, - __unknown_fields__: [] + options: nil } ], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - oneof(:payload, 0) + oneof :payload, 0 - field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) - field(:system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem) - field(:actor, 3, type: Eigr.Functions.Protocol.Actors.Actor) - field(:value, 4, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0) + field :status, 1, type: Eigr.Functions.Protocol.RequestStatus + field :system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem + field :actor, 3, type: Eigr.Functions.Protocol.Actors.Actor + field :value, 4, type: Google.Protobuf.Any, oneof: 0 + field :noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0 end - defmodule Eigr.Functions.Protocol.RequestStatus do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "RequestStatus", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "status", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "status", label: :LABEL_OPTIONAL, - type: :TYPE_ENUM, - type_name: ".eigr.functions.protocol.Status", - default_value: nil, - options: nil, + name: "status", + number: 1, oneof_index: nil, - json_name: "status", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_ENUM, + type_name: ".eigr.functions.protocol.Status" }, %Google.Protobuf.FieldDescriptorProto{ - name: "message", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "message", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "message", + number: 2, oneof_index: nil, - json_name: "message", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil } ], + name: "RequestStatus", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:status, 1, type: Eigr.Functions.Protocol.Status, enum: true) - field(:message, 2, type: :string) + field :status, 1, type: Eigr.Functions.Protocol.Status, enum: true + field :message, 2, type: :string end diff --git a/lib/spawn/actors/state.pb.ex b/lib/spawn/actors/state.pb.ex index 5f940b5a..c79a6c38 100644 --- a/lib/spawn/actors/state.pb.ex +++ b/lib/spawn/actors/state.pb.ex @@ -1,92 +1,91 @@ defmodule Eigr.Functions.Protocol.State.Revision do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Revision", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_INT64, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 1, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_INT64, + type_name: nil } ], + name: "Revision", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:value, 1, type: :int64) + field :value, 1, type: :int64 end - defmodule Eigr.Functions.Protocol.State.Checkpoint do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Checkpoint", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "revision", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "revision", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.state.Revision", - default_value: nil, - options: nil, + name: "revision", + number: 1, oneof_index: nil, - json_name: "revision", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.state.Revision" }, %Google.Protobuf.FieldDescriptorProto{ - name: "state", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "state", label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState", - default_value: nil, - options: nil, + name: "state", + number: 2, oneof_index: nil, - json_name: "state", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState" } ], + name: "Checkpoint", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:revision, 1, type: Eigr.Functions.Protocol.State.Revision) - field(:state, 2, type: Eigr.Functions.Protocol.Actors.ActorState) + field :revision, 1, type: Eigr.Functions.Protocol.State.Revision + field :state, 2, type: Eigr.Functions.Protocol.Actors.ActorState end diff --git a/lib/spawn/google/protobuf/any.pb.ex b/lib/spawn/google/protobuf/any.pb.ex index 3a2ce9db..40d471d7 100644 --- a/lib/spawn/google/protobuf/any.pb.ex +++ b/lib/spawn/google/protobuf/any.pb.ex @@ -1,53 +1,53 @@ defmodule Google.Protobuf.Any do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "Any", + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "type_url", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 1, + json_name: "typeUrl", label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, + name: "type_url", + number: 1, oneof_index: nil, - json_name: "typeUrl", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_STRING, + type_name: nil }, %Google.Protobuf.FieldDescriptorProto{ - name: "value", + __unknown_fields__: [], + default_value: nil, extendee: nil, - number: 2, + json_name: "value", label: :LABEL_OPTIONAL, - type: :TYPE_BYTES, - type_name: nil, - default_value: nil, - options: nil, + name: "value", + number: 2, oneof_index: nil, - json_name: "value", + options: nil, proto3_optional: nil, - __unknown_fields__: [] + type: :TYPE_BYTES, + type_name: nil } ], + name: "Any", nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, oneof_decl: [], - reserved_range: [], + options: nil, reserved_name: [], - __unknown_fields__: [] + reserved_range: [] } end - field(:type_url, 1, type: :string, json_name: "typeUrl") - field(:value, 2, type: :bytes) + field :type_url, 1, type: :string, json_name: "typeUrl" + field :value, 2, type: :bytes end diff --git a/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex b/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex new file mode 100644 index 00000000..acc59fcc --- /dev/null +++ b/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex @@ -0,0 +1,578 @@ +defmodule Grpc.Reflection.V1alpha.ServerReflectionRequest do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "host", + label: :LABEL_OPTIONAL, + name: "host", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "fileByFilename", + label: :LABEL_OPTIONAL, + name: "file_by_filename", + number: 3, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "fileContainingSymbol", + label: :LABEL_OPTIONAL, + name: "file_containing_symbol", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "fileContainingExtension", + label: :LABEL_OPTIONAL, + name: "file_containing_extension", + number: 5, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".grpc.reflection.v1alpha.ExtensionRequest" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "allExtensionNumbersOfType", + label: :LABEL_OPTIONAL, + name: "all_extension_numbers_of_type", + number: 6, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "listServices", + label: :LABEL_OPTIONAL, + name: "list_services", + number: 7, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "ServerReflectionRequest", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "message_request", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :message_request, 0 + + field :host, 1, type: :string + field :file_by_filename, 3, type: :string, json_name: "fileByFilename", oneof: 0 + field :file_containing_symbol, 4, type: :string, json_name: "fileContainingSymbol", oneof: 0 + + field :file_containing_extension, 5, + type: Grpc.Reflection.V1alpha.ExtensionRequest, + json_name: "fileContainingExtension", + oneof: 0 + + field :all_extension_numbers_of_type, 6, + type: :string, + json_name: "allExtensionNumbersOfType", + oneof: 0 + + field :list_services, 7, type: :string, json_name: "listServices", oneof: 0 +end +defmodule Grpc.Reflection.V1alpha.ExtensionRequest do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "containingType", + label: :LABEL_OPTIONAL, + name: "containing_type", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "extensionNumber", + label: :LABEL_OPTIONAL, + name: "extension_number", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + } + ], + name: "ExtensionRequest", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :containing_type, 1, type: :string, json_name: "containingType" + field :extension_number, 2, type: :int32, json_name: "extensionNumber" +end +defmodule Grpc.Reflection.V1alpha.ServerReflectionResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "validHost", + label: :LABEL_OPTIONAL, + name: "valid_host", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "originalRequest", + label: :LABEL_OPTIONAL, + name: "original_request", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".grpc.reflection.v1alpha.ServerReflectionRequest" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "fileDescriptorResponse", + label: :LABEL_OPTIONAL, + name: "file_descriptor_response", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".grpc.reflection.v1alpha.FileDescriptorResponse" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "allExtensionNumbersResponse", + label: :LABEL_OPTIONAL, + name: "all_extension_numbers_response", + number: 5, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".grpc.reflection.v1alpha.ExtensionNumberResponse" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "listServicesResponse", + label: :LABEL_OPTIONAL, + name: "list_services_response", + number: 6, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".grpc.reflection.v1alpha.ListServiceResponse" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "errorResponse", + label: :LABEL_OPTIONAL, + name: "error_response", + number: 7, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".grpc.reflection.v1alpha.ErrorResponse" + } + ], + name: "ServerReflectionResponse", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "message_response", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :message_response, 0 + + field :valid_host, 1, type: :string, json_name: "validHost" + + field :original_request, 2, + type: Grpc.Reflection.V1alpha.ServerReflectionRequest, + json_name: "originalRequest" + + field :file_descriptor_response, 4, + type: Grpc.Reflection.V1alpha.FileDescriptorResponse, + json_name: "fileDescriptorResponse", + oneof: 0 + + field :all_extension_numbers_response, 5, + type: Grpc.Reflection.V1alpha.ExtensionNumberResponse, + json_name: "allExtensionNumbersResponse", + oneof: 0 + + field :list_services_response, 6, + type: Grpc.Reflection.V1alpha.ListServiceResponse, + json_name: "listServicesResponse", + oneof: 0 + + field :error_response, 7, + type: Grpc.Reflection.V1alpha.ErrorResponse, + json_name: "errorResponse", + oneof: 0 +end +defmodule Grpc.Reflection.V1alpha.FileDescriptorResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "fileDescriptorProto", + label: :LABEL_REPEATED, + name: "file_descriptor_proto", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_BYTES, + type_name: nil + } + ], + name: "FileDescriptorResponse", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :file_descriptor_proto, 1, repeated: true, type: :bytes, json_name: "fileDescriptorProto" +end +defmodule Grpc.Reflection.V1alpha.ExtensionNumberResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "baseTypeName", + label: :LABEL_OPTIONAL, + name: "base_type_name", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "extensionNumber", + label: :LABEL_REPEATED, + name: "extension_number", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + } + ], + name: "ExtensionNumberResponse", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :base_type_name, 1, type: :string, json_name: "baseTypeName" + field :extension_number, 2, repeated: true, type: :int32, json_name: "extensionNumber" +end +defmodule Grpc.Reflection.V1alpha.ListServiceResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "service", + label: :LABEL_REPEATED, + name: "service", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".grpc.reflection.v1alpha.ServiceResponse" + } + ], + name: "ListServiceResponse", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :service, 1, repeated: true, type: Grpc.Reflection.V1alpha.ServiceResponse +end +defmodule Grpc.Reflection.V1alpha.ServiceResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "name", + label: :LABEL_OPTIONAL, + name: "name", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "ServiceResponse", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :name, 1, type: :string +end +defmodule Grpc.Reflection.V1alpha.ErrorResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "errorCode", + label: :LABEL_OPTIONAL, + name: "error_code", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "errorMessage", + label: :LABEL_OPTIONAL, + name: "error_message", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "ErrorResponse", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :error_code, 1, type: :int32, json_name: "errorCode" + field :error_message, 2, type: :string, json_name: "errorMessage" +end +defmodule Grpc.Reflection.V1alpha.ServerReflection.Service do + @moduledoc false + use GRPC.Service, + name: "grpc.reflection.v1alpha.ServerReflection", + protoc_gen_elixir_version: "0.10.0" + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.ServiceDescriptorProto{ + __unknown_fields__: [], + method: [ + %Google.Protobuf.MethodDescriptorProto{ + __unknown_fields__: [], + client_streaming: true, + input_type: ".grpc.reflection.v1alpha.ServerReflectionRequest", + name: "ServerReflectionInfo", + options: nil, + output_type: ".grpc.reflection.v1alpha.ServerReflectionResponse", + server_streaming: true + } + ], + name: "ServerReflection", + options: nil + } + end + + rpc :ServerReflectionInfo, + stream(Grpc.Reflection.V1alpha.ServerReflectionRequest), + stream(Grpc.Reflection.V1alpha.ServerReflectionResponse) +end + +defmodule Grpc.Reflection.V1alpha.ServerReflection.Stub do + @moduledoc false + use GRPC.Stub, service: Grpc.Reflection.V1alpha.ServerReflection.Service +end diff --git a/priv/protos/eigr/functions/protocol/actors/actor.proto b/priv/protos/eigr/functions/protocol/actors/actor.proto index 9e72b0ca..88431d7a 100644 --- a/priv/protos/eigr/functions/protocol/actors/actor.proto +++ b/priv/protos/eigr/functions/protocol/actors/actor.proto @@ -166,4 +166,6 @@ message Actor { // The registered timer actions for an actor. repeated FixedTimerAction timer_actions = 5; + + string service_name = 7; } \ No newline at end of file diff --git a/priv/protos/grpc/reflection/v1alpha/reflection.proto b/priv/protos/grpc/reflection/v1alpha/reflection.proto new file mode 100644 index 00000000..462e85a2 --- /dev/null +++ b/priv/protos/grpc/reflection/v1alpha/reflection.proto @@ -0,0 +1,136 @@ +// Copyright 2016 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Service exported by server reflection + +syntax = "proto3"; + +package grpc.reflection.v1alpha; + +service ServerReflection { + // The reflection service is structured as a bidirectional stream, ensuring + // all related requests go to a single server. + rpc ServerReflectionInfo(stream ServerReflectionRequest) + returns (stream ServerReflectionResponse); +} + +// The message sent by the client when calling ServerReflectionInfo method. +message ServerReflectionRequest { + string host = 1; + // To use reflection service, the client should set one of the following + // fields in message_request. The server distinguishes requests by their + // defined field and then handles them using corresponding methods. + oneof message_request { + // Find a proto file by the file name. + string file_by_filename = 3; + + // Find the proto file that declares the given fully-qualified symbol name. + // This field should be a fully-qualified symbol name + // (e.g. .[.] or .). + string file_containing_symbol = 4; + + // Find the proto file which defines an extension extending the given + // message type with the given field number. + ExtensionRequest file_containing_extension = 5; + + // Finds the tag numbers used by all known extensions of the given message + // type, and appends them to ExtensionNumberResponse in an undefined order. + // Its corresponding method is best-effort: it's not guaranteed that the + // reflection service will implement this method, and it's not guaranteed + // that this method will provide all extensions. Returns + // StatusCode::UNIMPLEMENTED if it's not implemented. + // This field should be a fully-qualified type name. The format is + // . + string all_extension_numbers_of_type = 6; + + // List the full names of registered services. The content will not be + // checked. + string list_services = 7; + } +} + +// The type name and extension number sent by the client when requesting +// file_containing_extension. +message ExtensionRequest { + // Fully-qualified type name. The format should be . + string containing_type = 1; + int32 extension_number = 2; +} + +// The message sent by the server to answer ServerReflectionInfo method. +message ServerReflectionResponse { + string valid_host = 1; + ServerReflectionRequest original_request = 2; + // The server set one of the following fields accroding to the message_request + // in the request. + oneof message_response { + // This message is used to answer file_by_filename, file_containing_symbol, + // file_containing_extension requests with transitive dependencies. As + // the repeated label is not allowed in oneof fields, we use a + // FileDescriptorResponse message to encapsulate the repeated fields. + // The reflection service is allowed to avoid sending FileDescriptorProtos + // that were previously sent in response to earlier requests in the stream. + FileDescriptorResponse file_descriptor_response = 4; + + // This message is used to answer all_extension_numbers_of_type requst. + ExtensionNumberResponse all_extension_numbers_response = 5; + + // This message is used to answer list_services request. + ListServiceResponse list_services_response = 6; + + // This message is used when an error occurs. + ErrorResponse error_response = 7; + } +} + +// Serialized FileDescriptorProto messages sent by the server answering +// a file_by_filename, file_containing_symbol, or file_containing_extension +// request. +message FileDescriptorResponse { + // Serialized FileDescriptorProto messages. We avoid taking a dependency on + // descriptor.proto, which uses proto2 only features, by making them opaque + // bytes instead. + repeated bytes file_descriptor_proto = 1; +} + +// A list of extension numbers sent by the server answering +// all_extension_numbers_of_type request. +message ExtensionNumberResponse { + // Full name of the base type, including the package name. The format + // is . + string base_type_name = 1; + repeated int32 extension_number = 2; +} + +// A list of ServiceResponse sent by the server answering list_services request. +message ListServiceResponse { + // The information of each service may be expanded in the future, so we use + // ServiceResponse message to encapsulate it. + repeated ServiceResponse service = 1; +} + +// The information of a single service used by ListServiceResponse to answer +// list_services request. +message ServiceResponse { + // Full name of a registered service, including its package name. The format + // is . + string name = 1; +} + +// The error code and error message sent by the server when an error occurs. +message ErrorResponse { + // This field uses the error codes defined in grpc::StatusCode. + int32 error_code = 1; + string error_message = 2; +} \ No newline at end of file diff --git a/priv/templates/grpc_endpoint.ex.eex b/priv/templates/grpc_endpoint.ex.eex new file mode 100644 index 00000000..942c7b36 --- /dev/null +++ b/priv/templates/grpc_endpoint.ex.eex @@ -0,0 +1,16 @@ +defmodule Massa.Server.Grpc.ProxyEndpoint do + @moduledoc false + use GRPC.Endpoint + + intercept(GRPC.Logger.Server) + # intercept(GRPCPrometheus.ServerInterceptor) + + services = [ + MassProxy.Reflection.Service, +<%= Enum.map service_names, fn(service_name) -> %> + <%= service_name %>, +<% end %> + ] + + run(services) +end \ No newline at end of file diff --git a/priv/templates/grpc_service.ex.eex b/priv/templates/grpc_service.ex.eex new file mode 100644 index 00000000..58b4c00a --- /dev/null +++ b/priv/templates/grpc_service.ex.eex @@ -0,0 +1,30 @@ +defmodule <%= mod_name %>.ProxyService do + @moduledoc """ + This <%= mod_name %>.ProxyService module only passes + incoming gRPC requests to the respective Entity handlers. + + """ + @moduledoc since: "1.2.1" + + use GRPC.Server, service: <%= name %> + + alias MassaProxy.Runtime + +<%= Enum.map methods, fn(method) -> %> + @spec <%= method %>(<%= Map.get(input_types, method) %>.t(), GRPC.Server.Stream.t()) :: <%= Map.get(output_types, method) %>.t() + def <%= method %>(message, stream) do + Runtime.forward(%{ + service_name: "<%= service_name %>", + entity_type: "<%= entity_type %>", + persistence_id: "<%= persistence_id %>", + original_method: "<%= Map.get(original_methods, method) %>", + message: message, + stream: stream, + input_type: <%= Map.get(input_types, method) %>, + output_type: <%= Map.get(output_types, method) %>, + request_type: "<%= Map.get(request_types, method) %>" + }) + end +<% end %> + +end \ No newline at end of file diff --git a/spawn_proxy/proxy/lib/proxy/grpc/code_generator.ex b/spawn_proxy/proxy/lib/proxy/grpc/code_generator.ex new file mode 100644 index 00000000..5c44b9fd --- /dev/null +++ b/spawn_proxy/proxy/lib/proxy/grpc/code_generator.ex @@ -0,0 +1,157 @@ +defmodule Proxy.Grpc.CodeGenerator do + @moduledoc """ + TODO + """ + + alias Proxy.Grpc.Parser + + def compile(descriptors, actors) do + with {:ok, descriptors} <- descriptors |> compile(), + {:ok, _} <- generate_services(actors), + {:ok, _} <- generate_endpoints(actors) do + {:ok, descriptors, actors} + else + _ -> + {:error, descriptors, actors} + end + end + + def build_spec({:ok, descriptors, actors} = _metadata) do + end + + def build_spec({:error, _, _} = _metadata) do + raise ArgumentError, "Fail to compile protobuf files" + end + + defp compile(descriptors) do + files = + descriptors + |> Parser.prepare() + + for {name, file} <- files do + case do_compile(file) do + modules when is_list(modules) -> + Logger.debug("The #{name} descriptor has been compiled!") + + error -> + Logger.warning("Fail to compile descriptor #{name}. Details: #{inspect(error)}") + end + end + + {:ok, descriptors} + end + + defp generate_services(entities) do + root_template_path = + Application.get_env( + :massa_proxy, + :proxy_root_template_path, + :code.priv_dir(:massa_proxy) + ) + + grpc_template_path = + Path.expand( + "./templates/grpc_service.ex.eex", + root_template_path + ) + + for entity <- entities do + name = Enum.join([normalize_service_name(entity.service_name), "Service"], ".") + + Stream.map(entity.services, fn service -> + methods = + service.methods + |> Flow.from_enumerable() + |> Flow.map(&normalize_method_name(&1.name)) + |> Enum.to_list() + + Logger.info("Generating Service #{name} with Methods: #{inspect(methods)}") + + original_methods = get_method_names(service) + input_types = get_input_type(service) + output_types = get_output_type(service) + request_types = get_request_type(service) + + mod = + get_module( + grpc_template_path, + mod_name: name, + name: name, + methods: methods, + original_methods: original_methods, + handler: "MassaProxy.Runtime.Grpc.Server.Dispatcher", + entity_type: entity.entity_type, + persistence_id: entity.persistence_id, + service_name: entity.service_name, + input_types: input_types, + output_types: output_types, + request_types: request_types + ) + + Logger.debug("Service Definition:\n#{mod}") + do_compile(mod) + Logger.debug("Service compilation finish!") + end) + |> Stream.run() + end + + {:ok, entities} + end + + defp generate_endpoints(entities) do + root_template_path = + Application.get_env( + :massa_proxy, + :proxy_root_template_path, + :code.priv_dir(:massa_proxy) + ) + + grpc_endpoint_template_path = + Path.expand( + "./templates/grpc_endpoint.ex.eex", + root_template_path + ) + + services = + entities + |> Flow.from_enumerable() + |> Flow.map( + &Enum.join([normalize_service_name(&1.service_name), "Service.ProxyService"], ".") + ) + |> Enum.to_list() + + mod = + get_module( + grpc_endpoint_template_path, + service_names: services + ) + + Logger.debug("Endpoint Definition:\n#{mod}") + do_compile(mod) + Logger.debug("Endpoint compilation finish!") + + {:ok, entities} + end + + defp do_compile(file) do + Code.compile_string(file) + rescue + error in UndefinedFunctionError -> + Logger.error("Error in Module definition. Make sure the service name is correct") + raise error + + error -> + Logger.error("Error during Service compilation phase #{inspect(error)}") + end + + defp normalize_service_name(name) do + name + |> String.split(".") + |> Stream.map(&Macro.camelize(&1)) + |> Enum.join(".") + end + + defp normalize_method_name(name), do: Macro.underscore(name) + + defp get_module(filename, bindings \\ []), do: EEx.eval_file(filename, bindings) +end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/parser.ex b/spawn_proxy/proxy/lib/proxy/grpc/parser.ex new file mode 100644 index 00000000..b1b1ca3f --- /dev/null +++ b/spawn_proxy/proxy/lib/proxy/grpc/parser.ex @@ -0,0 +1,95 @@ +defmodule Proxy.Grpc.Parser do + @moduledoc false + require Logger + + def prepare(file_descriptor) do + ctx = + %Protobuf.Protoc.Context{gen_descriptors?: true, plugins: ["grpc"]} + |> find_types(file_descriptor) + + file_descriptor + |> Stream.map(fn desc -> + {desc.name, Proxy.Grpc.ProtoUtil.generate_content(ctx, desc)} + end) + |> Enum.to_list() + end + + @doc false + def find_types(ctx, descs) do + find_types(ctx, descs, %{}) + end + + @doc false + def find_types(ctx, [], acc) do + %{ctx | global_type_mapping: acc} + end + + def find_types(ctx, [desc | t], acc) do + types = find_types_in_proto(desc) + find_types(ctx, t, Map.put(acc, desc.name, types)) + end + + @doc false + def find_types_in_proto(%Google.Protobuf.FileDescriptorProto{} = desc) do + desc_ctx = %Protobuf.Protoc.Context{ + package: desc.package, + namespace: [] + } + + ctx = %{desc_ctx | module_prefix: desc_ctx.package || ""} + + %{} + |> find_types_in_proto(ctx, desc.message_type) + |> find_types_in_proto(ctx, desc.enum_type) + end + + defp find_types_in_proto(types, ctx, descs) when is_list(descs) do + Enum.reduce(descs, types, fn desc, acc -> + find_types_in_proto(acc, ctx, desc) + end) + end + + defp find_types_in_proto(types, ctx, %Google.Protobuf.DescriptorProto{name: name} = desc) do + new_ctx = append_ns(ctx, name) + + types + |> update_types(ctx, name) + |> find_types_in_proto(new_ctx, desc.enum_type) + |> find_types_in_proto(new_ctx, desc.nested_type) + end + + defp find_types_in_proto(types, ctx, %Google.Protobuf.EnumDescriptorProto{name: name}) do + update_types(types, ctx, name) + end + + defp append_ns(%{namespace: ns} = ctx, name) do + new_ns = ns ++ [name] + Map.put(ctx, :namespace, new_ns) + end + + defp update_types(types, %{namespace: ns, package: pkg, module_prefix: prefix}, name) do + type_name = + join_names(prefix || pkg, ns, name) + |> normalize_type_name() + + Map.put(types, "." <> join_names(pkg, ns, name), %{type_name: type_name}) + end + + defp join_names(pkg, ns, name) do + ns_str = Enum.join(ns, ".") + + [pkg, ns_str, name] + |> Enum.filter(&(&1 && &1 != "")) + |> Enum.join(".") + end + + defp normalize_type_name(name) do + name + |> String.split(".") + |> Enum.map_join(".", &trans_name/1) + end + + defp trans_name(name) do + Macro.camelize(name) + end +end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/proto_util.ex b/spawn_proxy/proxy/lib/proxy/grpc/proto_util.ex new file mode 100644 index 00000000..0bbb0589 --- /dev/null +++ b/spawn_proxy/proxy/lib/proxy/grpc/proto_util.ex @@ -0,0 +1,82 @@ +defmodule Proxy.Grpc.ProtoUtil do + @moduledoc false + require Logger + + alias Protobuf.Protoc.Generator.Message, as: MessageGenerator + alias Protobuf.Protoc.Generator.Enum, as: EnumGenerator + alias Protobuf.Protoc.Generator.Service, as: ServiceGenerator + alias Protobuf.Protoc.Generator.Extension, as: ExtensionGenerator + + @locals_without_parens [field: 2, field: 3, oneof: 2, rpc: 3, extend: 4, extensions: 1] + + @spec generate_content(Context.t(), Google.Protobuf.FileDescriptorProto.t()) :: String.t() + def generate_content(ctx, desc) do + ctx = %{ + ctx + | package: desc.package || "", + syntax: syntax(desc.syntax), + dep_type_mapping: get_dep_type_mapping(ctx, desc.dependency, desc.name) + } + + ctx = Map.put(ctx, :module_prefix, ctx.package || "") + ctx = Protobuf.Protoc.Context.custom_file_options_from_file_desc(ctx, desc) + {enums, msgs} = MessageGenerator.generate_list(ctx, desc.message_type) + + list = + enums ++ + Enum.map(desc.enum_type, fn d -> EnumGenerator.generate(ctx, d) end) ++ + msgs ++ + if Enum.member?(ctx.plugins, "grpc") do + Enum.map(desc.service, fn d -> ServiceGenerator.generate(ctx, d) end) + end + + nested_extensions = + ExtensionGenerator.get_nested_extensions(ctx, desc.message_type) + |> Enum.reverse() + + list = list ++ [ExtensionGenerator.generate(ctx, desc, nested_extensions)] + + list + |> List.flatten() + |> Enum.filter(&(!is_nil(&1))) + |> Enum.map(fn {_, v} -> v end) + |> Enum.join("\n") + |> format_code() + end + + @doc false + def get_dep_pkgs(%{pkg_mapping: mapping, package: pkg}, deps) do + pkgs = deps |> Enum.map(fn dep -> mapping[dep] end) + pkgs = if pkg && String.length(pkg) > 0, do: [pkg | pkgs], else: pkgs + Enum.sort(pkgs, &(byte_size(&2) <= byte_size(&1))) + end + + def get_dep_type_mapping(%{global_type_mapping: global_mapping}, deps, file_name) do + mapping = + Enum.reduce(deps, %{}, fn dep, acc -> + Map.merge(acc, global_mapping[dep]) + end) + + Map.merge(mapping, global_mapping[file_name]) + end + + defp syntax("proto3"), do: :proto3 + defp syntax(_), do: :proto2 + + def format_code(code) do + formatted = + if Code.ensure_loaded?(Code) && function_exported?(Code, :format_string!, 2) do + code + |> Code.format_string!(locals_without_parens: @locals_without_parens) + |> IO.iodata_to_binary() + else + code + end + + if formatted == "" do + formatted + else + formatted <> "\n" + end + end +end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/reflection.ex b/spawn_proxy/proxy/lib/proxy/grpc/reflection.ex new file mode 100644 index 00000000..d934078b --- /dev/null +++ b/spawn_proxy/proxy/lib/proxy/grpc/reflection.ex @@ -0,0 +1,214 @@ +defmodule Proxy.Grpc.Reflection do + @moduledoc """ + This module is responsible for handling all requests + with a view to contract reflection (reflection.proto) + """ + use GenServer + require Logger + + alias Google.Protobuf.{FileDescriptorProto} + + alias Grpc.Reflection.V1alpha.{ + ErrorResponse, + FileDescriptorResponse, + ListServiceResponse, + ServerReflectionResponse, + ServiceResponse + } + + def child_spec(state) do + %{ + id: __MODULE__, + start: {__MODULE__, :start_link, [state]} + } + end + + @impl true + def init(state) do + {:ok, state} + end + + @impl true + def handle_call(:list_services, _from, state) do + service_response = + state + |> Enum.map(&extract_info/1) + |> Enum.reduce(fn -> [] end, fn s, acc -> + acc ++ [s] + end) + |> Enum.to_list() + |> List.flatten() + + response = + ServerReflectionResponse.new( + message_response: + {:list_services_response, ListServiceResponse.new(service: service_response)} + ) + + {:reply, response, state} + end + + @impl true + def handle_call({:file_by_filename, filename}, _from, state) do + files = + state + |> Enum.filter(fn descriptor -> descriptor.name =~ filename end) + |> Enum.map(fn descriptor -> FileDescriptorProto.encode(descriptor) end) + |> Enum.reduce(fn -> [] end, fn s, acc -> + acc ++ [s] + end) + |> Enum.to_list() + |> List.flatten() + + response = + ServerReflectionResponse.new( + message_response: + {:file_descriptor_response, FileDescriptorResponse.new(file_descriptor_proto: files)} + ) + + {:reply, response, state} + end + + @impl true + def handle_call({:file_containing_symbol, symbol}, _from, state) do + resp = + with {:fail, :empty} <- contains_service(state, symbol), + {:fail, :empty} <- contains_message_type(state, symbol) do + response = + ServerReflectionResponse.new( + message_response: + {:error_response, + ErrorResponse.new(error_code: 5, error_message: "Symbol Not Found")} + ) + + response + else + {:ok, description} -> + response = + ServerReflectionResponse.new( + message_response: + {:file_descriptor_response, + FileDescriptorResponse.new(file_descriptor_proto: description)} + ) + + response + end + + {:reply, response, state} + end + + # Client API + def start_link(state) do + GenServer.start_link(__MODULE__, state, name: __MODULE__) + end + + def list_services() do + GenServer.call(__MODULE__, :list_services) + end + + def find_by_filename(filename) do + GenServer.call(__MODULE__, {:file_by_filename, filename}) + end + + def find_by_symbol(symbol) do + GenServer.call(__MODULE__, {:file_containing_symbol, symbol}) + end + + # Private + defp contains_service(state, symbol) do + description = + state + |> Enum.map(&get_service(&1, symbol)) + |> Enum.reduce(fn -> [] end, fn s, acc -> + acc ++ [s] + end) + |> Enum.to_list() + |> List.flatten() + + if Enum.empty?(description) do + {:fail, :empty} + else + {:ok, description} + end + end + + defp contains_message_type(state, symbol) do + description = + state + |> Enum.map(&get_messages(&1, symbol)) + |> Enum.reduce(fn -> [] end, fn s, acc -> + if s != nil || s != [] do + acc ++ [s] + else + acc + end + end) + |> Enum.to_list() + |> List.flatten() + + if Enum.empty?(description) do + {:fail, :empty} + else + {:ok, Enum.filter(description, &(!is_nil(&1)))} + end + end + + defp get_service(descriptor, symbol) do + services = extract_services(descriptor) + + svcs = + services + |> Enum.filter(fn service -> symbol =~ service.name end) + |> Enum.map(fn _ -> FileDescriptorProto.encode(descriptor) end) + |> Enum.reduce(fn -> [] end, fn s, acc -> + acc ++ [s] + end) + |> Enum.to_list() + + svcs + end + + defp get_messages(descriptor, symbol) do + message_types = extract_messages(descriptor) + + if !Enum.empty?(message_types) do + types = + message_types + |> Enum.filter(fn message -> symbol =~ message.name end) + |> Enum.map(fn _ -> FileDescriptorProto.encode(descriptor) end) + |> Enum.reduce(fn -> [] end, fn s, acc -> + [s] ++ acc + end) + |> Enum.to_list() + + types + end + end + + defp extract_info(descriptor) do + package = descriptor.package + services = extract_services(descriptor) + + svcs = + services + |> Enum.map(fn service -> ServiceResponse.new(name: "#{package}.#{service.name}") end) + |> Enum.reduce(fn -> [] end, fn s, acc -> + acc ++ [s] + end) + |> Enum.to_list() + + svcs + end + + defp extract_services(file) do + file.service + |> Enum.from_enumerable() + |> Enum.to_list() + end + + defp extract_messages(file) do + file.message_type + |> Flow.from_enumerable() + |> Enum.to_list() + end +end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/reflection/service.ex b/spawn_proxy/proxy/lib/proxy/grpc/reflection/service.ex new file mode 100644 index 00000000..1bad9c26 --- /dev/null +++ b/spawn_proxy/proxy/lib/proxy/grpc/reflection/service.ex @@ -0,0 +1,45 @@ +defmodule Proxy.Grpc.Reflection.Service do + @moduledoc """ + This module implement gRPC Reflection + """ + @moduledoc since: "1.2.1" + use GRPC.Server, service: Grpc.Reflection.V1alpha.ServerReflection.Service + + require Logger + alias GRPC.Server + alias Proxy.Grpc.Reflection, as: ReflectionServer + alias Grpc.Reflection.V1alpha.{ServerReflectionRequest, ServerReflectionResponse, ErrorResponse} + + @spec server_reflection_info(ServerReflectionRequest.t(), GRPC.Server.Stream.t()) :: + ServerReflectionResponse.t() + def server_reflection_info(request, stream) do + Enum.each(request, fn message -> + Logger.debug("Received reflection request: #{inspect(message)}") + + response = + case message.message_request do + {:list_services, _} -> + ReflectionServer.list_services() + + {:file_containing_symbol, _} -> + symbol = elem(message.message_request, 1) + ReflectionServer.find_by_symbol(symbol) + + {:file_by_filename, _} -> + filename = elem(message.message_request, 1) + ReflectionServer.find_by_filename(filename) + + _ -> + Logger.warn("This Reflection Operation is not supported") + + ServerReflectionResponse.new( + message_response: + {:error_response, + ErrorResponse.new(error_code: 13, error_message: "Operation not supported")} + ) + end + + Server.send_reply(stream, response) + end) + end +end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/supervisor.ex b/spawn_proxy/proxy/lib/proxy/grpc/supervisor.ex new file mode 100644 index 00000000..9c27b932 --- /dev/null +++ b/spawn_proxy/proxy/lib/proxy/grpc/supervisor.ex @@ -0,0 +1,27 @@ +defmodule Proxy.Grpc.Supervisor do + @moduledoc false + use Supervisor + require Logger + + alias Proxy.Grpc.CodeGenerator, as: GrpcGenerator + + def init(opts) do + Logger.info("Starting gRPC Server...") + Application.put_env(:grpc, :start_server, true, persistent: true) + + descriptor = Keyword.fetch!(:file_descriptor) + actors = Keyword.fetch!(:actors) + + children = + descriptor + |> GrpcGenerator.compile(actors) + |> GrpcGenerator.build_spec() + |> maybe_start_reflection(descriptor) + + Supervisor.init(children, strategy: :rest_for_one) + end + + defp maybe_start_reflection(children, descriptor) do + [children] ++ [{Proxy.Grpc.Reflection, [descriptor]}] + end +end diff --git a/spawn_proxy/proxy/lib/proxy/supervisor.ex b/spawn_proxy/proxy/lib/proxy/supervisor.ex index e74d59ee..a4d164a3 100644 --- a/spawn_proxy/proxy/lib/proxy/supervisor.ex +++ b/spawn_proxy/proxy/lib/proxy/supervisor.ex @@ -55,7 +55,7 @@ defmodule Proxy.Supervisor do [ port: Config.get(:http_port), thousand_island_options: [ - num_acceptors: 150, + num_acceptors: Config.get(:http_num_acceptors), max_connections_retry_wait: 2000, max_connections_retry_count: 10, shutdown_timeout: 120_000 diff --git a/spawn_proxy/proxy/mix.exs b/spawn_proxy/proxy/mix.exs index 50837baf..52f38408 100644 --- a/spawn_proxy/proxy/mix.exs +++ b/spawn_proxy/proxy/mix.exs @@ -32,6 +32,7 @@ defmodule Proxy.MixProject do {:spawn, path: "../../"}, {:bakeware, "~> 0.2"}, {:bandit, "~> 1.1"}, + {:grpc, "~> 0.7"}, {:observer_cli, "~> 1.7"}, {:sobelow, "~> 0.13", only: [:dev, :test], runtime: false} ] From 19c7da14da15630b1e600e1aaa291ffcd8937f15 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 14 Feb 2024 20:32:53 -0300 Subject: [PATCH 02/48] Add proto path and refactor proto --- lib/actors/config/persistent_term_config.ex | 10 ++++++++++ lib/spawn/actors/actor.pb.ex | 16 ---------------- .../eigr/functions/protocol/actors/actor.proto | 2 -- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/lib/actors/config/persistent_term_config.ex b/lib/actors/config/persistent_term_config.ex index 260dc0e4..ee73f741 100644 --- a/lib/actors/config/persistent_term_config.ex +++ b/lib/actors/config/persistent_term_config.ex @@ -50,6 +50,7 @@ if Code.ensure_loaded?(:persistent_term) do {:proxy_http_client_adapter_pool_schedulers, "0"}, {:proxy_http_client_adapter_pool_size, "30"}, {:proxy_http_client_adapter_pool_max_idle_timeout, "1000"}, + {:proxy_proto_descriptor_path, "/app/protos/user-function.desc"}, {:proxy_cluster_strategy, "gossip"}, {:proxy_headless_service, "proxy-headless"}, {:proxy_cluster_polling_interval, "3000"}, @@ -425,6 +426,15 @@ if Code.ensure_loaded?(:persistent_term) do value end + defp load_env({:proxy_proto_descriptor_path, default}) do + value = + env("PROXY_PROTO_DESCRIPTOR_PATH", default) + + :persistent_term.put({__MODULE__, :proxy_proto_descriptor_path}, value) + + value + end + defp load_env({:proxy_cluster_strategy, default}) do value = env("PROXY_CLUSTER_STRATEGY", default) :persistent_term.put({__MODULE__, :proxy_cluster_strategy}, value) diff --git a/lib/spawn/actors/actor.pb.ex b/lib/spawn/actors/actor.pb.ex index 0ba90118..a6c50b9f 100644 --- a/lib/spawn/actors/actor.pb.ex +++ b/lib/spawn/actors/actor.pb.ex @@ -1155,20 +1155,6 @@ defmodule Eigr.Functions.Protocol.Actors.Actor do proto3_optional: nil, type: :TYPE_MESSAGE, type_name: ".eigr.functions.protocol.actors.FixedTimerAction" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceName", - label: :LABEL_OPTIONAL, - name: "service_name", - number: 7, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil } ], name: "Actor", @@ -1190,6 +1176,4 @@ defmodule Eigr.Functions.Protocol.Actors.Actor do repeated: true, type: Eigr.Functions.Protocol.Actors.FixedTimerAction, json_name: "timerActions" - - field :service_name, 7, type: :string, json_name: "serviceName" end diff --git a/priv/protos/eigr/functions/protocol/actors/actor.proto b/priv/protos/eigr/functions/protocol/actors/actor.proto index 88431d7a..9e72b0ca 100644 --- a/priv/protos/eigr/functions/protocol/actors/actor.proto +++ b/priv/protos/eigr/functions/protocol/actors/actor.proto @@ -166,6 +166,4 @@ message Actor { // The registered timer actions for an actor. repeated FixedTimerAction timer_actions = 5; - - string service_name = 7; } \ No newline at end of file From 78f74f9d88013f4e8fa6bf040ad1d16afd8b7c7b Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sat, 17 Feb 2024 15:42:00 -0300 Subject: [PATCH 03/48] First part of grpc compiler --- lib/actors/config/persistent_term_config.ex | 5 +- lib/sidecar/grpc/code_generator.ex | 115 ++ lib/sidecar/grpc/dispatcher.ex | 18 + .../grpc/generators/handler_generator.ex | 82 ++ .../handler_transcoding_generator.ex | 85 ++ .../grpc/generators/service_generator.ex | 55 + .../generators/service_resolver_generator.ex | 70 + .../proxy => lib/sidecar}/grpc/reflection.ex | 4 +- .../sidecar}/grpc/reflection/service.ex | 2 +- lib/sidecar/grpc/service_resolver.ex | 5 + .../proxy => lib/sidecar}/grpc/supervisor.ex | 18 +- mix.exs | 2 + mix.lock | 5 +- priv/protos/google/api/annotations.proto | 31 + priv/protos/google/api/http.proto | 375 +++++ priv/protos/google/protobuf/descriptor.proto | 1223 +++++++++++++++++ priv/protos/google/protobuf/timestamp.proto | 144 ++ priv/protos/helloworld.proto | 47 + priv/protos/modules/helloworld.pb.ex | 822 +++++++++++ .../proxy/lib/proxy/grpc/code_generator.ex | 157 --- spawn_proxy/proxy/lib/proxy/grpc/parser.ex | 95 -- .../proxy/lib/proxy/grpc/proto_util.ex | 82 -- spawn_proxy/proxy/mix.exs | 1 - 23 files changed, 3092 insertions(+), 351 deletions(-) create mode 100644 lib/sidecar/grpc/code_generator.ex create mode 100644 lib/sidecar/grpc/dispatcher.ex create mode 100644 lib/sidecar/grpc/generators/handler_generator.ex create mode 100644 lib/sidecar/grpc/generators/handler_transcoding_generator.ex create mode 100644 lib/sidecar/grpc/generators/service_generator.ex create mode 100644 lib/sidecar/grpc/generators/service_resolver_generator.ex rename {spawn_proxy/proxy/lib/proxy => lib/sidecar}/grpc/reflection.ex (98%) rename {spawn_proxy/proxy/lib/proxy => lib/sidecar}/grpc/reflection/service.ex (96%) create mode 100644 lib/sidecar/grpc/service_resolver.ex rename {spawn_proxy/proxy/lib/proxy => lib/sidecar}/grpc/supervisor.ex (58%) create mode 100644 priv/protos/google/api/annotations.proto create mode 100644 priv/protos/google/api/http.proto create mode 100644 priv/protos/google/protobuf/descriptor.proto create mode 100644 priv/protos/google/protobuf/timestamp.proto create mode 100644 priv/protos/helloworld.proto create mode 100644 priv/protos/modules/helloworld.pb.ex delete mode 100644 spawn_proxy/proxy/lib/proxy/grpc/code_generator.ex delete mode 100644 spawn_proxy/proxy/lib/proxy/grpc/parser.ex delete mode 100644 spawn_proxy/proxy/lib/proxy/grpc/proto_util.ex diff --git a/lib/actors/config/persistent_term_config.ex b/lib/actors/config/persistent_term_config.ex index ee73f741..903ddcc4 100644 --- a/lib/actors/config/persistent_term_config.ex +++ b/lib/actors/config/persistent_term_config.ex @@ -26,7 +26,7 @@ if Code.ensure_loaded?(:persistent_term) do {:delayed_invokes, "true"}, {:deployment_mode, "sidecar"}, {:http_port, "9001"}, - {:http_num_acceptors, "150"} + {:http_num_acceptors, "150"}, {:internal_nats_hosts, "nats://127.0.0.1:4222"}, {:internal_nats_tls, "false"}, {:internal_nats_auth, "false"}, @@ -427,8 +427,7 @@ if Code.ensure_loaded?(:persistent_term) do end defp load_env({:proxy_proto_descriptor_path, default}) do - value = - env("PROXY_PROTO_DESCRIPTOR_PATH", default) + value = env("PROXY_PROTO_DESCRIPTOR_PATH", default) :persistent_term.put({__MODULE__, :proxy_proto_descriptor_path}, value) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex new file mode 100644 index 00000000..5d56e8ed --- /dev/null +++ b/lib/sidecar/grpc/code_generator.ex @@ -0,0 +1,115 @@ +defmodule Sidecar.Grpc.CodeGenerator do + @moduledoc """ + Module for generating gRPC code from Protobuf files. + + This module provides functionality to compile Protobuf files and generate gRPC-related code. + It supports both gRPC and HTTP transcoding code generation. + + ## Usage + + 1. Call `compile_protos/1` to generate gRPC code from Protobuf files. + 2. Ensure that Protobuf files are placed in the specified directory (`priv/protos` by default). + + """ + require Logger + + alias Mix.Tasks.Protobuf.Generate + + @doc """ + Compiles Protobuf files and generates gRPC-related code. + + ### Options: + + - `:output_path` - Output path for generated code (default: "priv/protos/modules"). + - `:http_transcoding_enabled` - Enable HTTP transcoding (default: true). + + ### Example: + + ```elixir + Sidecar.Grpc.CodeGenerator.compile_protos(output_path: "custom_output", http_transcoding_enabled: false) + + """ + def compile_protos(opts \\ []) do + include_path = "#{File.cwd!()}/priv/protos" + output_path = Keyword.get(opts, :output_path, "#{File.cwd!()}/priv/protos/modules") + transcoding_enabled? = Keyword.get(opts, :http_transcoding_enabled, true) + + {grpc_generator_plugin, handler_generator_plugin} = + if transcoding_enabled? do + {ProtobufGenerate.Plugins.GRPCWithOptions, + Sidecar.Grpc.Generators.HandlerTranscodingGenerator} + else + {ProtobufGenerate.Plugins.GRPC, Sidecar.Grpc.Generators.HandlerGenerator} + end + + user_defined_proto_files = + list_files_with_extension(include_path, ".proto") + |> Enum.join(" ") + + protoc_options = [ + "--include-path=#{include_path}", + "--include-path=#{File.cwd!()}/priv/protos/google/protobuf", + "--include-path=#{File.cwd!()}/priv/protos/google/api", + "--generate-descriptors=true", + "--output-path=#{output_path}", + "--plugins=#{grpc_generator_plugin}", + "--plugins=#{handler_generator_plugin}", + # "--plugins=Sidecar.Grpc.Generators.ServiceGenerator", + "#{include_path}/#{user_defined_proto_files}" + ] + + _ = Generate.run(protoc_options) + end + + @doc """ + Compiles an Elixir module generated from Protobuf files and returns the compiled code. + + ### Parameters: + + - `module` - The String of Elixir module code generated from Protobuf files. + + ### Returns: + + The compiled Elixir code. + + ### Example: + + ```elixir + module_code = Sidecar.Grpc.CodeGenerator.compile_module(generated_code) + + Raises: + + Raises an error if there are issues during the compilation process. + + """ + def compile_module(module), do: do_compile(module) + + defp do_compile(module) do + Code.compile_string(module) + rescue + error in UndefinedFunctionError -> + Logger.error("Error in Module definition. Make sure the service name is correct") + raise error + + error -> + Logger.error("Error during Service compilation phase #{inspect(error)}") + end + + defp list_files_with_extension(directory, extension) do + {:ok, files} = File.ls(directory) + + files + |> Enum.filter(&String.ends_with?(&1, extension)) + end + + defp normalize_service_name(name) do + name + |> String.split(".") + |> Stream.map(&Macro.camelize(&1)) + |> Enum.join(".") + end + + defp normalize_method_name(name), do: Macro.underscore(name) + + defp get_module(filename, bindings \\ []), do: EEx.eval_file(filename, bindings) +end diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex new file mode 100644 index 00000000..0b0c263f --- /dev/null +++ b/lib/sidecar/grpc/dispatcher.ex @@ -0,0 +1,18 @@ +defmodule Sidecar.Grpc.Dispatcher do + @moduledoc false + require Logger + + def dispatch( + %{ + system: system_name, + actor: actor_name, + input: message, + stream: stream, + descriptor: descriptor + } = request + ) do + Logger.debug( + "Dispatching gRPC message to actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" + ) + end +end diff --git a/lib/sidecar/grpc/generators/handler_generator.ex b/lib/sidecar/grpc/generators/handler_generator.ex new file mode 100644 index 00000000..e51c1644 --- /dev/null +++ b/lib/sidecar/grpc/generators/handler_generator.ex @@ -0,0 +1,82 @@ +defmodule Sidecar.Grpc.Generators.HandlerGenerator do + @moduledoc """ + TODO + """ + @behaviour ProtobufGenerate.Plugin + + alias Protobuf.Protoc.Generator.Util + + @impl true + def template do + """ + defmodule <%= @module %>.ActorDispatcher do + @moduledoc since: "1.2.1" + use GRPC.Server, service: <%= @service_name %> + + <%= for {method_name, input, output} <- @methods do %> + @spec <%= Macro.underscore(method_name) %>(<%= input %>.t(), GRPC.Server.Stream.t()) :: <%= output %>.t() + def <%= method_name %>(message, stream) do + request = %{ + system: <%= inspect(@actor_system) %>, + actor_name: <%= inspect(@actor_name) %>, + action_name: <%= inspect(method_name) %>, + input: message, + stream: stream + } + + Dispatcher.dispatch(request) + end + <% end %> + + end + """ + end + + @impl true + def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = desc) do + for svc <- svcs do + mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) + actor_name = Macro.camelize(svc.name) + # TODO get system name here from configuration + actor_system = "spawn-system" + name = Util.prepend_package_prefix(ctx.package, svc.name) + + methods = + for m <- svc.method do + input = service_arg(Util.type_from_type_name(ctx, m.input_type), m.client_streaming) + output = service_arg(Util.type_from_type_name(ctx, m.output_type), m.server_streaming) + + options = + m.options + |> opts() + |> inspect(limit: :infinity) + + {m.name, input, output, options} + end + + {mod_name, + [ + module: mod_name, + actor_system: actor_system, + actor_name: actor_name, + service_name: name, + methods: methods, + version: Util.version() + ]} + end + end + + defp service_arg(type, _streaming? = true), do: "stream(#{type})" + defp service_arg(type, _streaming?), do: type + + defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) + when extensions == %{} do + %{} + end + + defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) do + for {{type, field}, value} <- extensions, into: %{} do + {field, %{type: type, value: value}} + end + end +end diff --git a/lib/sidecar/grpc/generators/handler_transcoding_generator.ex b/lib/sidecar/grpc/generators/handler_transcoding_generator.ex new file mode 100644 index 00000000..3dbff127 --- /dev/null +++ b/lib/sidecar/grpc/generators/handler_transcoding_generator.ex @@ -0,0 +1,85 @@ +defmodule Sidecar.Grpc.Generators.HandlerTranscodingGenerator do + @moduledoc """ + TODO + """ + @behaviour ProtobufGenerate.Plugin + + alias Protobuf.Protoc.Generator.Util + + @impl true + def template do + """ + defmodule <%= @module %>.ActorDispatcher do + @moduledoc since: "1.2.1" + use GRPC.Server, service: <%= @service_name %>, http_transcode: true + + alias Sidecar.Grpc.Dispatcher + + <%= for {method_name, input, output, _options} <- @methods do %> + @spec <%= Macro.underscore(method_name) %>(<%= input %>.t(), GRPC.Server.Stream.t()) :: <%= output %>.t() + def <%= Macro.underscore(method_name) %>(message, stream) do + request = %{ + system: <%= inspect(@actor_system) %>, + actor_name: <%= inspect(@actor_name) %>, + action_name: <%= inspect(method_name) %>, + input: message, + stream: stream, + descriptor: <%= @service_name %>.Service.descriptor() + } + + Dispatcher.dispatch(request) + end + <% end %> + + end + """ + end + + @impl true + def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = desc) do + for svc <- svcs do + mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) + actor_name = Macro.camelize(svc.name) + # TODO get system name here from configuration + actor_system = "spawn-system" + name = Util.prepend_package_prefix(ctx.package, svc.name) + + methods = + for m <- svc.method do + input = service_arg(Util.type_from_type_name(ctx, m.input_type), m.client_streaming) + output = service_arg(Util.type_from_type_name(ctx, m.output_type), m.server_streaming) + + options = + m.options + |> opts() + |> inspect(limit: :infinity) + + {m.name, input, output, options} + end + + {mod_name, + [ + module: mod_name, + actor_system: actor_system, + actor_name: actor_name, + service_name: mod_name, + methods: methods, + version: Util.version() + ]} + end + end + + defp service_arg(type, _streaming? = true), do: "stream(#{type})" + defp service_arg(type, _streaming?), do: type + + defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) + when extensions == %{} do + %{} + end + + defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) do + for {{type, field}, value} <- extensions, into: %{} do + {field, %{type: type, value: value}} + end + end +end diff --git a/lib/sidecar/grpc/generators/service_generator.ex b/lib/sidecar/grpc/generators/service_generator.ex new file mode 100644 index 00000000..89d7aca5 --- /dev/null +++ b/lib/sidecar/grpc/generators/service_generator.ex @@ -0,0 +1,55 @@ +defmodule Sidecar.Grpc.Generators.ServiceGenerator do + @moduledoc """ + TODO + """ + @behaviour ProtobufGenerate.Plugin + + alias Protobuf.Protoc.Generator.Util + + @impl true + def template do + """ + defmodule Sidecar.Grpc.ProxyEndpoint do + @moduledoc false + use GRPC.Endpoint + + intercept(GRPC.Logger.Server) + + services = [ + #MassProxy.Reflection.Service, + <%= for service_name <- @services do %> + <%= service_name %>, + <% end %> + ] + + run(services) + end + """ + end + + @impl true + def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = desc) do + for svc <- svcs do + mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) + + {mod_name, + [ + service_name: mod_name + ]} + end + end + + defp service_arg(type, _streaming? = true), do: "stream(#{type})" + defp service_arg(type, _streaming?), do: type + + defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) + when extensions == %{} do + %{} + end + + defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) do + for {{type, field}, value} <- extensions, into: %{} do + {field, %{type: type, value: value}} + end + end +end diff --git a/lib/sidecar/grpc/generators/service_resolver_generator.ex b/lib/sidecar/grpc/generators/service_resolver_generator.ex new file mode 100644 index 00000000..68bd25e7 --- /dev/null +++ b/lib/sidecar/grpc/generators/service_resolver_generator.ex @@ -0,0 +1,70 @@ +defmodule Sidecar.Grpc.Generators.ServiceResolverGenerator do + @moduledoc """ + TODO + """ + @behaviour ProtobufGenerate.Plugin + + alias Protobuf.Protoc.Generator.Util + + @impl true + def template do + """ + defmodule Sidecar.Grpc.ServiceResolver do + @moduledoc since: "1.2.1" + + + <%= for {method_name, input, output, _options} <- @methods do %> + + <% end %> + + end + """ + end + + @impl true + def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do + for svc <- svcs do + mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) + actor_name = Macro.camelize(svc.name) + # TODO get system name here from configuration + actor_system = "spawn-system" + name = Util.prepend_package_prefix(ctx.package, svc.name) + + methods = + for m <- svc.method do + input = service_arg(Util.type_from_type_name(ctx, m.input_type), m.client_streaming) + output = service_arg(Util.type_from_type_name(ctx, m.output_type), m.server_streaming) + + options = + m.options + |> opts() + |> inspect(limit: :infinity) + + {Macro.underscore(m.name), input, output, options} + end + + {mod_name, + [ + module: mod_name, + actor_name: actor_name, + service_name: mod_name, + methods: methods, + version: Util.version() + ]} + end + end + + defp service_arg(type, _streaming? = true), do: "stream(#{type})" + defp service_arg(type, _streaming?), do: type + + defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) + when extensions == %{} do + %{} + end + + defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) do + for {{type, field}, value} <- extensions, into: %{} do + {field, %{type: type, value: value}} + end + end +end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/reflection.ex b/lib/sidecar/grpc/reflection.ex similarity index 98% rename from spawn_proxy/proxy/lib/proxy/grpc/reflection.ex rename to lib/sidecar/grpc/reflection.ex index d934078b..198a439a 100644 --- a/spawn_proxy/proxy/lib/proxy/grpc/reflection.ex +++ b/lib/sidecar/grpc/reflection.ex @@ -1,4 +1,4 @@ -defmodule Proxy.Grpc.Reflection do +defmodule Sidecar.Grpc.Reflection do @moduledoc """ This module is responsible for handling all requests with a view to contract reflection (reflection.proto) @@ -94,7 +94,7 @@ defmodule Proxy.Grpc.Reflection do response end - {:reply, response, state} + {:reply, resp, state} end # Client API diff --git a/spawn_proxy/proxy/lib/proxy/grpc/reflection/service.ex b/lib/sidecar/grpc/reflection/service.ex similarity index 96% rename from spawn_proxy/proxy/lib/proxy/grpc/reflection/service.ex rename to lib/sidecar/grpc/reflection/service.ex index 1bad9c26..aaf846c8 100644 --- a/spawn_proxy/proxy/lib/proxy/grpc/reflection/service.ex +++ b/lib/sidecar/grpc/reflection/service.ex @@ -1,4 +1,4 @@ -defmodule Proxy.Grpc.Reflection.Service do +defmodule Sidecar.Grpc.Reflection.Service do @moduledoc """ This module implement gRPC Reflection """ diff --git a/lib/sidecar/grpc/service_resolver.ex b/lib/sidecar/grpc/service_resolver.ex new file mode 100644 index 00000000..7d2fab27 --- /dev/null +++ b/lib/sidecar/grpc/service_resolver.ex @@ -0,0 +1,5 @@ +defmodule Sidecar.Grpc.ServiceResolver do + @moduledoc """ + This module is redefined at runtime during application start. + """ +end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex similarity index 58% rename from spawn_proxy/proxy/lib/proxy/grpc/supervisor.ex rename to lib/sidecar/grpc/supervisor.ex index 9c27b932..b58e52fd 100644 --- a/spawn_proxy/proxy/lib/proxy/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -1,4 +1,4 @@ -defmodule Proxy.Grpc.Supervisor do +defmodule Sidecar.Grpc.Supervisor do @moduledoc false use Supervisor require Logger @@ -9,14 +9,16 @@ defmodule Proxy.Grpc.Supervisor do Logger.info("Starting gRPC Server...") Application.put_env(:grpc, :start_server, true, persistent: true) - descriptor = Keyword.fetch!(:file_descriptor) - actors = Keyword.fetch!(:actors) + # descriptor = Keyword.fetch!(:file_descriptor) + # actors = Keyword.fetch!(:actors) - children = - descriptor - |> GrpcGenerator.compile(actors) - |> GrpcGenerator.build_spec() - |> maybe_start_reflection(descriptor) + # children = + # descriptor + # |> GrpcGenerator.compile(actors) + # |> GrpcGenerator.build_spec() + # |> maybe_start_reflection(descriptor) + + children = [] Supervisor.init(children, strategy: :rest_for_one) end diff --git a/mix.exs b/mix.exs index ab9c5faf..d401b15c 100644 --- a/mix.exs +++ b/mix.exs @@ -76,6 +76,8 @@ defmodule Spawn.MixProject do {:telemetry, "~> 1.0"}, {:castore, "~> 1.0"}, {:protobuf, "~> 0.11"}, + {:protobuf_generate, "~> 0.1"}, + {:grpc, "~> 0.7"}, {:finch, "~> 0.16"}, {:retry, "~> 0.17"}, {:tesla, "~> 1.6"}, diff --git a/mix.lock b/mix.lock index 12b34f42..c016463a 100644 --- a/mix.lock +++ b/mix.lock @@ -19,7 +19,7 @@ "cloak": {:hex, :cloak, "1.1.2", "7e0006c2b0b98d976d4f559080fabefd81f0e0a50a3c4b621f85ceeb563e80bb", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "940d5ac4fcd51b252930fd112e319ea5ae6ab540b722f3ca60a85666759b9585"}, "cloak_ecto": {:hex, :cloak_ecto, "1.2.0", "e86a3df3bf0dc8980f70406bcb0af2858bac247d55494d40bc58a152590bd402", [:mix], [{:cloak, "~> 1.1.1", [hex: :cloak, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}], "hexpm", "8bcc677185c813fe64b786618bd6689b1707b35cd95acaae0834557b15a0c62f"}, "cloudevents": {:hex, :cloudevents, "0.6.1", "d3f467a615c00712cf3c9632f6d131695fd3e1d29c10477d2d2fbbec06350522", [:mix], [{:avrora, "~> 0.21", [hex: :avrora, repo: "hexpm", optional: true]}, {:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: false]}, {:typed_struct, "~> 0.3.0", [hex: :typed_struct, repo: "hexpm", optional: false]}], "hexpm", "f0055549bc651bd6702347328dd5824d3f08fbf308d2c7212252e34e345bcb9c"}, - "cowboy": {:hex, :cowboy, "2.10.0", "ff9ffeff91dae4ae270dd975642997afe2a1179d94b1887863e43f681a203e26", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "3afdccb7183cc6f143cb14d3cf51fa00e53db9ec80cdcd525482f5e99bc41d6b"}, + "cowboy": {:hex, :cowboy, "2.11.0", "356bf784599cf6f2cdc6ad12fdcfb8413c2d35dab58404cf000e1feaed3f5645", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "0fa395437f1b0e104e0e00999f39d2ac5f4082ac5049b67a5b6d56ecc31b1403"}, "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, "crc32cer": {:hex, :crc32cer, "0.1.8", "c6c2275c5fb60a95f4935d414f30b50ee9cfed494081c9b36ebb02edfc2f48db", [:rebar3], [], "hexpm", "251499085482920deb6c9b7aadabf9fb4c432f96add97ab42aee4501e5b6f591"}, "credentials_obfuscation": {:hex, :credentials_obfuscation, "3.4.0", "34e18b126b3aefd6e8143776fbe1ceceea6792307c99ac5ee8687911f048cfd7", [:rebar3], [], "hexpm", "738ace0ed5545d2710d3f7383906fc6f6b582d019036e5269c4dbd85dbced566"}, @@ -50,7 +50,7 @@ "gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"}, "gnat": {:hex, :gnat, "1.7.1", "491144f9c3aec00e9941d69538e2fd2836271e220315c8d2d87907c20ca7abc8", [:mix], [{:cowlib, "~> 2.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:nkeys, "~> 0.2", [hex: :nkeys, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a5629088d9bdb16d982eb48fd431cf6c5a71e9b026281781983501237ab5b911"}, "gproc": {:hex, :gproc, "0.8.0", "cea02c578589c61e5341fce149ea36ccef236cc2ecac8691fba408e7ea77ec2f", [:rebar3], [], "hexpm", "580adafa56463b75263ef5a5df4c86af321f68694e7786cb057fd805d1e2a7de"}, - "grpc": {:hex, :grpc, "0.5.0", "a44cb306625a52fa31a2189ce91b40d24e82569568f0cc214c1e1e0faf54f58a", [:mix], [{:cowboy, "~> 2.9", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.11", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0.1", [hex: :grpc_gun, repo: "hexpm", optional: false]}], "hexpm", "17b98593fdb1a65be7b2722821266627b3f2fba29bbbd7d0945389427c0d0d5f"}, + "grpc": {:hex, :grpc, "0.7.0", "a86eab356b0b84406b526786a947ca50e9b9eae87108c873b51e321f8a71e8ed", [:mix], [{:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "632a9507da8d3c12b112b197db4d60da3c95bad02594d37711eeb622d032f254"}, "grpcbox": {:hex, :grpcbox, "0.16.0", "b83f37c62d6eeca347b77f9b1ec7e9f62231690cdfeb3a31be07cd4002ba9c82", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.13.0", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.8.0", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "294df743ae20a7e030889f00644001370a4f7ce0121f3bbdaf13cf3169c62913"}, "gun": {:hex, :gun, "2.0.1", "160a9a5394800fcba41bc7e6d421295cf9a7894c2252c0678244948e3336ad73", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "a10bc8d6096b9502205022334f719cc9a08d9adcfbfc0dbee9ef31b56274a20b"}, "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, @@ -102,6 +102,7 @@ "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, "postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"}, "protobuf": {:hex, :protobuf, "0.12.0", "58c0dfea5f929b96b5aa54ec02b7130688f09d2de5ddc521d696eec2a015b223", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "75fa6cbf262062073dd51be44dd0ab940500e18386a6c4e87d5819a58964dc45"}, + "protobuf_generate": {:hex, :protobuf_generate, "0.1.1", "f6098b85161dcfd48a4f6f1abee4ee5e057981dfc50aafb1aa4bd5b0529aa89b", [:mix], [{:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "93a38c8e2aba2a17e293e9ef1359122741f717103984aa6d1ebdca0efb17ab9d"}, "rabbit_common": {:hex, :rabbit_common, "3.12.2", "fa46f2954f6f5e28d69afdefb10f15c4782402411fac743bc2459a07dcf83b4c", [:make, :rebar3], [{:credentials_obfuscation, "3.4.0", [hex: :credentials_obfuscation, repo: "hexpm", optional: false]}, {:recon, "2.5.3", [hex: :recon, repo: "hexpm", optional: false]}, {:thoas, "1.0.0", [hex: :thoas, repo: "hexpm", optional: false]}], "hexpm", "33fe4eb510b1e72a2734b9c3d081f76059a07ed7d76c9b9403276af9d5afc1b1"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, "recon": {:hex, :recon, "2.5.3", "739107b9050ea683c30e96de050bc59248fd27ec147696f79a8797ff9fa17153", [:mix, :rebar3], [], "hexpm", "6c6683f46fd4a1dfd98404b9f78dcabc7fcd8826613a89dcb984727a8c3099d7"}, diff --git a/priv/protos/google/api/annotations.proto b/priv/protos/google/api/annotations.proto new file mode 100644 index 00000000..efdab3db --- /dev/null +++ b/priv/protos/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/priv/protos/google/api/http.proto b/priv/protos/google/api/http.proto new file mode 100644 index 00000000..113fa936 --- /dev/null +++ b/priv/protos/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/priv/protos/google/protobuf/descriptor.proto b/priv/protos/google/protobuf/descriptor.proto new file mode 100644 index 00000000..6805b9b4 --- /dev/null +++ b/priv/protos/google/protobuf/descriptor.proto @@ -0,0 +1,1223 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// The full set of known editions. +enum Edition { + // A placeholder for an unknown edition value. + EDITION_UNKNOWN = 0; + + // Legacy syntax "editions". These pre-date editions, but behave much like + // distinct editions. These can't be used to specify the edition of proto + // files, but feature definitions must supply proto2/proto3 defaults for + // backwards compatibility. + EDITION_PROTO2 = 998; + EDITION_PROTO3 = 999; + + // Editions that have been released. The specific values are arbitrary and + // should not be depended on, but they will always be time-ordered for easy + // comparison. + EDITION_2023 = 1000; + EDITION_2024 = 1001; + + // Placeholder editions for testing feature resolution. These should not be + // used or relyed on outside of tests. + EDITION_1_TEST_ONLY = 1; + EDITION_2_TEST_ONLY = 2; + EDITION_99997_TEST_ONLY = 99997; + EDITION_99998_TEST_ONLY = 99998; + EDITION_99999_TEST_ONLY = 99999; + + // Placeholder for specifying unbounded edition support. This should only + // ever be used by plugins that can expect to never require any changes to + // support a new edition. + EDITION_MAX = 0x7FFFFFFF; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2", "proto3", and "editions". + // + // If `edition` is present, this value must be "editions". + optional string syntax = 12; + + // The edition of the proto file. + optional Edition edition = 14; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + message Declaration { + // The extension number declared within the extension range. + optional int32 number = 1; + + // The fully-qualified name of the extension field. There must be a leading + // dot in front of the full name. + optional string full_name = 2; + + // The fully-qualified type name of the extension field. Unlike + // Metadata.type, Declaration.type must have a leading dot for messages + // and enums. + optional string type = 3; + + // If true, indicates that the number is reserved in the extension range, + // and any extension field with the number will fail to compile. Set this + // when a declared extension field is deleted. + optional bool reserved = 5; + + // If true, indicates that the extension must be defined as repeated. + // Otherwise the extension must be defined as optional. + optional bool repeated = 6; + + reserved 4; // removed is_repeated + } + + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. + repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The verification state of the extension range. + enum VerificationState { + // All the extensions of the range must be declared. + DECLARATION = 0; + UNVERIFIED = 1; + } + + // The verification state of the range. + // TODO: flip the default to DECLARATION once all empty ranges + // are marked as UNVERIFIED. + optional VerificationState verification = 3 + [default = UNVERIFIED, retention = RETENTION_SOURCE]; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported after google.protobuf. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. In Editions, the group wire format + // can be enabled via the `message_encoding` feature. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REPEATED = 3; + // The required label is only allowed in google.protobuf. In proto3 and Editions + // it's explicitly prohibited. In Editions, the `field_presence` feature + // can be used to get this behavior. + LABEL_REQUIRED = 2; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must belong to a oneof to signal + // to old proto3 clients that presence is tracked for this field. This oneof + // is known as a "synthetic" oneof, and this field must be its sole member + // (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + // exist in the descriptor only, and do not generate any API. Synthetic oneofs + // must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. + optional string java_outer_classname = 8; + + // If enabled, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // A proto2 file can set this to true to opt in to UTF-8 checking for Java, + // which will throw an exception if invalid UTF-8 is parsed from the wire or + // assigned to a string field. + // + // TODO: clarify exactly what kinds of field types this option + // applies to, and update these docs accordingly. + // + // Proto3 files already perform these checks. Setting the option explicitly to + // false has no effect: it cannot be used to opt proto3 files out of UTF-8 + // checks. + optional bool java_string_check_utf8 = 27 [default = false]; + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + reserved 42; // removed php_generic_services + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // + // This should only be used as a temporary measure against broken builds due + // to the change in behavior for JSON field name conflicts. + // + // TODO This is legacy behavior we plan to remove once downstream + // teams have had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + + // Any features defined in the specific edition. + optional FeatureSet features = 12; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is only implemented to support use of + // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + // type "bytes" in the open source release -- sorry, we'll try to include + // other types in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + // The option [ctype=CORD] may be applied to a non-repeated field of type + // "bytes". It indicates that in C++, the data should be stored in a Cord + // instead of a string. For very large strings, this may reduce memory + // fragmentation. It may also allow better performance when parsing from a + // Cord, or when parsing with aliasing enabled, as the parsed Cord may then + // alias the original buffer. + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. This option is prohibited in + // Editions, but the `repeated_field_encoding` feature can be used to control + // the behavior. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // Note that lazy message fields are still eagerly verified to check + // ill-formed wireformat or missing required fields. Calling IsInitialized() + // on the outer message would fail if the inner message has missing required + // fields. Failed verification would result in parsing failure (except when + // uninitialized messages are acceptable). + optional bool lazy = 5 [default = false]; + + // unverified_lazy does no correctness checks on the byte stream. This should + // only be used where lazy with verification is prohibitive for performance + // reasons. + optional bool unverified_lazy = 15 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + // Indicate that the field value should not be printed out when using debug + // formats, e.g. when the field contains sensitive credentials. + optional bool debug_redact = 16 [default = false]; + + // If set to RETENTION_SOURCE, the option will be omitted from the binary. + // Note: as of January 2023, support for this is in progress and does not yet + // have an effect (b/264593489). + enum OptionRetention { + RETENTION_UNKNOWN = 0; + RETENTION_RUNTIME = 1; + RETENTION_SOURCE = 2; + } + + optional OptionRetention retention = 17; + + // This indicates the types of entities that the field may apply to when used + // as an option. If it is unset, then the field may be freely used as an + // option on any kind of entity. Note: as of January 2023, support for this is + // in progress and does not yet have an effect (b/264593489). + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0; + TARGET_TYPE_FILE = 1; + TARGET_TYPE_EXTENSION_RANGE = 2; + TARGET_TYPE_MESSAGE = 3; + TARGET_TYPE_FIELD = 4; + TARGET_TYPE_ONEOF = 5; + TARGET_TYPE_ENUM = 6; + TARGET_TYPE_ENUM_ENTRY = 7; + TARGET_TYPE_SERVICE = 8; + TARGET_TYPE_METHOD = 9; + } + + repeated OptionTargetType targets = 19; + + message EditionDefault { + optional Edition edition = 3; + optional string value = 2; // Textproto value. + } + repeated EditionDefault edition_defaults = 20; + + // Any features defined in the specific edition. + optional FeatureSet features = 21; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype + reserved 18; // reserve target, target_obsolete_do_not_use +} + +message OneofOptions { + // Any features defined in the specific edition. + optional FeatureSet features = 1; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // TODO Remove this legacy behavior once downstream teams have + // had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + + // Any features defined in the specific edition. + optional FeatureSet features = 7; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // Any features defined in the specific edition. + optional FeatureSet features = 2; + + // Indicate that fields annotated with this enum value should not be printed + // out when using debug formats, e.g. when the field contains sensitive + // credentials. + optional bool debug_redact = 3 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Any features defined in the specific edition. + optional FeatureSet features = 34; + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // Any features defined in the specific edition. + optional FeatureSet features = 35; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + // "foo.(bar.baz).moo". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Features + +// TODO Enums in C++ gencode (and potentially other languages) are +// not well scoped. This means that each of the feature enums below can clash +// with each other. The short names we've chosen maximize call-site +// readability, but leave us very open to this scenario. A future feature will +// be designed and implemented to handle this, hopefully before we ever hit a +// conflict here. +message FeatureSet { + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0; + EXPLICIT = 1; + IMPLICIT = 2; + LEGACY_REQUIRED = 3; + } + optional FieldPresence field_presence = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, + edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } + ]; + + enum EnumType { + ENUM_TYPE_UNKNOWN = 0; + OPEN = 1; + CLOSED = 2; + } + optional EnumType enum_type = 2 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" } + ]; + + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0; + PACKED = 1; + EXPANDED = 2; + } + optional RepeatedFieldEncoding repeated_field_encoding = 3 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" } + ]; + + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0; + VERIFY = 2; + NONE = 3; + } + optional Utf8Validation utf8_validation = 4 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "NONE" }, + edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" } + ]; + + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0; + LENGTH_PREFIXED = 1; + DELIMITED = 2; + } + optional MessageEncoding message_encoding = 5 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" } + ]; + + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0; + ALLOW = 1; + LEGACY_BEST_EFFORT = 2; + } + optional JsonFormat json_format = 6 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" } + ]; + + reserved 999; + + extensions 1000; // for Protobuf C++ + extensions 1001; // for Protobuf Java + extensions 1002; // for Protobuf Go + + extensions 9995 to 9999; // For internal testing + extensions 10000; // for https://github.com/bufbuild/protobuf-es +} + +// A compiled specification for the defaults of a set of features. These +// messages are generated from FeatureSet extensions and can be used to seed +// feature resolution. The resolution with this object becomes a simple search +// for the closest matching edition, followed by proto merges. +message FeatureSetDefaults { + // A map from every known edition with a unique set of defaults to its + // defaults. Not all editions may be contained here. For a given edition, + // the defaults at the closest matching edition ordered at or before it should + // be used. This field must be in strict ascending order by edition. + message FeatureSetEditionDefault { + optional Edition edition = 3; + optional FeatureSet features = 2; + } + repeated FeatureSetEditionDefault defaults = 1; + + // The minimum supported edition (inclusive) when this was constructed. + // Editions before this will not have defaults. + optional Edition minimum_edition = 4; + + // The maximum known edition (inclusive) when this was constructed. Editions + // after this will not have reliable defaults. + optional Edition maximum_edition = 5; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition appears. + // For example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to moo. + // // + // // Another line attached to moo. + // optional double moo = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to moo or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified object. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + + // Represents the identified object's effect on the element in the original + // .proto file. + enum Semantic { + // There is no effect or the effect is indescribable. + NONE = 0; + // The element is set or otherwise mutated. + SET = 1; + // An alias to the element is returned. + ALIAS = 2; + } + optional Semantic semantic = 5; + } +} diff --git a/priv/protos/google/protobuf/timestamp.proto b/priv/protos/google/protobuf/timestamp.proto new file mode 100644 index 00000000..184a18f8 --- /dev/null +++ b/priv/protos/google/protobuf/timestamp.proto @@ -0,0 +1,144 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/priv/protos/helloworld.proto b/priv/protos/helloworld.proto new file mode 100644 index 00000000..47aa9793 --- /dev/null +++ b/priv/protos/helloworld.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "io.grpc.examples.helloworld"; +option java_outer_classname = "HelloWorldProto"; +option objc_class_prefix = "HLW"; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +package helloworld; + +// The greeting service definition. +service GreeterService { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply) { + option (google.api.http) = { + get: "/v1/greeter/{name}" + }; + } + + rpc SayHelloFrom (HelloRequestFrom) returns (HelloReply) { + option (google.api.http) = { + post: "/v1/greeter" + body: "*" + }; + } +} + +// The request message containing the user's name. +message HelloRequest { + string name = 1; +} + +// HelloRequestFrom! +message HelloRequestFrom { + // Name! + string name = 1; + // From! + string from = 2; +} + +// The response message containing the greetings +message HelloReply { + string message = 1; + google.protobuf.Timestamp today = 2; +} diff --git a/priv/protos/modules/helloworld.pb.ex b/priv/protos/modules/helloworld.pb.ex new file mode 100644 index 00000000..7e7e7986 --- /dev/null +++ b/priv/protos/modules/helloworld.pb.ex @@ -0,0 +1,822 @@ +defmodule Helloworld.HelloRequest do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "HelloRequest", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :name, 1, type: :string +end + +defmodule Helloworld.HelloRequestFrom do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "HelloRequestFrom", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "from", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "from", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :name, 1, type: :string + field :from, 2, type: :string +end + +defmodule Helloworld.HelloReply do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "HelloReply", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "message", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "message", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "today", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "today", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :message, 1, type: :string + field :today, 2, type: Google.Protobuf.Timestamp +end + +defmodule Helloworld.GreeterService.Service do + @moduledoc false + use GRPC.Service, name: "helloworld.GreeterService", protoc_gen_elixir_version: "0.12.0" + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.FileDescriptorProto{ + name: "helloworld.proto", + package: "helloworld", + dependency: ["google/api/annotations.proto", "google/protobuf/timestamp.proto"], + message_type: [ + %Google.Protobuf.DescriptorProto{ + name: "HelloRequest", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + }, + %Google.Protobuf.DescriptorProto{ + name: "HelloRequestFrom", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "from", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "from", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + }, + %Google.Protobuf.DescriptorProto{ + name: "HelloReply", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "message", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "message", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "today", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "today", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + ], + enum_type: [], + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "GreeterService", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "SayHello", + input_type: ".helloworld.HelloRequest", + output_type: ".helloworld.HelloReply", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [ + {72_295_728, 2, + <<18, 18, 47, 118, 49, 47, 103, 114, 101, 101, 116, 101, 114, 47, 123, 110, 97, + 109, 101, 125>>} + ] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + }, + %Google.Protobuf.MethodDescriptorProto{ + name: "SayHelloFrom", + input_type: ".helloworld.HelloRequestFrom", + output_type: ".helloworld.HelloReply", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [ + {72_295_728, 2, + <<34, 11, 47, 118, 49, 47, 103, 114, 101, 101, 116, 101, 114, 58, 1, 42>>} + ] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + } + ], + options: nil, + __unknown_fields__: [] + } + ], + extension: [], + options: %Google.Protobuf.FileOptions{ + java_package: "io.grpc.examples.helloworld", + java_outer_classname: "HelloWorldProto", + optimize_for: :SPEED, + java_multiple_files: true, + go_package: nil, + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + java_generate_equals_and_hash: nil, + deprecated: false, + java_string_check_utf8: false, + cc_enable_arenas: true, + objc_class_prefix: "HLW", + csharp_namespace: nil, + swift_prefix: nil, + php_class_prefix: nil, + php_namespace: nil, + php_generic_services: false, + php_metadata_namespace: nil, + ruby_package: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] + }, + source_code_info: %Google.Protobuf.SourceCodeInfo{ + location: [ + %Google.Protobuf.SourceCodeInfo.Location{ + path: [], + span: [0, 0, 46, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: '\f', + span: [0, 0, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: '\b', + span: [2, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: '\b\n', + span: [2, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: '\b', + span: [3, 0, 52], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [8, 1], + span: [3, 0, 52], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: '\b', + span: [4, 0, 48], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: '\b\b', + span: [4, 0, 48], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: '\b', + span: [5, 0, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: '\b$', + span: [5, 0, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 0], + span: [7, 0, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 1], + span: [8, 0, 41], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [2], + span: [10, 0, 19], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0], + span: [13, 0, 27, 1], + leading_comments: " The greeting service definition.\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 1], + span: [13, 8, 22], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0], + span: [15, 2, 19, 3], + leading_comments: " Sends a greeting\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 1], + span: [15, 6, 14], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 2], + span: [15, 16, 28], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 3], + span: [15, 39, 49], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4], + span: [16, 4, 18, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4, 72_295_728], + span: [16, 4, 18, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1], + span: [21, 2, 26, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 1], + span: [21, 6, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 2], + span: [21, 20, 36], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 3], + span: [21, 47, 57], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4], + span: [22, 4, 25, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4, 72_295_728], + span: [22, 4, 25, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0], + span: [30, 0, 32, 1], + leading_comments: " The request message containing the user's name.\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 1], + span: [30, 8, 20], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0], + span: [31, 2, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 5], + span: [31, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 1], + span: [31, 9, 13], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 3], + span: [31, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1], + span: [35, 0, 40, 1], + leading_comments: " HelloRequestFrom!\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 1], + span: [35, 8, 24], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0], + span: [37, 2, 18], + leading_comments: " Name!\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 5], + span: [37, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 1], + span: '%\t\r', + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 3], + span: [37, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 1], + span: [39, 2, 18], + leading_comments: " From!\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 1, 5], + span: [39, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 1, 1], + span: '\'\t\r', + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 1, 3], + span: [39, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2], + span: [43, 0, 46, 1], + leading_comments: " The response message containing the greetings\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 1], + span: [43, 8, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0], + span: [44, 2, 21], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 5], + span: [44, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 1], + span: [44, 9, 16], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 3], + span: [44, 19, 20], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1], + span: [45, 2, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 6], + span: [45, 2, 27], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 1], + span: [45, 28, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 3], + span: '-$%', + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + } + ], + __unknown_fields__: [] + }, + public_dependency: [], + weak_dependency: [], + syntax: "proto3", + edition: nil, + __unknown_fields__: [] + } + end + + rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply, %{}) + + rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply, %{}) +end + +defmodule Helloworld.GreeterService.ActorDispatcher do + @moduledoc since: "1.2.1" + use GRPC.Server, service: Helloworld.GreeterService, http_transcode: true + + alias Sidecar.Grpc.Dispatcher + + @spec say_hello(Helloworld.HelloRequest.t(), GRPC.Server.Stream.t()) :: + Helloworld.HelloReply.t() + def say_hello(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "GreeterService", + action_name: "SayHello", + input: message, + stream: stream, + descriptor: Helloworld.GreeterService.Service.descriptor() + } + + Dispatcher.dispatch(request) + end + + @spec say_hello_from(Helloworld.HelloRequestFrom.t(), GRPC.Server.Stream.t()) :: + Helloworld.HelloReply.t() + def say_hello_from(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "GreeterService", + action_name: "SayHelloFrom", + input: message, + stream: stream, + descriptor: Helloworld.GreeterService.Service.descriptor() + } + + Dispatcher.dispatch(request) + end +end \ No newline at end of file diff --git a/spawn_proxy/proxy/lib/proxy/grpc/code_generator.ex b/spawn_proxy/proxy/lib/proxy/grpc/code_generator.ex deleted file mode 100644 index 5c44b9fd..00000000 --- a/spawn_proxy/proxy/lib/proxy/grpc/code_generator.ex +++ /dev/null @@ -1,157 +0,0 @@ -defmodule Proxy.Grpc.CodeGenerator do - @moduledoc """ - TODO - """ - - alias Proxy.Grpc.Parser - - def compile(descriptors, actors) do - with {:ok, descriptors} <- descriptors |> compile(), - {:ok, _} <- generate_services(actors), - {:ok, _} <- generate_endpoints(actors) do - {:ok, descriptors, actors} - else - _ -> - {:error, descriptors, actors} - end - end - - def build_spec({:ok, descriptors, actors} = _metadata) do - end - - def build_spec({:error, _, _} = _metadata) do - raise ArgumentError, "Fail to compile protobuf files" - end - - defp compile(descriptors) do - files = - descriptors - |> Parser.prepare() - - for {name, file} <- files do - case do_compile(file) do - modules when is_list(modules) -> - Logger.debug("The #{name} descriptor has been compiled!") - - error -> - Logger.warning("Fail to compile descriptor #{name}. Details: #{inspect(error)}") - end - end - - {:ok, descriptors} - end - - defp generate_services(entities) do - root_template_path = - Application.get_env( - :massa_proxy, - :proxy_root_template_path, - :code.priv_dir(:massa_proxy) - ) - - grpc_template_path = - Path.expand( - "./templates/grpc_service.ex.eex", - root_template_path - ) - - for entity <- entities do - name = Enum.join([normalize_service_name(entity.service_name), "Service"], ".") - - Stream.map(entity.services, fn service -> - methods = - service.methods - |> Flow.from_enumerable() - |> Flow.map(&normalize_method_name(&1.name)) - |> Enum.to_list() - - Logger.info("Generating Service #{name} with Methods: #{inspect(methods)}") - - original_methods = get_method_names(service) - input_types = get_input_type(service) - output_types = get_output_type(service) - request_types = get_request_type(service) - - mod = - get_module( - grpc_template_path, - mod_name: name, - name: name, - methods: methods, - original_methods: original_methods, - handler: "MassaProxy.Runtime.Grpc.Server.Dispatcher", - entity_type: entity.entity_type, - persistence_id: entity.persistence_id, - service_name: entity.service_name, - input_types: input_types, - output_types: output_types, - request_types: request_types - ) - - Logger.debug("Service Definition:\n#{mod}") - do_compile(mod) - Logger.debug("Service compilation finish!") - end) - |> Stream.run() - end - - {:ok, entities} - end - - defp generate_endpoints(entities) do - root_template_path = - Application.get_env( - :massa_proxy, - :proxy_root_template_path, - :code.priv_dir(:massa_proxy) - ) - - grpc_endpoint_template_path = - Path.expand( - "./templates/grpc_endpoint.ex.eex", - root_template_path - ) - - services = - entities - |> Flow.from_enumerable() - |> Flow.map( - &Enum.join([normalize_service_name(&1.service_name), "Service.ProxyService"], ".") - ) - |> Enum.to_list() - - mod = - get_module( - grpc_endpoint_template_path, - service_names: services - ) - - Logger.debug("Endpoint Definition:\n#{mod}") - do_compile(mod) - Logger.debug("Endpoint compilation finish!") - - {:ok, entities} - end - - defp do_compile(file) do - Code.compile_string(file) - rescue - error in UndefinedFunctionError -> - Logger.error("Error in Module definition. Make sure the service name is correct") - raise error - - error -> - Logger.error("Error during Service compilation phase #{inspect(error)}") - end - - defp normalize_service_name(name) do - name - |> String.split(".") - |> Stream.map(&Macro.camelize(&1)) - |> Enum.join(".") - end - - defp normalize_method_name(name), do: Macro.underscore(name) - - defp get_module(filename, bindings \\ []), do: EEx.eval_file(filename, bindings) -end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/parser.ex b/spawn_proxy/proxy/lib/proxy/grpc/parser.ex deleted file mode 100644 index b1b1ca3f..00000000 --- a/spawn_proxy/proxy/lib/proxy/grpc/parser.ex +++ /dev/null @@ -1,95 +0,0 @@ -defmodule Proxy.Grpc.Parser do - @moduledoc false - require Logger - - def prepare(file_descriptor) do - ctx = - %Protobuf.Protoc.Context{gen_descriptors?: true, plugins: ["grpc"]} - |> find_types(file_descriptor) - - file_descriptor - |> Stream.map(fn desc -> - {desc.name, Proxy.Grpc.ProtoUtil.generate_content(ctx, desc)} - end) - |> Enum.to_list() - end - - @doc false - def find_types(ctx, descs) do - find_types(ctx, descs, %{}) - end - - @doc false - def find_types(ctx, [], acc) do - %{ctx | global_type_mapping: acc} - end - - def find_types(ctx, [desc | t], acc) do - types = find_types_in_proto(desc) - find_types(ctx, t, Map.put(acc, desc.name, types)) - end - - @doc false - def find_types_in_proto(%Google.Protobuf.FileDescriptorProto{} = desc) do - desc_ctx = %Protobuf.Protoc.Context{ - package: desc.package, - namespace: [] - } - - ctx = %{desc_ctx | module_prefix: desc_ctx.package || ""} - - %{} - |> find_types_in_proto(ctx, desc.message_type) - |> find_types_in_proto(ctx, desc.enum_type) - end - - defp find_types_in_proto(types, ctx, descs) when is_list(descs) do - Enum.reduce(descs, types, fn desc, acc -> - find_types_in_proto(acc, ctx, desc) - end) - end - - defp find_types_in_proto(types, ctx, %Google.Protobuf.DescriptorProto{name: name} = desc) do - new_ctx = append_ns(ctx, name) - - types - |> update_types(ctx, name) - |> find_types_in_proto(new_ctx, desc.enum_type) - |> find_types_in_proto(new_ctx, desc.nested_type) - end - - defp find_types_in_proto(types, ctx, %Google.Protobuf.EnumDescriptorProto{name: name}) do - update_types(types, ctx, name) - end - - defp append_ns(%{namespace: ns} = ctx, name) do - new_ns = ns ++ [name] - Map.put(ctx, :namespace, new_ns) - end - - defp update_types(types, %{namespace: ns, package: pkg, module_prefix: prefix}, name) do - type_name = - join_names(prefix || pkg, ns, name) - |> normalize_type_name() - - Map.put(types, "." <> join_names(pkg, ns, name), %{type_name: type_name}) - end - - defp join_names(pkg, ns, name) do - ns_str = Enum.join(ns, ".") - - [pkg, ns_str, name] - |> Enum.filter(&(&1 && &1 != "")) - |> Enum.join(".") - end - - defp normalize_type_name(name) do - name - |> String.split(".") - |> Enum.map_join(".", &trans_name/1) - end - - defp trans_name(name) do - Macro.camelize(name) - end -end diff --git a/spawn_proxy/proxy/lib/proxy/grpc/proto_util.ex b/spawn_proxy/proxy/lib/proxy/grpc/proto_util.ex deleted file mode 100644 index 0bbb0589..00000000 --- a/spawn_proxy/proxy/lib/proxy/grpc/proto_util.ex +++ /dev/null @@ -1,82 +0,0 @@ -defmodule Proxy.Grpc.ProtoUtil do - @moduledoc false - require Logger - - alias Protobuf.Protoc.Generator.Message, as: MessageGenerator - alias Protobuf.Protoc.Generator.Enum, as: EnumGenerator - alias Protobuf.Protoc.Generator.Service, as: ServiceGenerator - alias Protobuf.Protoc.Generator.Extension, as: ExtensionGenerator - - @locals_without_parens [field: 2, field: 3, oneof: 2, rpc: 3, extend: 4, extensions: 1] - - @spec generate_content(Context.t(), Google.Protobuf.FileDescriptorProto.t()) :: String.t() - def generate_content(ctx, desc) do - ctx = %{ - ctx - | package: desc.package || "", - syntax: syntax(desc.syntax), - dep_type_mapping: get_dep_type_mapping(ctx, desc.dependency, desc.name) - } - - ctx = Map.put(ctx, :module_prefix, ctx.package || "") - ctx = Protobuf.Protoc.Context.custom_file_options_from_file_desc(ctx, desc) - {enums, msgs} = MessageGenerator.generate_list(ctx, desc.message_type) - - list = - enums ++ - Enum.map(desc.enum_type, fn d -> EnumGenerator.generate(ctx, d) end) ++ - msgs ++ - if Enum.member?(ctx.plugins, "grpc") do - Enum.map(desc.service, fn d -> ServiceGenerator.generate(ctx, d) end) - end - - nested_extensions = - ExtensionGenerator.get_nested_extensions(ctx, desc.message_type) - |> Enum.reverse() - - list = list ++ [ExtensionGenerator.generate(ctx, desc, nested_extensions)] - - list - |> List.flatten() - |> Enum.filter(&(!is_nil(&1))) - |> Enum.map(fn {_, v} -> v end) - |> Enum.join("\n") - |> format_code() - end - - @doc false - def get_dep_pkgs(%{pkg_mapping: mapping, package: pkg}, deps) do - pkgs = deps |> Enum.map(fn dep -> mapping[dep] end) - pkgs = if pkg && String.length(pkg) > 0, do: [pkg | pkgs], else: pkgs - Enum.sort(pkgs, &(byte_size(&2) <= byte_size(&1))) - end - - def get_dep_type_mapping(%{global_type_mapping: global_mapping}, deps, file_name) do - mapping = - Enum.reduce(deps, %{}, fn dep, acc -> - Map.merge(acc, global_mapping[dep]) - end) - - Map.merge(mapping, global_mapping[file_name]) - end - - defp syntax("proto3"), do: :proto3 - defp syntax(_), do: :proto2 - - def format_code(code) do - formatted = - if Code.ensure_loaded?(Code) && function_exported?(Code, :format_string!, 2) do - code - |> Code.format_string!(locals_without_parens: @locals_without_parens) - |> IO.iodata_to_binary() - else - code - end - - if formatted == "" do - formatted - else - formatted <> "\n" - end - end -end diff --git a/spawn_proxy/proxy/mix.exs b/spawn_proxy/proxy/mix.exs index 52f38408..50837baf 100644 --- a/spawn_proxy/proxy/mix.exs +++ b/spawn_proxy/proxy/mix.exs @@ -32,7 +32,6 @@ defmodule Proxy.MixProject do {:spawn, path: "../../"}, {:bakeware, "~> 0.2"}, {:bandit, "~> 1.1"}, - {:grpc, "~> 0.7"}, {:observer_cli, "~> 1.7"}, {:sobelow, "~> 0.13", only: [:dev, :test], runtime: false} ] From 06a6c612cb3ebc63aa71b5641000ad40a3fa6f9f Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sat, 17 Feb 2024 19:26:05 -0300 Subject: [PATCH 04/48] Guarantees that all Well-Known types will be available at runtime --- priv/protos/google/protobuf/api.proto | 207 +++++++++++++++ priv/protos/google/protobuf/duration.proto | 115 ++++++++ priv/protos/google/protobuf/empty.proto | 51 ++++ priv/protos/google/protobuf/field_mask.proto | 245 ++++++++++++++++++ .../google/protobuf/source_context.proto | 48 ++++ priv/protos/google/protobuf/struct.proto | 95 +++++++ priv/protos/google/protobuf/type.proto | 193 ++++++++++++++ priv/protos/google/protobuf/wrappers.proto | 123 +++++++++ 8 files changed, 1077 insertions(+) create mode 100644 priv/protos/google/protobuf/api.proto create mode 100644 priv/protos/google/protobuf/duration.proto create mode 100644 priv/protos/google/protobuf/empty.proto create mode 100644 priv/protos/google/protobuf/field_mask.proto create mode 100644 priv/protos/google/protobuf/source_context.proto create mode 100644 priv/protos/google/protobuf/struct.proto create mode 100644 priv/protos/google/protobuf/type.proto create mode 100644 priv/protos/google/protobuf/wrappers.proto diff --git a/priv/protos/google/protobuf/api.proto b/priv/protos/google/protobuf/api.proto new file mode 100644 index 00000000..13d287ca --- /dev/null +++ b/priv/protos/google/protobuf/api.proto @@ -0,0 +1,207 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/apipb"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inherting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} \ No newline at end of file diff --git a/priv/protos/google/protobuf/duration.proto b/priv/protos/google/protobuf/duration.proto new file mode 100644 index 00000000..a0d91df0 --- /dev/null +++ b/priv/protos/google/protobuf/duration.proto @@ -0,0 +1,115 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/durationpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/priv/protos/google/protobuf/empty.proto b/priv/protos/google/protobuf/empty.proto new file mode 100644 index 00000000..22274621 --- /dev/null +++ b/priv/protos/google/protobuf/empty.proto @@ -0,0 +1,51 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/emptypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +message Empty {} diff --git a/priv/protos/google/protobuf/field_mask.proto b/priv/protos/google/protobuf/field_mask.proto new file mode 100644 index 00000000..fbdda56e --- /dev/null +++ b/priv/protos/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} \ No newline at end of file diff --git a/priv/protos/google/protobuf/source_context.proto b/priv/protos/google/protobuf/source_context.proto new file mode 100644 index 00000000..fe5415a4 --- /dev/null +++ b/priv/protos/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} \ No newline at end of file diff --git a/priv/protos/google/protobuf/struct.proto b/priv/protos/google/protobuf/struct.proto new file mode 100644 index 00000000..e07e3435 --- /dev/null +++ b/priv/protos/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of these +// variants. Absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} \ No newline at end of file diff --git a/priv/protos/google/protobuf/type.proto b/priv/protos/google/protobuf/type.proto new file mode 100644 index 00000000..ae720d48 --- /dev/null +++ b/priv/protos/google/protobuf/type.proto @@ -0,0 +1,193 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/typepb"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 7; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + } + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 6; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; + // Syntax `editions`. + SYNTAX_EDITIONS = 2; +} \ No newline at end of file diff --git a/priv/protos/google/protobuf/wrappers.proto b/priv/protos/google/protobuf/wrappers.proto new file mode 100644 index 00000000..6c4b5ac6 --- /dev/null +++ b/priv/protos/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} \ No newline at end of file From a69ced2dd6413ead61ee78cc551b6f8877444e74 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sat, 17 Feb 2024 19:26:32 -0300 Subject: [PATCH 05/48] Generate and compile Elixir modules --- lib/sidecar/grpc/code_generator.ex | 36 +-- lib/sidecar/grpc/dispatcher.ex | 4 +- .../grpc/generators/handler_generator.ex | 13 +- .../handler_transcoding_generator.ex | 13 +- .../grpc/generators/service_generator.ex | 37 +-- .../generators/service_resolver_generator.ex | 8 +- lib/sidecar/grpc/reflection.ex | 214 ------------------ lib/sidecar/grpc/reflection/service.ex | 45 ---- lib/sidecar/grpc/service_resolver.ex | 2 +- lib/sidecar/grpc/supervisor.ex | 23 +- priv/protos/modules/helloworld.pb.ex | 23 +- 11 files changed, 77 insertions(+), 341 deletions(-) delete mode 100644 lib/sidecar/grpc/reflection.ex delete mode 100644 lib/sidecar/grpc/reflection/service.ex diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 5d56e8ed..9225bc89 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -1,4 +1,4 @@ -defmodule Sidecar.Grpc.CodeGenerator do +defmodule Sidecar.GRPC.CodeGenerator do @moduledoc """ Module for generating gRPC code from Protobuf files. @@ -37,9 +37,9 @@ defmodule Sidecar.Grpc.CodeGenerator do {grpc_generator_plugin, handler_generator_plugin} = if transcoding_enabled? do {ProtobufGenerate.Plugins.GRPCWithOptions, - Sidecar.Grpc.Generators.HandlerTranscodingGenerator} + Sidecar.GRPC.Generators.HandlerTranscodingGenerator} else - {ProtobufGenerate.Plugins.GRPC, Sidecar.Grpc.Generators.HandlerGenerator} + {ProtobufGenerate.Plugins.GRPC, Sidecar.GRPC.Generators.HandlerGenerator} end user_defined_proto_files = @@ -54,13 +54,24 @@ defmodule Sidecar.Grpc.CodeGenerator do "--output-path=#{output_path}", "--plugins=#{grpc_generator_plugin}", "--plugins=#{handler_generator_plugin}", - # "--plugins=Sidecar.Grpc.Generators.ServiceGenerator", + "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", "#{include_path}/#{user_defined_proto_files}" ] _ = Generate.run(protoc_options) end + def load_modules(opts) do + path = Keyword.get(opts, :output_path, "#{File.cwd!()}/priv/protos/modules") + + user_defined_modules_files = list_files_with_extension(path, ".pb.ex") + + Enum.map(user_defined_modules_files, fn file -> + full_path = Path.join(path, file) + File.read!(full_path) + end) + end + @doc """ Compiles an Elixir module generated from Protobuf files and returns the compiled code. @@ -75,14 +86,16 @@ defmodule Sidecar.Grpc.CodeGenerator do ### Example: ```elixir - module_code = Sidecar.Grpc.CodeGenerator.compile_module(generated_code) + module_code = Sidecar.Grpc.CodeGenerator.compile_modules(generated_code) Raises: Raises an error if there are issues during the compilation process. """ - def compile_module(module), do: do_compile(module) + def compile_modules(modules) when is_list(modules), do: Enum.each(modules, &do_compile/1) + + def compile_modules(module), do: do_compile(module) defp do_compile(module) do Code.compile_string(module) @@ -101,15 +114,4 @@ defmodule Sidecar.Grpc.CodeGenerator do files |> Enum.filter(&String.ends_with?(&1, extension)) end - - defp normalize_service_name(name) do - name - |> String.split(".") - |> Stream.map(&Macro.camelize(&1)) - |> Enum.join(".") - end - - defp normalize_method_name(name), do: Macro.underscore(name) - - defp get_module(filename, bindings \\ []), do: EEx.eval_file(filename, bindings) end diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 0b0c263f..7d500bd7 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -1,11 +1,11 @@ -defmodule Sidecar.Grpc.Dispatcher do +defmodule Sidecar.GRPC.Dispatcher do @moduledoc false require Logger def dispatch( %{ system: system_name, - actor: actor_name, + actor_name: actor_name, input: message, stream: stream, descriptor: descriptor diff --git a/lib/sidecar/grpc/generators/handler_generator.ex b/lib/sidecar/grpc/generators/handler_generator.ex index e51c1644..85a979f6 100644 --- a/lib/sidecar/grpc/generators/handler_generator.ex +++ b/lib/sidecar/grpc/generators/handler_generator.ex @@ -1,9 +1,10 @@ -defmodule Sidecar.Grpc.Generators.HandlerGenerator do +defmodule Sidecar.GRPC.Generators.HandlerGenerator do @moduledoc """ TODO """ @behaviour ProtobufGenerate.Plugin + alias Actors.Config.PersistentTermConfig, as: Config alias Protobuf.Protoc.Generator.Util @impl true @@ -13,6 +14,8 @@ defmodule Sidecar.Grpc.Generators.HandlerGenerator do @moduledoc since: "1.2.1" use GRPC.Server, service: <%= @service_name %> + alias Sidecar.GRPC.Dispatcher + <%= for {method_name, input, output} <- @methods do %> @spec <%= Macro.underscore(method_name) %>(<%= input %>.t(), GRPC.Server.Stream.t()) :: <%= output %>.t() def <%= method_name %>(message, stream) do @@ -33,13 +36,11 @@ defmodule Sidecar.Grpc.Generators.HandlerGenerator do end @impl true - def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = desc) do + def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do for svc <- svcs do mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) actor_name = Macro.camelize(svc.name) - # TODO get system name here from configuration - actor_system = "spawn-system" - name = Util.prepend_package_prefix(ctx.package, svc.name) + actor_system = Config.get(:actor_system_name) methods = for m <- svc.method do @@ -59,7 +60,7 @@ defmodule Sidecar.Grpc.Generators.HandlerGenerator do module: mod_name, actor_system: actor_system, actor_name: actor_name, - service_name: name, + service_name: mod_name, methods: methods, version: Util.version() ]} diff --git a/lib/sidecar/grpc/generators/handler_transcoding_generator.ex b/lib/sidecar/grpc/generators/handler_transcoding_generator.ex index 3dbff127..cf955751 100644 --- a/lib/sidecar/grpc/generators/handler_transcoding_generator.ex +++ b/lib/sidecar/grpc/generators/handler_transcoding_generator.ex @@ -1,9 +1,10 @@ -defmodule Sidecar.Grpc.Generators.HandlerTranscodingGenerator do +defmodule Sidecar.GRPC.Generators.HandlerTranscodingGenerator do @moduledoc """ TODO """ @behaviour ProtobufGenerate.Plugin + alias Actors.Config.PersistentTermConfig, as: Config alias Protobuf.Protoc.Generator.Util @impl true @@ -11,9 +12,9 @@ defmodule Sidecar.Grpc.Generators.HandlerTranscodingGenerator do """ defmodule <%= @module %>.ActorDispatcher do @moduledoc since: "1.2.1" - use GRPC.Server, service: <%= @service_name %>, http_transcode: true + use GRPC.Server, service: <%= @service_name %>.Service, http_transcode: true - alias Sidecar.Grpc.Dispatcher + alias Sidecar.GRPC.Dispatcher <%= for {method_name, input, output, _options} <- @methods do %> @spec <%= Macro.underscore(method_name) %>(<%= input %>.t(), GRPC.Server.Stream.t()) :: <%= output %>.t() @@ -36,13 +37,11 @@ defmodule Sidecar.Grpc.Generators.HandlerTranscodingGenerator do end @impl true - def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = desc) do + def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do for svc <- svcs do mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) actor_name = Macro.camelize(svc.name) - # TODO get system name here from configuration - actor_system = "spawn-system" - name = Util.prepend_package_prefix(ctx.package, svc.name) + actor_system = Config.get(:actor_system_name) methods = for m <- svc.method do diff --git a/lib/sidecar/grpc/generators/service_generator.ex b/lib/sidecar/grpc/generators/service_generator.ex index 89d7aca5..fc7e6cfc 100644 --- a/lib/sidecar/grpc/generators/service_generator.ex +++ b/lib/sidecar/grpc/generators/service_generator.ex @@ -1,4 +1,4 @@ -defmodule Sidecar.Grpc.Generators.ServiceGenerator do +defmodule Sidecar.GRPC.Generators.ServiceGenerator do @moduledoc """ TODO """ @@ -9,16 +9,15 @@ defmodule Sidecar.Grpc.Generators.ServiceGenerator do @impl true def template do """ - defmodule Sidecar.Grpc.ProxyEndpoint do + defmodule Sidecar.GRPC.ProxyEndpoint do @moduledoc false use GRPC.Endpoint - intercept(GRPC.Logger.Server) + intercept(GRPC.Server.Interceptors.Logger) services = [ - #MassProxy.Reflection.Service, <%= for service_name <- @services do %> - <%= service_name %>, + <%= service_name %>.Service, <% end %> ] @@ -28,28 +27,12 @@ defmodule Sidecar.Grpc.Generators.ServiceGenerator do end @impl true - def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = desc) do - for svc <- svcs do - mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) + def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do + services = Enum.map(svcs, fn svc -> Util.mod_name(ctx, [Macro.camelize(svc.name)]) end) - {mod_name, - [ - service_name: mod_name - ]} - end - end - - defp service_arg(type, _streaming? = true), do: "stream(#{type})" - defp service_arg(type, _streaming?), do: type - - defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) - when extensions == %{} do - %{} - end - - defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) do - for {{type, field}, value} <- extensions, into: %{} do - {field, %{type: type, value: value}} - end + {List.first(services), + [ + services: services + ]} end end diff --git a/lib/sidecar/grpc/generators/service_resolver_generator.ex b/lib/sidecar/grpc/generators/service_resolver_generator.ex index 68bd25e7..8004fa8a 100644 --- a/lib/sidecar/grpc/generators/service_resolver_generator.ex +++ b/lib/sidecar/grpc/generators/service_resolver_generator.ex @@ -1,15 +1,16 @@ -defmodule Sidecar.Grpc.Generators.ServiceResolverGenerator do +defmodule Sidecar.GRPC.Generators.ServiceResolverGenerator do @moduledoc """ TODO """ @behaviour ProtobufGenerate.Plugin + alias Actors.Config.PersistentTermConfig, as: Config alias Protobuf.Protoc.Generator.Util @impl true def template do """ - defmodule Sidecar.Grpc.ServiceResolver do + defmodule Sidecar.GRPC.ServiceResolver do @moduledoc since: "1.2.1" @@ -26,8 +27,7 @@ defmodule Sidecar.Grpc.Generators.ServiceResolverGenerator do for svc <- svcs do mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) actor_name = Macro.camelize(svc.name) - # TODO get system name here from configuration - actor_system = "spawn-system" + actor_system = Config.get(:actor_system_name) name = Util.prepend_package_prefix(ctx.package, svc.name) methods = diff --git a/lib/sidecar/grpc/reflection.ex b/lib/sidecar/grpc/reflection.ex deleted file mode 100644 index 198a439a..00000000 --- a/lib/sidecar/grpc/reflection.ex +++ /dev/null @@ -1,214 +0,0 @@ -defmodule Sidecar.Grpc.Reflection do - @moduledoc """ - This module is responsible for handling all requests - with a view to contract reflection (reflection.proto) - """ - use GenServer - require Logger - - alias Google.Protobuf.{FileDescriptorProto} - - alias Grpc.Reflection.V1alpha.{ - ErrorResponse, - FileDescriptorResponse, - ListServiceResponse, - ServerReflectionResponse, - ServiceResponse - } - - def child_spec(state) do - %{ - id: __MODULE__, - start: {__MODULE__, :start_link, [state]} - } - end - - @impl true - def init(state) do - {:ok, state} - end - - @impl true - def handle_call(:list_services, _from, state) do - service_response = - state - |> Enum.map(&extract_info/1) - |> Enum.reduce(fn -> [] end, fn s, acc -> - acc ++ [s] - end) - |> Enum.to_list() - |> List.flatten() - - response = - ServerReflectionResponse.new( - message_response: - {:list_services_response, ListServiceResponse.new(service: service_response)} - ) - - {:reply, response, state} - end - - @impl true - def handle_call({:file_by_filename, filename}, _from, state) do - files = - state - |> Enum.filter(fn descriptor -> descriptor.name =~ filename end) - |> Enum.map(fn descriptor -> FileDescriptorProto.encode(descriptor) end) - |> Enum.reduce(fn -> [] end, fn s, acc -> - acc ++ [s] - end) - |> Enum.to_list() - |> List.flatten() - - response = - ServerReflectionResponse.new( - message_response: - {:file_descriptor_response, FileDescriptorResponse.new(file_descriptor_proto: files)} - ) - - {:reply, response, state} - end - - @impl true - def handle_call({:file_containing_symbol, symbol}, _from, state) do - resp = - with {:fail, :empty} <- contains_service(state, symbol), - {:fail, :empty} <- contains_message_type(state, symbol) do - response = - ServerReflectionResponse.new( - message_response: - {:error_response, - ErrorResponse.new(error_code: 5, error_message: "Symbol Not Found")} - ) - - response - else - {:ok, description} -> - response = - ServerReflectionResponse.new( - message_response: - {:file_descriptor_response, - FileDescriptorResponse.new(file_descriptor_proto: description)} - ) - - response - end - - {:reply, resp, state} - end - - # Client API - def start_link(state) do - GenServer.start_link(__MODULE__, state, name: __MODULE__) - end - - def list_services() do - GenServer.call(__MODULE__, :list_services) - end - - def find_by_filename(filename) do - GenServer.call(__MODULE__, {:file_by_filename, filename}) - end - - def find_by_symbol(symbol) do - GenServer.call(__MODULE__, {:file_containing_symbol, symbol}) - end - - # Private - defp contains_service(state, symbol) do - description = - state - |> Enum.map(&get_service(&1, symbol)) - |> Enum.reduce(fn -> [] end, fn s, acc -> - acc ++ [s] - end) - |> Enum.to_list() - |> List.flatten() - - if Enum.empty?(description) do - {:fail, :empty} - else - {:ok, description} - end - end - - defp contains_message_type(state, symbol) do - description = - state - |> Enum.map(&get_messages(&1, symbol)) - |> Enum.reduce(fn -> [] end, fn s, acc -> - if s != nil || s != [] do - acc ++ [s] - else - acc - end - end) - |> Enum.to_list() - |> List.flatten() - - if Enum.empty?(description) do - {:fail, :empty} - else - {:ok, Enum.filter(description, &(!is_nil(&1)))} - end - end - - defp get_service(descriptor, symbol) do - services = extract_services(descriptor) - - svcs = - services - |> Enum.filter(fn service -> symbol =~ service.name end) - |> Enum.map(fn _ -> FileDescriptorProto.encode(descriptor) end) - |> Enum.reduce(fn -> [] end, fn s, acc -> - acc ++ [s] - end) - |> Enum.to_list() - - svcs - end - - defp get_messages(descriptor, symbol) do - message_types = extract_messages(descriptor) - - if !Enum.empty?(message_types) do - types = - message_types - |> Enum.filter(fn message -> symbol =~ message.name end) - |> Enum.map(fn _ -> FileDescriptorProto.encode(descriptor) end) - |> Enum.reduce(fn -> [] end, fn s, acc -> - [s] ++ acc - end) - |> Enum.to_list() - - types - end - end - - defp extract_info(descriptor) do - package = descriptor.package - services = extract_services(descriptor) - - svcs = - services - |> Enum.map(fn service -> ServiceResponse.new(name: "#{package}.#{service.name}") end) - |> Enum.reduce(fn -> [] end, fn s, acc -> - acc ++ [s] - end) - |> Enum.to_list() - - svcs - end - - defp extract_services(file) do - file.service - |> Enum.from_enumerable() - |> Enum.to_list() - end - - defp extract_messages(file) do - file.message_type - |> Flow.from_enumerable() - |> Enum.to_list() - end -end diff --git a/lib/sidecar/grpc/reflection/service.ex b/lib/sidecar/grpc/reflection/service.ex deleted file mode 100644 index aaf846c8..00000000 --- a/lib/sidecar/grpc/reflection/service.ex +++ /dev/null @@ -1,45 +0,0 @@ -defmodule Sidecar.Grpc.Reflection.Service do - @moduledoc """ - This module implement gRPC Reflection - """ - @moduledoc since: "1.2.1" - use GRPC.Server, service: Grpc.Reflection.V1alpha.ServerReflection.Service - - require Logger - alias GRPC.Server - alias Proxy.Grpc.Reflection, as: ReflectionServer - alias Grpc.Reflection.V1alpha.{ServerReflectionRequest, ServerReflectionResponse, ErrorResponse} - - @spec server_reflection_info(ServerReflectionRequest.t(), GRPC.Server.Stream.t()) :: - ServerReflectionResponse.t() - def server_reflection_info(request, stream) do - Enum.each(request, fn message -> - Logger.debug("Received reflection request: #{inspect(message)}") - - response = - case message.message_request do - {:list_services, _} -> - ReflectionServer.list_services() - - {:file_containing_symbol, _} -> - symbol = elem(message.message_request, 1) - ReflectionServer.find_by_symbol(symbol) - - {:file_by_filename, _} -> - filename = elem(message.message_request, 1) - ReflectionServer.find_by_filename(filename) - - _ -> - Logger.warn("This Reflection Operation is not supported") - - ServerReflectionResponse.new( - message_response: - {:error_response, - ErrorResponse.new(error_code: 13, error_message: "Operation not supported")} - ) - end - - Server.send_reply(stream, response) - end) - end -end diff --git a/lib/sidecar/grpc/service_resolver.ex b/lib/sidecar/grpc/service_resolver.ex index 7d2fab27..78ac2a2a 100644 --- a/lib/sidecar/grpc/service_resolver.ex +++ b/lib/sidecar/grpc/service_resolver.ex @@ -1,4 +1,4 @@ -defmodule Sidecar.Grpc.ServiceResolver do +defmodule Sidecar.GRPC.ServiceResolver do @moduledoc """ This module is redefined at runtime during application start. """ diff --git a/lib/sidecar/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex index b58e52fd..2f47d54b 100644 --- a/lib/sidecar/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -1,29 +1,26 @@ -defmodule Sidecar.Grpc.Supervisor do +defmodule Sidecar.GRPC.Supervisor do @moduledoc false use Supervisor require Logger - alias Proxy.Grpc.CodeGenerator, as: GrpcGenerator + alias Sidecar.GRPC.CodeGenerator, as: Generator def init(opts) do Logger.info("Starting gRPC Server...") Application.put_env(:grpc, :start_server, true, persistent: true) - # descriptor = Keyword.fetch!(:file_descriptor) - # actors = Keyword.fetch!(:actors) + case Generator.compile_protos() do + :ok -> + Generator.load_modules(opts) + |> Generator.compile_modules() - # children = - # descriptor - # |> GrpcGenerator.compile(actors) - # |> GrpcGenerator.build_spec() - # |> maybe_start_reflection(descriptor) + error -> + raise ArgumentError, + "Failed to load ActorHost protobufs modules. Details: #{inspect(error)}" + end children = [] Supervisor.init(children, strategy: :rest_for_one) end - - defp maybe_start_reflection(children, descriptor) do - [children] ++ [{Proxy.Grpc.Reflection, [descriptor]}] - end end diff --git a/priv/protos/modules/helloworld.pb.ex b/priv/protos/modules/helloworld.pb.ex index 7e7e7986..45f7ac5b 100644 --- a/priv/protos/modules/helloworld.pb.ex +++ b/priv/protos/modules/helloworld.pb.ex @@ -779,16 +779,16 @@ defmodule Helloworld.GreeterService.Service do } end - rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply, %{}) + rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply) - rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply, %{}) + rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply) end defmodule Helloworld.GreeterService.ActorDispatcher do @moduledoc since: "1.2.1" - use GRPC.Server, service: Helloworld.GreeterService, http_transcode: true + use GRPC.Server, service: Helloworld.GreeterService.Service, http_transcode: true - alias Sidecar.Grpc.Dispatcher + alias Sidecar.GRPC.Dispatcher @spec say_hello(Helloworld.HelloRequest.t(), GRPC.Server.Stream.t()) :: Helloworld.HelloReply.t() @@ -819,4 +819,17 @@ defmodule Helloworld.GreeterService.ActorDispatcher do Dispatcher.dispatch(request) end -end \ No newline at end of file +end + +defmodule Sidecar.GRPC.ProxyEndpoint do + @moduledoc false + use GRPC.Endpoint + + intercept(GRPC.Server.Interceptors.Logger) + + services = [ + Helloworld.GreeterService.Service + ] + + run(services) +end From f7e49cad30374a737ee07f15471817c3e9433051 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sun, 18 Feb 2024 09:50:27 -0300 Subject: [PATCH 06/48] Added docs and some validations to dispatcher module --- lib/sidecar/grpc/dispatcher.ex | 76 ++++++++++++++++++++++++++++++++-- 1 file changed, 73 insertions(+), 3 deletions(-) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 7d500bd7..104077fb 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -1,18 +1,88 @@ defmodule Sidecar.GRPC.Dispatcher do - @moduledoc false + @moduledoc """ + Module for dispatching gRPC messages to Actors. + + This module handles the dispatching of gRPC messages to Actors based on the provided parameters. + It logs relevant information and raises an error if the service descriptor is not found. + + """ require Logger + alias GRPC.Server + + @doc """ + Dispatches a gRPC message to the specified actor. + + ### Parameters: + + - `request` - A map containing the following parameters: + - `system: system_name` - The name of the actor system. + - `actor_name: actor_name` - The name of the actor. + - `input: message` - The input message. + - `stream: stream` - The stream (optional). + - `descriptor: descriptor` - The service descriptor. + + ### Example: + + ```elixir + request = %{ + system: "spawn-system", + actor_name: "GreeterActor", + action_name: "SayHello", + input: %{data: "some_data"}, + stream: %GRPC.Server.Stream{}, + descriptor: %Google.Protobuf.FileDescriptorProto{ + name: "helloworld.proto", + package: "helloworld"}, + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "GreeterService", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "SayHello", + input_type: ".helloworld.HelloRequest", + output_type: ".helloworld.HelloReply", + } + ] + } + ] + } + } + + Sidecar.GRPC.Dispatcher.dispatch(request) + + """ def dispatch( %{ system: system_name, actor_name: actor_name, + action_name: action_name, input: message, stream: stream, descriptor: descriptor } = request - ) do + ) + when not is_nil(descriptor) do Logger.debug( - "Dispatching gRPC message to actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" + "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" ) end + + def dispatch( + %{ + system: system_name, + actor_name: actor_name, + descriptor: descriptor + } = request + ) + when not is_nil(descriptor) do + Logger.error( + "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}" + ) + + raise GRPC.RPCError, + status: GRPC.Status.failed_precondition(), + message: + "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}" + end end From e798e6717d4fc6f07b6f729d5b27c9f8e82686f6 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sun, 18 Feb 2024 14:10:56 -0300 Subject: [PATCH 07/48] Create service resolver module to find actor metadata in protobuf files --- lib/sidecar/grpc/code_generator.ex | 1 + lib/sidecar/grpc/dispatcher.ex | 6 ++ .../generators/service_resolver_generator.ex | 90 ++++++++++++------- priv/protos/modules/helloworld.pb.ex | 34 +++++++ 4 files changed, 101 insertions(+), 30 deletions(-) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 9225bc89..b28394df 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -55,6 +55,7 @@ defmodule Sidecar.GRPC.CodeGenerator do "--plugins=#{grpc_generator_plugin}", "--plugins=#{handler_generator_plugin}", "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", + "--plugins=Sidecar.GRPC.Generators.ServiceResolverGenerator", "#{include_path}/#{user_defined_proto_files}" ] diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 104077fb..936e8706 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -9,6 +9,7 @@ defmodule Sidecar.GRPC.Dispatcher do require Logger alias GRPC.Server + alias Sidecar.GRPC.ServiceResolver, as: ActorResolver @doc """ Dispatches a gRPC message to the specified actor. @@ -66,6 +67,11 @@ defmodule Sidecar.GRPC.Dispatcher do Logger.debug( "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" ) + + # TODO + # Before forwading the request, we must find out through the ServiceResolver module what type of RPC + # it is (unary, client streaming, server streaming, etc...). This way we will know how to forward + # the request correctly (synchronously or asynchronously), as well as how to properly handle the GRPC response. end def dispatch( diff --git a/lib/sidecar/grpc/generators/service_resolver_generator.ex b/lib/sidecar/grpc/generators/service_resolver_generator.ex index 8004fa8a..e5a477f2 100644 --- a/lib/sidecar/grpc/generators/service_resolver_generator.ex +++ b/lib/sidecar/grpc/generators/service_resolver_generator.ex @@ -13,10 +13,34 @@ defmodule Sidecar.GRPC.Generators.ServiceResolverGenerator do defmodule Sidecar.GRPC.ServiceResolver do @moduledoc since: "1.2.1" + @actors [ + <%= for {actor_name, %{service_name: service_name}} <- @actors do %> + { + <%= inspect(actor_name) %>, + %{ + service_name: <%= inspect(service_name) %>, + service_module: <%= service_name %>.Service + } + } + <% end %> + ] - <%= for {method_name, input, output, _options} <- @methods do %> + def has_actor?(actor_name) do + Enum.any?(@actors, fn {name, _} -> actor_name == name end) + end - <% end %> + def get_descriptor(actor_name) do + actor_attributes = + Enum.filter(@actors, fn {name, _} -> actor_name == name end) + |> Enum.map(fn {_name, attributes} -> attributes end) + |> List.first() + + mod = Map.get(actor_attributes, :service_module) + mod.descriptor() + |> Map.get(:service) + |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> actor_name == name end) + |> List.first() + end end """ @@ -24,34 +48,40 @@ defmodule Sidecar.GRPC.Generators.ServiceResolverGenerator do @impl true def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do - for svc <- svcs do - mod_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) - actor_name = Macro.camelize(svc.name) - actor_system = Config.get(:actor_system_name) - name = Util.prepend_package_prefix(ctx.package, svc.name) - - methods = - for m <- svc.method do - input = service_arg(Util.type_from_type_name(ctx, m.input_type), m.client_streaming) - output = service_arg(Util.type_from_type_name(ctx, m.output_type), m.server_streaming) - - options = - m.options - |> opts() - |> inspect(limit: :infinity) - - {Macro.underscore(m.name), input, output, options} - end - - {mod_name, - [ - module: mod_name, - actor_name: actor_name, - service_name: mod_name, - methods: methods, - version: Util.version() - ]} - end + actors = + Enum.map(svcs, fn svc -> + service_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) + actor_name = Macro.camelize(svc.name) + name = Util.prepend_package_prefix(ctx.package, svc.name) + + methods = + for m <- svc.method do + input = service_arg(Util.type_from_type_name(ctx, m.input_type), m.client_streaming) + output = service_arg(Util.type_from_type_name(ctx, m.output_type), m.server_streaming) + + options = + m.options + |> opts() + |> inspect(limit: :infinity) + + {m.name, input, output, options, m.client_streaming, m.server_streaming} + end + + { + actor_name, + %{ + service_name: service_name, + methods: methods + } + } + end) + + {name, _} = List.first(actors) + + {name, + [ + actors: actors + ]} end defp service_arg(type, _streaming? = true), do: "stream(#{type})" diff --git a/priv/protos/modules/helloworld.pb.ex b/priv/protos/modules/helloworld.pb.ex index 45f7ac5b..dbb8c654 100644 --- a/priv/protos/modules/helloworld.pb.ex +++ b/priv/protos/modules/helloworld.pb.ex @@ -833,3 +833,37 @@ defmodule Sidecar.GRPC.ProxyEndpoint do run(services) end + +defmodule Sidecar.GRPC.ServiceResolver do + @moduledoc since: "1.2.1" + + @actors [ + { + "GreeterService", + %{ + service_name: "Helloworld.GreeterService", + service_module: Helloworld.GreeterService.Service + } + } + ] + + def has_actor?(actor_name) do + Enum.any?(@actors, fn {name, _} -> actor_name == name end) + end + + def get_descriptor(actor_name) do + actor_attributes = + Enum.filter(@actors, fn {name, _} -> actor_name == name end) + |> Enum.map(fn {_name, attributes} -> attributes end) + |> List.first() + + mod = Map.get(actor_attributes, :service_module) + file_descriptor = mod.descriptor() + + Map.get(file_descriptor, :service) + |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> + actor_name == name + end) + |> List.first() + end +end From 29715593e20cca0a784bb6ec0f20e7a1b429559a Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sun, 18 Feb 2024 15:08:32 -0300 Subject: [PATCH 08/48] Update Elixir to 1.15 and create gRPC Reflection Server --- .tool-versions | 2 +- lib/sidecar/grpc/code_generator.ex | 1 + .../handler_transcoding_generator.ex | 6 +++- .../generators/reflection_server_generator.ex | 33 +++++++++++++++++ mix.exs | 3 +- mix.lock | 1 + priv/protos/modules/helloworld.pb.ex | 35 ++++++++++++------- spawn_activators/activator/mix.exs | 2 +- spawn_activators/activator_api/mix.exs | 2 +- spawn_activators/activator_kafka/mix.exs | 2 +- spawn_activators/activator_pubsub/mix.exs | 2 +- spawn_activators/activator_rabbitmq/mix.exs | 2 +- spawn_activators/activator_sqs/mix.exs | 2 +- spawn_cli/mix.exs | 2 +- spawn_initializer/mix.exs | 2 +- spawn_operator/spawn_operator/mix.exs | 2 +- spawn_proxy/proxy/mix.exs | 2 +- spawn_sdk/spawn_sdk/mix.exs | 2 +- spawn_sdk/spawn_sdk_example/mix.exs | 2 +- spawn_statestores/statestores/mix.exs | 2 +- .../statestores_cockroachdb/mix.exs | 2 +- spawn_statestores/statestores_mariadb/mix.exs | 2 +- spawn_statestores/statestores_mssql/mix.exs | 2 +- spawn_statestores/statestores_mysql/mix.exs | 2 +- spawn_statestores/statestores_native/mix.exs | 2 +- .../statestores_postgres/mix.exs | 2 +- spawn_statestores/statestores_sqlite/mix.exs | 2 +- 27 files changed, 85 insertions(+), 36 deletions(-) create mode 100644 lib/sidecar/grpc/generators/reflection_server_generator.ex diff --git a/.tool-versions b/.tool-versions index 796b04c3..dc8fa9ef 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -elixir 1.14.0-otp-25 +elixir 1.15 erlang 25.3.2.8 diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index b28394df..4649522e 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -56,6 +56,7 @@ defmodule Sidecar.GRPC.CodeGenerator do "--plugins=#{handler_generator_plugin}", "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", "--plugins=Sidecar.GRPC.Generators.ServiceResolverGenerator", + "--plugins=Sidecar.Grpc.Generators.ReflectionServerGenerator", "#{include_path}/#{user_defined_proto_files}" ] diff --git a/lib/sidecar/grpc/generators/handler_transcoding_generator.ex b/lib/sidecar/grpc/generators/handler_transcoding_generator.ex index cf955751..18ca6283 100644 --- a/lib/sidecar/grpc/generators/handler_transcoding_generator.ex +++ b/lib/sidecar/grpc/generators/handler_transcoding_generator.ex @@ -1,6 +1,10 @@ defmodule Sidecar.GRPC.Generators.HandlerTranscodingGenerator do @moduledoc """ - TODO + Module for generating an actor dispatcher with transcoding capabilities for gRPC methods. + + This module implements the `ProtobufGenerate.Plugin` behaviour to generate an actor dispatcher + with transcoding capabilities for each gRPC method defined in the Protobuf service. + """ @behaviour ProtobufGenerate.Plugin diff --git a/lib/sidecar/grpc/generators/reflection_server_generator.ex b/lib/sidecar/grpc/generators/reflection_server_generator.ex new file mode 100644 index 00000000..c746f5f1 --- /dev/null +++ b/lib/sidecar/grpc/generators/reflection_server_generator.ex @@ -0,0 +1,33 @@ +defmodule Sidecar.Grpc.Generators.ReflectionServerGenerator do + @moduledoc """ + TODO + """ + @behaviour ProtobufGenerate.Plugin + + alias Protobuf.Protoc.Generator.Util + + @impl true + def template do + """ + defmodule Sidecar.GRPC.Reflection.Server do + @moduledoc since: "1.2.1" + use GrpcReflection.Server, version: :v1, services: [ + <%= for service_name <- @services do %> + <%= service_name %>.Service, + <% end %> + ] + + end + """ + end + + @impl true + def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do + services = Enum.map(svcs, fn svc -> Util.mod_name(ctx, [Macro.camelize(svc.name)]) end) + + {List.first(services), + [ + services: services + ]} + end +end diff --git a/mix.exs b/mix.exs index d401b15c..faf9b481 100644 --- a/mix.exs +++ b/mix.exs @@ -19,7 +19,7 @@ defmodule Spawn.MixProject do config_path: "config/config.exs", deps_path: "deps", lockfile: "mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), @@ -78,6 +78,7 @@ defmodule Spawn.MixProject do {:protobuf, "~> 0.11"}, {:protobuf_generate, "~> 0.1"}, {:grpc, "~> 0.7"}, + {:grpc_reflection, git: "https://github.com/elixir-grpc/grpc-reflection"}, {:finch, "~> 0.16"}, {:retry, "~> 0.17"}, {:tesla, "~> 1.6"}, diff --git a/mix.lock b/mix.lock index c016463a..cf48627f 100644 --- a/mix.lock +++ b/mix.lock @@ -51,6 +51,7 @@ "gnat": {:hex, :gnat, "1.7.1", "491144f9c3aec00e9941d69538e2fd2836271e220315c8d2d87907c20ca7abc8", [:mix], [{:cowlib, "~> 2.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:nkeys, "~> 0.2", [hex: :nkeys, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a5629088d9bdb16d982eb48fd431cf6c5a71e9b026281781983501237ab5b911"}, "gproc": {:hex, :gproc, "0.8.0", "cea02c578589c61e5341fce149ea36ccef236cc2ecac8691fba408e7ea77ec2f", [:rebar3], [], "hexpm", "580adafa56463b75263ef5a5df4c86af321f68694e7786cb057fd805d1e2a7de"}, "grpc": {:hex, :grpc, "0.7.0", "a86eab356b0b84406b526786a947ca50e9b9eae87108c873b51e321f8a71e8ed", [:mix], [{:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "632a9507da8d3c12b112b197db4d60da3c95bad02594d37711eeb622d032f254"}, + "grpc_reflection": {:git, "https://github.com/elixir-grpc/grpc-reflection", "07a295d2dec47edd112de64355b0e4d9a129324b", []}, "grpcbox": {:hex, :grpcbox, "0.16.0", "b83f37c62d6eeca347b77f9b1ec7e9f62231690cdfeb3a31be07cd4002ba9c82", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.13.0", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.8.0", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "294df743ae20a7e030889f00644001370a4f7ce0121f3bbdaf13cf3169c62913"}, "gun": {:hex, :gun, "2.0.1", "160a9a5394800fcba41bc7e6d421295cf9a7894c2252c0678244948e3336ad73", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "a10bc8d6096b9502205022334f719cc9a08d9adcfbfc0dbee9ef31b56274a20b"}, "hackney": {:hex, :hackney, "1.18.1", "f48bf88f521f2a229fc7bae88cf4f85adc9cd9bcf23b5dc8eb6a1788c662c4f6", [:rebar3], [{:certifi, "~> 2.9.0", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "~> 6.1.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "~> 1.0.0", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~> 1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:parse_trans, "3.3.1", [hex: :parse_trans, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "~> 1.1.0", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}, {:unicode_util_compat, "~> 0.7.0", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "a4ecdaff44297e9b5894ae499e9a070ea1888c84afdd1fd9b7b2bc384950128e"}, diff --git a/priv/protos/modules/helloworld.pb.ex b/priv/protos/modules/helloworld.pb.ex index dbb8c654..2069d128 100644 --- a/priv/protos/modules/helloworld.pb.ex +++ b/priv/protos/modules/helloworld.pb.ex @@ -353,7 +353,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: '\f', + path: ~c"\f", span: [0, 0, 18], leading_comments: nil, trailing_comments: nil, @@ -361,7 +361,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: '\b', + path: ~c"\b", span: [2, 0, 34], leading_comments: nil, trailing_comments: nil, @@ -369,7 +369,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: '\b\n', + path: ~c"\b\n", span: [2, 0, 34], leading_comments: nil, trailing_comments: nil, @@ -377,7 +377,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: '\b', + path: ~c"\b", span: [3, 0, 52], leading_comments: nil, trailing_comments: nil, @@ -393,7 +393,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: '\b', + path: ~c"\b", span: [4, 0, 48], leading_comments: nil, trailing_comments: nil, @@ -401,7 +401,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: '\b\b', + path: ~c"\b\b", span: [4, 0, 48], leading_comments: nil, trailing_comments: nil, @@ -409,7 +409,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: '\b', + path: ~c"\b", span: [5, 0, 33], leading_comments: nil, trailing_comments: nil, @@ -417,7 +417,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: '\b$', + path: ~c"\b$", span: [5, 0, 33], leading_comments: nil, trailing_comments: nil, @@ -642,7 +642,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 1], - span: '%\t\r', + span: ~c"%\t\r", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -674,7 +674,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1, 1], - span: '\'\t\r', + span: ~c"'\t\r", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -762,7 +762,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1, 3], - span: '-$%', + span: ~c"-$%", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -858,12 +858,21 @@ defmodule Sidecar.GRPC.ServiceResolver do |> List.first() mod = Map.get(actor_attributes, :service_module) - file_descriptor = mod.descriptor() - Map.get(file_descriptor, :service) + mod.descriptor() + |> Map.get(:service) |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> actor_name == name end) |> List.first() end end + +defmodule Sidecar.GRPC.Reflection.Server do + @moduledoc since: "1.2.1" + use GrpcReflection.Server, + version: :v1, + services: [ + Helloworld.GreeterService.Service + ] +end diff --git a/spawn_activators/activator/mix.exs b/spawn_activators/activator/mix.exs index 9b78c8eb..c4b0fe13 100644 --- a/spawn_activators/activator/mix.exs +++ b/spawn_activators/activator/mix.exs @@ -12,7 +12,7 @@ defmodule Activators.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps() ] diff --git a/spawn_activators/activator_api/mix.exs b/spawn_activators/activator_api/mix.exs index d1c71871..d15754d1 100644 --- a/spawn_activators/activator_api/mix.exs +++ b/spawn_activators/activator_api/mix.exs @@ -12,7 +12,7 @@ defmodule ActivatorAPI.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), releases: releases() diff --git a/spawn_activators/activator_kafka/mix.exs b/spawn_activators/activator_kafka/mix.exs index 0ca9159b..5de22d83 100644 --- a/spawn_activators/activator_kafka/mix.exs +++ b/spawn_activators/activator_kafka/mix.exs @@ -12,7 +12,7 @@ defmodule ActivatorKafka.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), releases: releases() diff --git a/spawn_activators/activator_pubsub/mix.exs b/spawn_activators/activator_pubsub/mix.exs index ffe8e082..cf4e687c 100644 --- a/spawn_activators/activator_pubsub/mix.exs +++ b/spawn_activators/activator_pubsub/mix.exs @@ -12,7 +12,7 @@ defmodule ActivatorPubSub.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), releases: releases() diff --git a/spawn_activators/activator_rabbitmq/mix.exs b/spawn_activators/activator_rabbitmq/mix.exs index b94a078e..c8027f8d 100644 --- a/spawn_activators/activator_rabbitmq/mix.exs +++ b/spawn_activators/activator_rabbitmq/mix.exs @@ -12,7 +12,7 @@ defmodule ActivatorRabbitMQ.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), releases: releases() diff --git a/spawn_activators/activator_sqs/mix.exs b/spawn_activators/activator_sqs/mix.exs index 3fdf85b6..64cf6d2b 100644 --- a/spawn_activators/activator_sqs/mix.exs +++ b/spawn_activators/activator_sqs/mix.exs @@ -12,7 +12,7 @@ defmodule ActivatorSQS.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), releases: releases() diff --git a/spawn_cli/mix.exs b/spawn_cli/mix.exs index 5d435735..df745a7d 100644 --- a/spawn_cli/mix.exs +++ b/spawn_cli/mix.exs @@ -12,7 +12,7 @@ defmodule SpawnCli.MixProject do config_path: "config/config.exs", deps_path: "../deps", lockfile: "../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), releases: releases() diff --git a/spawn_initializer/mix.exs b/spawn_initializer/mix.exs index 5bcd8e3a..15d16ec8 100644 --- a/spawn_initializer/mix.exs +++ b/spawn_initializer/mix.exs @@ -10,7 +10,7 @@ defmodule SpawnInitializer.MixProject do [ app: @app, version: @version, - elixir: "~> 1.14", + elixir: "~> 1.15", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), diff --git a/spawn_operator/spawn_operator/mix.exs b/spawn_operator/spawn_operator/mix.exs index c2cf626a..d530d2bc 100644 --- a/spawn_operator/spawn_operator/mix.exs +++ b/spawn_operator/spawn_operator/mix.exs @@ -12,7 +12,7 @@ defmodule Operator.MixProject do config_path: "config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), diff --git a/spawn_proxy/proxy/mix.exs b/spawn_proxy/proxy/mix.exs index 50837baf..0fb35727 100644 --- a/spawn_proxy/proxy/mix.exs +++ b/spawn_proxy/proxy/mix.exs @@ -11,7 +11,7 @@ defmodule Proxy.MixProject do build_path: "../../_build", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), releases: releases() diff --git a/spawn_sdk/spawn_sdk/mix.exs b/spawn_sdk/spawn_sdk/mix.exs index 1b8798bd..c7801ebb 100644 --- a/spawn_sdk/spawn_sdk/mix.exs +++ b/spawn_sdk/spawn_sdk/mix.exs @@ -16,7 +16,7 @@ defmodule SpawnSdk.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", elixirc_paths: elixirc_paths(Mix.env()), start_permanent: Mix.env() == :prod, deps: deps(), diff --git a/spawn_sdk/spawn_sdk_example/mix.exs b/spawn_sdk/spawn_sdk_example/mix.exs index bdc92119..14f2f714 100644 --- a/spawn_sdk/spawn_sdk_example/mix.exs +++ b/spawn_sdk/spawn_sdk_example/mix.exs @@ -12,7 +12,7 @@ defmodule SpawnSdkExample.MixProject do config_path: "../../config/config.exs", deps_path: "deps", lockfile: "mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), releases: releases() diff --git a/spawn_statestores/statestores/mix.exs b/spawn_statestores/statestores/mix.exs index 82304be9..98514f19 100644 --- a/spawn_statestores/statestores/mix.exs +++ b/spawn_statestores/statestores/mix.exs @@ -16,7 +16,7 @@ defmodule Statestores.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), diff --git a/spawn_statestores/statestores_cockroachdb/mix.exs b/spawn_statestores/statestores_cockroachdb/mix.exs index e5d352b9..9562e995 100644 --- a/spawn_statestores/statestores_cockroachdb/mix.exs +++ b/spawn_statestores/statestores_cockroachdb/mix.exs @@ -16,7 +16,7 @@ defmodule StatestoresCockroachDB.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), diff --git a/spawn_statestores/statestores_mariadb/mix.exs b/spawn_statestores/statestores_mariadb/mix.exs index d8a104f5..caa7a4f7 100644 --- a/spawn_statestores/statestores_mariadb/mix.exs +++ b/spawn_statestores/statestores_mariadb/mix.exs @@ -16,7 +16,7 @@ defmodule StatestoresMysql.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), diff --git a/spawn_statestores/statestores_mssql/mix.exs b/spawn_statestores/statestores_mssql/mix.exs index a984f882..a37b0a9f 100644 --- a/spawn_statestores/statestores_mssql/mix.exs +++ b/spawn_statestores/statestores_mssql/mix.exs @@ -16,7 +16,7 @@ defmodule StatestoresMssql.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), diff --git a/spawn_statestores/statestores_mysql/mix.exs b/spawn_statestores/statestores_mysql/mix.exs index 34ca4230..88d9590d 100644 --- a/spawn_statestores/statestores_mysql/mix.exs +++ b/spawn_statestores/statestores_mysql/mix.exs @@ -16,7 +16,7 @@ defmodule StatestoresMariaDB.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), diff --git a/spawn_statestores/statestores_native/mix.exs b/spawn_statestores/statestores_native/mix.exs index b463f535..fa0b41f1 100644 --- a/spawn_statestores/statestores_native/mix.exs +++ b/spawn_statestores/statestores_native/mix.exs @@ -17,7 +17,7 @@ defmodule StatestoresNative.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), diff --git a/spawn_statestores/statestores_postgres/mix.exs b/spawn_statestores/statestores_postgres/mix.exs index 8c190729..0e313c62 100644 --- a/spawn_statestores/statestores_postgres/mix.exs +++ b/spawn_statestores/statestores_postgres/mix.exs @@ -16,7 +16,7 @@ defmodule StatestoresPostgres.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), diff --git a/spawn_statestores/statestores_sqlite/mix.exs b/spawn_statestores/statestores_sqlite/mix.exs index 54b6dc73..a0dcdea9 100644 --- a/spawn_statestores/statestores_sqlite/mix.exs +++ b/spawn_statestores/statestores_sqlite/mix.exs @@ -16,7 +16,7 @@ defmodule StatestoresSqlite.MixProject do config_path: "../../config/config.exs", deps_path: "../../deps", lockfile: "../../mix.lock", - elixir: "~> 1.14", + elixir: "~> 1.15", start_permanent: Mix.env() == :prod, deps: deps(), elixirc_paths: elixirc_paths(Mix.env()), From 837e482fa95c0f58a75da6f6be42a7d3418b8be9 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sun, 18 Feb 2024 15:14:03 -0300 Subject: [PATCH 09/48] Added documentation --- lib/sidecar/grpc/generators/handler_generator.ex | 6 +++++- lib/sidecar/grpc/generators/reflection_server_generator.ex | 6 +++++- lib/sidecar/grpc/generators/service_generator.ex | 6 +++++- lib/sidecar/grpc/generators/service_resolver_generator.ex | 6 +++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/sidecar/grpc/generators/handler_generator.ex b/lib/sidecar/grpc/generators/handler_generator.ex index 85a979f6..da94fcdb 100644 --- a/lib/sidecar/grpc/generators/handler_generator.ex +++ b/lib/sidecar/grpc/generators/handler_generator.ex @@ -1,6 +1,10 @@ defmodule Sidecar.GRPC.Generators.HandlerGenerator do @moduledoc """ - TODO + Module for generating an actor dispatcher with transcoding capabilities for gRPC methods. + + This module implements the `ProtobufGenerate.Plugin` behaviour to generate an actor dispatcher + with transcoding capabilities for each gRPC method defined in the Protobuf service. + """ @behaviour ProtobufGenerate.Plugin diff --git a/lib/sidecar/grpc/generators/reflection_server_generator.ex b/lib/sidecar/grpc/generators/reflection_server_generator.ex index c746f5f1..b4ee80de 100644 --- a/lib/sidecar/grpc/generators/reflection_server_generator.ex +++ b/lib/sidecar/grpc/generators/reflection_server_generator.ex @@ -1,6 +1,10 @@ defmodule Sidecar.Grpc.Generators.ReflectionServerGenerator do @moduledoc """ - TODO + Module for generating a gRPC reflection server module. + + This module implements the `ProtobufGenerate.Plugin` behaviour to generate a gRPC reflection server + module that includes specified gRPC services for reflection purposes. + """ @behaviour ProtobufGenerate.Plugin diff --git a/lib/sidecar/grpc/generators/service_generator.ex b/lib/sidecar/grpc/generators/service_generator.ex index fc7e6cfc..55063b0b 100644 --- a/lib/sidecar/grpc/generators/service_generator.ex +++ b/lib/sidecar/grpc/generators/service_generator.ex @@ -1,6 +1,10 @@ defmodule Sidecar.GRPC.Generators.ServiceGenerator do @moduledoc """ - TODO + Module for generating a gRPC proxy endpoint module. + + This module implements the `ProtobufGenerate.Plugin` behaviour to generate a gRPC proxy endpoint + module that includes specified gRPC services. + """ @behaviour ProtobufGenerate.Plugin diff --git a/lib/sidecar/grpc/generators/service_resolver_generator.ex b/lib/sidecar/grpc/generators/service_resolver_generator.ex index e5a477f2..56019a3d 100644 --- a/lib/sidecar/grpc/generators/service_resolver_generator.ex +++ b/lib/sidecar/grpc/generators/service_resolver_generator.ex @@ -1,6 +1,10 @@ defmodule Sidecar.GRPC.Generators.ServiceResolverGenerator do @moduledoc """ - TODO + Module for generating a gRPC service resolver module. + + This module implements the `ProtobufGenerate.Plugin` behaviour to generate a gRPC service resolver + module that provides methods for resolving gRPC services and their descriptors. + """ @behaviour ProtobufGenerate.Plugin From 21e533cf26e5cb88340b7db09026a71bee3da952 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sun, 18 Feb 2024 15:16:07 -0300 Subject: [PATCH 10/48] Document load_modules function --- lib/sidecar/grpc/code_generator.ex | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 4649522e..31880d43 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -63,6 +63,28 @@ defmodule Sidecar.GRPC.CodeGenerator do _ = Generate.run(protoc_options) end + @doc """ + Loads Elixir modules from the specified directory with a '.pb.ex' file extension. + + ## Parameters + + - `opts` (KeywordList): Options for loading modules. + - `:output_path` (String): Path to the directory containing the modules. Default is "#{File.cwd!()}/priv/protos/modules". + + ## Returns + + A list of strings, where each string represents the content of an Elixir module file. + + ## Examples + + ```elixir + opts = [output_path: "/path/to/modules"] + modules = load_modules(opts) + IO.inspect(modules) + + This example loads Elixir modules from the specified directory "/path/to/modules" and prints the content of each module. + + """ def load_modules(opts) do path = Keyword.get(opts, :output_path, "#{File.cwd!()}/priv/protos/modules") From d78eee2b5a6b900e4ebfdb0dbbed941e22a5f33b Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Sun, 18 Feb 2024 15:45:00 -0300 Subject: [PATCH 11/48] Start gRPC Server and minor adjusts --- Makefile | 2 +- lib/actors/config/persistent_term_config.ex | 11 + lib/sidecar/grpc/code_generator.ex | 11 +- lib/sidecar/grpc/supervisor.ex | 27 +- lib/sidecar/supervisor.ex | 3 +- priv/templates/grpc_endpoint.ex.eex | 16 - priv/templates/grpc_service.ex.eex | 30 - .../functions/protocol/actors/actor.proto | 169 +++ .../functions/protocol/actors/protocol.proto | 452 ++++++ .../functions/protocol/actors/state.proto | 28 + .../priv/protos/google/api/annotations.proto | 31 + .../proxy/priv/protos/google/api/http.proto | 375 +++++ .../priv/protos/google/protobuf/any.proto | 158 +++ .../priv/protos/google/protobuf/api.proto | 207 +++ .../protos/google/protobuf/descriptor.proto | 1223 +++++++++++++++++ .../protos/google/protobuf/duration.proto | 115 ++ .../priv/protos/google/protobuf/empty.proto | 51 + .../protos/google/protobuf/field_mask.proto | 245 ++++ .../google/protobuf/source_context.proto | 48 + .../priv/protos/google/protobuf/struct.proto | 95 ++ .../protos/google/protobuf/timestamp.proto | 144 ++ .../priv/protos/google/protobuf/type.proto | 193 +++ .../protos/google/protobuf/wrappers.proto | 123 ++ .../grpc/reflection/v1alpha/reflection.proto | 136 ++ .../proxy/priv/protos/helloworld.proto | 47 + .../priv/protos/io/cloudevents/v1/spec.proto | 59 + .../priv/protos/modules/helloworld.pb.ex | 848 ++++++++++++ 27 files changed, 4787 insertions(+), 60 deletions(-) delete mode 100644 priv/templates/grpc_endpoint.ex.eex delete mode 100644 priv/templates/grpc_service.ex.eex create mode 100644 spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/actor.proto create mode 100644 spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/protocol.proto create mode 100644 spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/state.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/api/annotations.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/api/http.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/any.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/api.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/descriptor.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/duration.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/empty.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/field_mask.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/source_context.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/struct.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/timestamp.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/type.proto create mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/wrappers.proto create mode 100644 spawn_proxy/proxy/priv/protos/grpc/reflection/v1alpha/reflection.proto create mode 100644 spawn_proxy/proxy/priv/protos/helloworld.proto create mode 100644 spawn_proxy/proxy/priv/protos/io/cloudevents/v1/spec.proto create mode 100644 spawn_proxy/proxy/priv/protos/modules/helloworld.pb.ex diff --git a/Makefile b/Makefile index e60fef8f..afd76eb4 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,7 @@ run-proxy-local2: ERL_ZFLAGS='-proto_dist inet_tls -ssl_dist_optfile rel/overlays/local-mtls.ssl.conf' cd spawn_proxy/proxy && mix deps.get && PROXY_DATABASE_TYPE=$(database) PROXY_HTTP_PORT=9003 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= iex --name spawn_a2@test.default.svc -S mix run-proxy-local-3: - cd spawn_proxy/proxy && mix deps.get && SPAWN_PROXY_LOGGER_LEVEL=info PROXY_CLUSTER_STRATEGY=epmd SPAWN_USE_INTERNAL_NATS=true SPAWN_PUBSUB_ADAPTER=nats PROXY_DATABASE_PORT=3307 PROXY_DATABASE_TYPE=mariadb PROXY_DATABASE_POOL_SIZE=30 PROXY_HTTP_PORT=9003 USER_FUNCTION_PORT=8091 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= iex --name spawn_a3@127.0.0.1 -S mix + cd spawn_proxy/proxy && mix deps.get && SPAWN_PROXY_LOGGER_LEVEL=info PROXY_CLUSTER_STRATEGY=epmd SPAWN_USE_INTERNAL_NATS=false SPAWN_PUBSUB_ADAPTER=nats PROXY_DATABASE_PORT=3307 PROXY_DATABASE_TYPE=mariadb PROXY_DATABASE_POOL_SIZE=30 PROXY_HTTP_PORT=9003 USER_FUNCTION_PORT=8091 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= iex --name spawn_a3@127.0.0.1 -S mix run-proxy-local-nodejs-test: ERL_ZFLAGS='-proto_dist inet_tls -ssl_dist_optfile rel/overlays/local-mtls.ssl.conf' cd spawn_proxy/proxy && mix deps.get && PROXY_DATABASE_TYPE=$(database) PROXY_HTTP_PORT=9001 SPAWN_STATESTORE_KEY=3Jnb0hZiHIzHTOih7t2cTEPEpY98Tu1wvQkPfq/XwqE= PROXY_ACTOR_SYSTEM_NAME=SpawnSysTest SPAWN_SUPERVISORS_STATE_HANDOFF_CONTROLLER=crdt iex --name spawn_a1@test.default.svc -S mix diff --git a/lib/actors/config/persistent_term_config.ex b/lib/actors/config/persistent_term_config.ex index 903ddcc4..38c63503 100644 --- a/lib/actors/config/persistent_term_config.ex +++ b/lib/actors/config/persistent_term_config.ex @@ -27,6 +27,7 @@ if Code.ensure_loaded?(:persistent_term) do {:deployment_mode, "sidecar"}, {:http_port, "9001"}, {:http_num_acceptors, "150"}, + {:grpc_port, "9980"}, {:internal_nats_hosts, "nats://127.0.0.1:4222"}, {:internal_nats_tls, "false"}, {:internal_nats_auth, "false"}, @@ -223,6 +224,16 @@ if Code.ensure_loaded?(:persistent_term) do value end + defp load_env({:grpc_port, default}) do + value = + env("PROXY_GRPC_PORT", default) + |> String.to_integer() + + :persistent_term.put({__MODULE__, :grpc_port}, value) + + value + end + defp load_env({:http_num_acceptors, default}) do value = env("PROXY_HTTP_NUM_ACCEPTORS", default) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 31880d43..40bfa333 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -90,10 +90,13 @@ defmodule Sidecar.GRPC.CodeGenerator do user_defined_modules_files = list_files_with_extension(path, ".pb.ex") - Enum.map(user_defined_modules_files, fn file -> - full_path = Path.join(path, file) - File.read!(full_path) - end) + modules = + Enum.map(user_defined_modules_files, fn file -> + full_path = Path.join(path, file) + File.read!(full_path) + end) + + {:ok, modules} end @doc """ diff --git a/lib/sidecar/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex index 2f47d54b..99fb5882 100644 --- a/lib/sidecar/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -3,24 +3,35 @@ defmodule Sidecar.GRPC.Supervisor do use Supervisor require Logger + alias Actors.Config.PersistentTermConfig, as: Config alias Sidecar.GRPC.CodeGenerator, as: Generator def init(opts) do Logger.info("Starting gRPC Server...") - Application.put_env(:grpc, :start_server, true, persistent: true) - case Generator.compile_protos() do - :ok -> - Generator.load_modules(opts) - |> Generator.compile_modules() + with :ok <- Generator.compile_protos(), + {:ok, modules} <- Generator.load_modules(opts), + :ok <- Generator.compile_modules(modules) do + children = [ + {GrpcReflection, []}, + {GRPC.Server.Supervisor, + endpoint: Sidecar.GRPC.ProxyEndpoint, port: Config.get(:grpc_port), start_server: true} + ] + Supervisor.init(children, strategy: :one_for_one) + else error -> raise ArgumentError, "Failed to load ActorHost protobufs modules. Details: #{inspect(error)}" end + end - children = [] - - Supervisor.init(children, strategy: :rest_for_one) + def start_link(opts) do + Supervisor.start_link( + __MODULE__, + opts, + name: __MODULE__, + strategy: :one_for_one + ) end end diff --git a/lib/sidecar/supervisor.ex b/lib/sidecar/supervisor.ex index 6fb032eb..6788e8ed 100644 --- a/lib/sidecar/supervisor.ex +++ b/lib/sidecar/supervisor.ex @@ -13,7 +13,8 @@ defmodule Sidecar.Supervisor do [ supervisor_process_logger(__MODULE__), {Sidecar.GracefulShutdown, opts}, - {Sidecar.ProcessSupervisor, opts} + {Sidecar.ProcessSupervisor, opts}, + {Sidecar.GRPC.Supervisor, opts} ] |> Enum.reject(&is_nil/1) diff --git a/priv/templates/grpc_endpoint.ex.eex b/priv/templates/grpc_endpoint.ex.eex deleted file mode 100644 index 942c7b36..00000000 --- a/priv/templates/grpc_endpoint.ex.eex +++ /dev/null @@ -1,16 +0,0 @@ -defmodule Massa.Server.Grpc.ProxyEndpoint do - @moduledoc false - use GRPC.Endpoint - - intercept(GRPC.Logger.Server) - # intercept(GRPCPrometheus.ServerInterceptor) - - services = [ - MassProxy.Reflection.Service, -<%= Enum.map service_names, fn(service_name) -> %> - <%= service_name %>, -<% end %> - ] - - run(services) -end \ No newline at end of file diff --git a/priv/templates/grpc_service.ex.eex b/priv/templates/grpc_service.ex.eex deleted file mode 100644 index 58b4c00a..00000000 --- a/priv/templates/grpc_service.ex.eex +++ /dev/null @@ -1,30 +0,0 @@ -defmodule <%= mod_name %>.ProxyService do - @moduledoc """ - This <%= mod_name %>.ProxyService module only passes - incoming gRPC requests to the respective Entity handlers. - - """ - @moduledoc since: "1.2.1" - - use GRPC.Server, service: <%= name %> - - alias MassaProxy.Runtime - -<%= Enum.map methods, fn(method) -> %> - @spec <%= method %>(<%= Map.get(input_types, method) %>.t(), GRPC.Server.Stream.t()) :: <%= Map.get(output_types, method) %>.t() - def <%= method %>(message, stream) do - Runtime.forward(%{ - service_name: "<%= service_name %>", - entity_type: "<%= entity_type %>", - persistence_id: "<%= persistence_id %>", - original_method: "<%= Map.get(original_methods, method) %>", - message: message, - stream: stream, - input_type: <%= Map.get(input_types, method) %>, - output_type: <%= Map.get(output_types, method) %>, - request_type: "<%= Map.get(request_types, method) %>" - }) - end -<% end %> - -end \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/actor.proto b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/actor.proto new file mode 100644 index 00000000..9e72b0ca --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/actor.proto @@ -0,0 +1,169 @@ +syntax = "proto3"; + +package eigr.functions.protocol.actors; + +import "google/protobuf/any.proto"; + +option java_package = "io.eigr.functions.protocol.actors"; +option go_package = "github.com/eigr/go-support/eigr/actors;actors"; + +message Registry { + map actors = 1; +} + +message ActorSystem { + string name = 1; + Registry registry = 2; +} + +// A strategy for save state. +message ActorSnapshotStrategy { + oneof strategy { + // the timeout strategy. + TimeoutStrategy timeout = 1; + } +} + +// A strategy which a user function's entity is passivated. +message ActorDeactivationStrategy { + oneof strategy { + // the timeout strategy. + TimeoutStrategy timeout = 1; + } +} + +// A strategy based on a timeout. +message TimeoutStrategy { + // The timeout in millis + int64 timeout = 1; +} + +// A action represents an action that the user can perform on an Actor. +// Actions in supporting languages are represented by functions or methods. +// An Actor action has nothing to do with the semantics of Actions in a CQRS/EventSourced system. +// It just represents an action that supporting languages can invoke. +message Action { + + // The name of the function or method in the supporting language that has been registered in Ator. + string name = 1; +} + +// A FixedTimerAction is similar to a regular Action, its main differences are that it is scheduled to run at regular intervals +// and only takes the actor's state as an argument. +// Timer Actions are good for executing loops that manipulate the actor's own state. +// In Elixir or other languages in BEAM it would be similar to invoking Process.send_after(self(), atom, msg, timeout) +message FixedTimerAction { + + // The time to wait until the action is triggered + int32 seconds = 1; + + // See Action description Above + Action action = 2; +} + +message ActorState { + map tags = 1; + google.protobuf.Any state = 2; +} + +// Metadata represents a set of key-value pairs that can be used to +// provide additional information about an Actor. +message Metadata { + // A channel group represents a way to send actions to various actors + // that belong to a certain semantic group. Following the Pub-Sub pattern. + repeated Channel channel_group = 1; + + map tags = 2; +} + +// Represents a Pub-Sub binding, where a actor can be subscribed to a channel +// and map a specific action to a specific topic if necessary +// if the action is not informed, the default action will be "receive". +message Channel { + string topic = 1; + string action = 2; +} + +// The type that defines the runtime characteristics of the Actor. +// Regardless of the type of actor it is important that +// all actors are registered during the proxy and host initialization phase. +enum Kind { + // When no type is informed, the default to be assumed will be the Named pattern. + UNKNOW_KIND = 0; + + // NAMED actors as the name suggests have only one real instance of themselves running + // during their entire lifecycle. That is, they are the opposite of the UNNAMED type Actors. + NAMED = 1; + + // UNNAMED actors are used to create children of this based actor at runtime + UNNAMED = 2; + + // Pooled Actors are similar to Unnamed actors, but unlike them, + // their identifying name will always be the one registered at the system initialization stage. + // The great advantage of Pooled actors is that they have multiple instances of themselves + // acting as a request service pool. + // Pooled actors are also stateless actors, that is, they will not have their + // in-memory state persisted via Statesstore. This is done to avoid problems + // with the correctness of the stored state. + // Pooled Actors are generally used for tasks where the Actor Model would perform worse + // than other concurrency models and for tasks that do not require state concerns. + // Integration flows, data caching, proxies are good examples of use cases + // for this type of Actor. + POOLED = 3; + + // Reserved for future use + PROXY = 4; +} + +message ActorSettings { + + // Indicates the type of Actor to be configured. + Kind kind = 1; + + // Indicates whether an actor's state should be persisted in a definitive store. + bool stateful = 2; + + // Snapshot strategy + ActorSnapshotStrategy snapshot_strategy = 3; + + // Deactivate strategy + ActorDeactivationStrategy deactivation_strategy = 4; + + // When kind is POOLED this is used to define minimun actor instances + int32 min_pool_size = 5; + + // When kind is POOLED this is used to define maximum actor instances + int32 max_pool_size = 6; +} + +message ActorId { + // The name of a Actor Entity. + string name = 1; + + // Name of a ActorSystem + string system = 2; + + // When the Actor is of the Unnamed type, + // the name of the parent Actor must be informed here. + string parent = 3; +} + +message Actor { + // Actor Identification + ActorId id = 1; + + // A Actor state. + ActorState state = 2; + + // Actor metadata + Metadata metadata = 6; + + // Actor settings. + ActorSettings settings = 3; + + // The actions registered for an actor + repeated Action actions = 4; + + // The registered timer actions for an actor. + repeated FixedTimerAction timer_actions = 5; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/protocol.proto b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/protocol.proto new file mode 100644 index 00000000..90794567 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/protocol.proto @@ -0,0 +1,452 @@ +// The Spawn Protocol +// +// Spawn is divided into two main parts namely: +// +// 1. A sidecar proxy that exposes the server part of the Spawn Protocol in the form of an HTTP API. +// 2. A user function, written in any language that supports HTTP, that exposes the client part of the Spawn Protocol. +// +// Both are client and server of their counterparts. +// +// In turn, the proxy exposes an HTTP endpoint for registering a user function a.k.a ActorSystem. +// +// A user function that wants to register actors in Proxy Spawn must proceed by making a POST request to the following endpoint: +// +// ` +// POST /api/v1/system HTTP 1.1 +// HOST: localhost +// User-Agent: user-function-client/0.1.0 (this is just example) +// Accept: application/octet-stream +// Content-Type: application/octet-stream +// +// registration request type bytes encoded here :-) +// ` +// +// The general flow of a registration action is as follows: +// +//╔═══════════════════╗ ╔═══════════════════╗ ╔═══════════════════╗ +//║ User Function ║ ║Local Spawn Sidecar║ ║ Actor ║ +//╚═══════════════════╝ ╚═══════════════════╝ ╚═══════════════════╝ +// ║ ║ ║ +// ║ ║ ║ +// ║ HTTP POST ║ ║ +// ║ Registration ║ ║ +// ║ Request ║ ║ +// ╠─────────────────────────────────────▶║ ║ +// ║ ║ Upfront start Actors with ║ +// ║ ╠───────BEAM Distributed Protocol─────▶║ +// ║ ║ ║ +// ║ ║ ╠───┐Initialize +// ║ ║ ║ │ State +// ║ ║ ║ │ Store +// ║ ║ ║◀──┘ +// ║ HTTP Registration ║ ║ +// ║ Response ║ ║ +// ║◀─────────────────────────────────────╣ ║ +// ║ ║ ║ +// ║ ║ ║ +// ║ ║ ║ +// ║ ║ ║ +// ║ ║ ║ +// ║ ║ ║ +// ║ ║ ║ +// ║ ║ ║ +// +// ███████████ ███████████ ███████████ +// +// +// ## Spawning Actors +// +// Actors are usually created at the beginning of the SDK's communication flow with the Proxy by the registration step described above. +// However, some use cases require that Actors can be created ***on the fly***. +// In other words, Spawn is used to bring to life Actors previously registered as Unnameds, giving them a name and thus creating a concrete instance +// at runtime for that Actor. Actors created with the Spawn feature are generally used when you want to share a behavior while maintaining +// the isolation characteristics of the actors. +// For these situations we have the Spawning flow described below. +// +// A user function that wants to Spawning new Actors in Proxy Spawn must proceed by making a POST request to the following endpoint: +// +// ``` +// POST /system/:system_name/actors/spawn HTTP 1.1 +// HOST: localhost +// User-Agent: user-function-client/0.1.0 (this is just example) +// Accept: application/octet-stream +// Content-Type: application/octet-stream +// +// SpawnRequest type bytes encoded here :-) +// ``` +// +// The general flow of a Spawning Actors is as follows: +// +// ``` +// +----------------+ +---------------------+ +-------+ +// | User Function | | Local Spawn Sidecar | | Actor | +// +----------------+ +---------------------+ +-------+ +// | | | +// | HTTP POST SpawnRequest | | +// |------------------------------------------------------>| | +// | | | +// | | Upfront start Actors with BEAM Distributed Protocol | +// | |---------------------------------------------------->| +// | | | +// | | |Initialize Statestore +// | | |---------------------- +// | | | | +// | | |<--------------------- +// | | | +// | HTTP SpawnResponse | | +// |<------------------------------------------------------| | +// | | | +// ``` +// +// Once the system has been initialized, that is, the registration step has been successfully completed, +// then the user function will be able to make requests to the System Actors. +// This is done through a post request to the Proxy at the `/system/:name/actors/:actor_name/invoke` endpoint. +// +// A user function that wants to call actors in Proxy Spawn must proceed by making a POST request as the follow: +// +// ` +// POST /system/:name/actors/:actor_name/invoke HTTP 1.1 +// HOST: localhost +// User-Agent: user-function-client/0.1.0 (this is just example) +// Accept: application/octet-stream +// Content-Type: application/octet-stream +// +// invocation request type bytes encoded here :-) +// ` +// +// Assuming that two user functions were registered in different separate Proxies, the above request would go the following way: +// +//╔═══════════════════╗ ╔═══════════════════╗ ╔═════════════════════════╗ ╔═════════════════════════════╗ +//║ User Function ║ ║Local Spawn Sidecar║ ║ Remote User Function B ║ ║Remote Spawn Sidecar/Actor B ║ +//╚═══════════════════╝ ╚═══════════════════╝ ╚═════════════════════════╝ ╚═════════════════════════════╝ +// ║ HTTP POST ║ ║ ║ +// ║ Registration ║ ║ ║ +// ║ Request ║ ║ ║ +// ╠─────────────────────────────────────▶║ ║ ║ +// ║ ╠───┐ ║ ║ +// ║ ║ │Lookup for ║ ║ +// ║ ║ │ Actor ║ ║ +// ║ ║◀──┘ ║ ║ +// ║ ║ ║ BEAM Distributed ║ +// ║ ╠─────────────────────────────────────╬────────────protocol call──────────▶║ +// ║ ║ ║ ║ +// ║ ║ ║ HTTP POST: ║ +// ║ ║ ║◀──────/api/v1/actors/actions───────╣ +// ║ ║ ║ ║ +// ║ ║ ╠───┐ ║ +// ║ ║ ║ │Handle request, ║ +// ║ ║ ║ │execute action ║ +// ║ ║ ║◀──┘ ║ +// ║ ║ ║ Reply with the ║ +// ║ ║ ╠────────────result and the ────────▶║ +// ║ ║ ║ new state of ║────┐ +// ║ ║ ║ ║ │ +// ║ ║ ║ ║ │Store new State +// ║ ║ Send response to the ║ ║ ◀──┘ +// ║ Respond to user with ║◀─────────Spawn Sidecar A────────────╬────────────────────────────────────╣ +// ║ result value ║ ║ ║ +// ║◀─────────────────────────────────────╣ ║ ║ +// ║ ║ ║ ║ +// ║ ║ ║ ║ +// +// ███████████ ████████████ ███████████ ███████████ +// +// +syntax = "proto3"; + +package eigr.functions.protocol; + +import "eigr/functions/protocol/actors/actor.proto"; +import "google/protobuf/any.proto"; + +option java_package = "io.eigr.functions.protocol"; +option go_package = "github.com/eigr/go-support/eigr/protocol;protocol"; + +// Context is where current and/or updated state is stored +// to be transmitted to/from proxy and user function +// +// Params: +// * state: Actor state passed back and forth between proxy and user function. +// * metadata: Meta information that comes in invocations +// * tags: Meta information stored in the actor +// * caller: ActorId of who is calling target actor +// * self: ActorId of itself +message Context { + + google.protobuf.Any state = 1; + + map metadata = 4; + + map tags = 5; + + // Who is calling target actor + eigr.functions.protocol.actors.ActorId caller = 2; + + // The target actor itself + eigr.functions.protocol.actors.ActorId self = 3; +} + +// Noop is used when the input or output value of a function or method +// does not matter to the caller of a Workflow or when the user just wants to receive +// the Context in the request, that is, +// he does not care about the input value only with the state. +message Noop {} + +// JSON is an alternative that some SDKs can opt in +// it will bypass any type validation in spawn actors state / payloads +message JSONType { + string content = 1; +} + +message RegistrationRequest { + + ServiceInfo service_info = 1; + + eigr.functions.protocol.actors.ActorSystem actor_system = 2; +} + +message RegistrationResponse { + + RequestStatus status = 1; + + ProxyInfo proxy_info = 2; +} + +message ServiceInfo { + + // The name of the actor system, eg, "my-actor-system". + string service_name = 1; + + // The version of the service. + string service_version = 2; + + // A description of the runtime for the service. Can be anything, but examples might be: + // - node v10.15.2 + // - OpenJDK Runtime Environment 1.8.0_192-b12 + string service_runtime = 3; + + // If using a support library, the name of that library, eg "spawn-jvm" + string support_library_name = 4; + + // The version of the support library being used. + string support_library_version = 5; + + // Spawn protocol major version accepted by the support library. + int32 protocol_major_version = 6; + + // Spawn protocol minor version accepted by the support library. + int32 protocol_minor_version = 7; +} + +message SpawnRequest { + repeated eigr.functions.protocol.actors.ActorId actors = 1; +} + +message SpawnResponse { + RequestStatus status = 1; +} + +message ProxyInfo { + + int32 protocol_major_version = 1; + + int32 protocol_minor_version = 2; + + string proxy_name = 3; + + string proxy_version = 4; +} + +// When a Host Function is invoked it returns the updated state and return value to the call. +// It can also return a number of side effects to other Actors as a result of its computation. +// These side effects will be forwarded to the respective Actors asynchronously and should not affect the Host Function's response to its caller. +// Internally side effects is just a special kind of InvocationRequest. +// Useful for handle handle `recipient list` and `Composed Message Processor` patterns: +// https://www.enterpriseintegrationpatterns.com/patterns/messaging/RecipientList.html +// https://www.enterpriseintegrationpatterns.com/patterns/messaging/DistributionAggregate.html +message SideEffect { + InvocationRequest request = 1; +} + +// Broadcast a message to many Actors +// Useful for handle `recipient list`, `publish-subscribe channel`, and `scatter-gatther` patterns: +// https://www.enterpriseintegrationpatterns.com/patterns/messaging/RecipientList.html +// https://www.enterpriseintegrationpatterns.com/patterns/messaging/PublishSubscribeChannel.html +// https://www.enterpriseintegrationpatterns.com/patterns/messaging/BroadcastAggregate.html +message Broadcast { + // Target topic or channel + string channel_group = 1; + + // Payload + oneof payload { + google.protobuf.Any value = 3; + Noop noop = 4; + } +} + +// Sends the output of a action of an Actor to the input of another action of an Actor +// Useful for handle `pipes` pattern: +// https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html +message Pipe { + // Target Actor + string actor = 1; + + // Action. + string action_name = 2; +} + +// Sends the input of a action of an Actor to the input of another action of an Actor +// Useful for handle `content-basead router` pattern +// https://www.enterpriseintegrationpatterns.com/patterns/messaging/ContentBasedRouter.html +message Forward { + // Target Actor + string actor = 1; + + // Action. + string action_name = 2; +} + +// Container for archicetural message patterns +message Workflow { + + Broadcast broadcast = 2; + + repeated SideEffect effects = 1; + + oneof routing { + Pipe pipe = 3; + Forward forward = 4; + } +} + +// The user function when it wants to send a message to an Actor uses the InvocationRequest message type. +// +// Params: +// * system: See ActorSystem message. +// * actor: The target Actor, i.e. the one that the user function is calling to perform some computation. +// * caller: The caller Actor +// * action_name: The function or method on the target Actor that will receive this request +// and perform some useful computation with the sent data. +// * value: This is the value sent by the user function to be computed by the request's target Actor action. +// * async: Indicates whether the action should be processed synchronously, where a response should be sent back to the user function, +// or whether the action should be processed asynchronously, i.e. no response sent to the caller and no waiting. +// * metadata: Meta information or headers +// * register_ref: If the invocation should register the specific actor with the given name without having to call register before +message InvocationRequest { + + eigr.functions.protocol.actors.ActorSystem system = 1; + + eigr.functions.protocol.actors.Actor actor = 2; + + string action_name = 3; + + oneof payload { + google.protobuf.Any value = 4; + Noop noop = 7; + } + + bool async = 5; + + eigr.functions.protocol.actors.ActorId caller = 6; + + map metadata = 8; + + int64 scheduled_to = 9; + + bool pooled = 10; + + string register_ref = 11; +} + +// ActorInvocation is a translation message between a local invocation made via InvocationRequest +// and the real Actor that intends to respond to this invocation and that can be located anywhere in the cluster. +// +// Params: +// * actor: The ActorId handling the InvocationRequest request, also called the target Actor. +// * action_name: The function or method on the target Actor that will receive this request +// and perform some useful computation with the sent data. +// * current_context: The current Context with current state value of the target Actor. +// That is, the same as found via matching in %Actor{name: target_actor, state: %ActorState{state: value} = actor_state}. +// In this case, the Context type will contain in the value attribute the same `value` as the matching above. +// * payload: The value to be passed to the function or method corresponding to action_name. +message ActorInvocation { + + eigr.functions.protocol.actors.ActorId actor = 1; + + string action_name = 2; + + Context current_context = 3; + + oneof payload { + google.protobuf.Any value = 4; + Noop noop = 5; + } + + eigr.functions.protocol.actors.ActorId caller = 6; +} + +// The user function's response after executing the action originated by the local proxy request via ActorInvocation. +// +// Params: +// actor_name: The name of the Actor handling the InvocationRequest request, also called the target Actor. +// actor_system: The name of ActorSystem registered in Registration step. +// updated_context: The Context with updated state value of the target Actor after user function has processed a request. +// value: The value that the original request proxy will forward in response to the InvocationRequest type request. +// This is the final response from the point of view of the user who invoked the Actor call and its subsequent processing. +message ActorInvocationResponse { + + string actor_name = 1; + + string actor_system = 2; + + Context updated_context = 3; + + oneof payload { + google.protobuf.Any value = 4; + Noop noop = 6; + } + + Workflow workflow = 5; + + bool checkpoint = 7; +} + +// InvocationResponse is the response that the proxy that received the InvocationRequest request will forward to the request's original user function. +// +// Params: +// status: Status of request. Could be one of [UNKNOWN, OK, ACTOR_NOT_FOUND, ERROR]. +// system: The original ActorSystem of the InvocationRequest request. +// actor: The target Actor originally sent in the InvocationRequest message. +// value: The value resulting from the request processing that the target Actor made. +// This value must be passed by the user function to the one who requested the initial request in InvocationRequest. +message InvocationResponse { + + RequestStatus status = 1; + + eigr.functions.protocol.actors.ActorSystem system = 2; + + eigr.functions.protocol.actors.Actor actor = 3; + + oneof payload { + google.protobuf.Any value = 4; + Noop noop = 5; + } +} + +enum Status { + + UNKNOWN = 0; + + OK = 1; + + ACTOR_NOT_FOUND = 2; + + ERROR = 3; +} + +message RequestStatus { + + Status status = 1; + + string message = 2; +} diff --git a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/state.proto b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/state.proto new file mode 100644 index 00000000..ddfbe43a --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/state.proto @@ -0,0 +1,28 @@ +// The Spawn State Extension Protocol +// +// +syntax = "proto3"; + +package eigr.functions.protocol.state; + +import "eigr/functions/protocol/actors/actor.proto"; + +option java_package = "io.eigr.functions.protocol.state"; +option go_package = "github.com/eigr/go-support/eigr/protocol/state;state"; + +// A revision is just a version number for a record in the snapshot table that stores the actors' state. +// When an actor has its snaphost timeout, it increments its internal revision number and saves it along with its internal data. +// Some of the persistence adapters can use this revision number to find the state of an Actor at a given point in time. +// As Actors in Spawn persist their internal data as snapshots from time to time a revision number may not indicate the state of a given change +// but will most likely point to the exact time that a given actor's internal state was persisted into the database. +message Revision { + int64 value = 1; +} + +// A checkpoint encapsulates a revision and the state it represents. +message Checkpoint { + + Revision revision = 1; + + eigr.functions.protocol.actors.ActorState state = 2; +} diff --git a/spawn_proxy/proxy/priv/protos/google/api/annotations.proto b/spawn_proxy/proxy/priv/protos/google/api/annotations.proto new file mode 100644 index 00000000..efdab3db --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/spawn_proxy/proxy/priv/protos/google/api/http.proto b/spawn_proxy/proxy/priv/protos/google/api/http.proto new file mode 100644 index 00000000..113fa936 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/any.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/any.proto new file mode 100644 index 00000000..016ee66d --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/any.proto @@ -0,0 +1,158 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/api.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/api.proto new file mode 100644 index 00000000..13d287ca --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/api.proto @@ -0,0 +1,207 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/apipb"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inherting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/descriptor.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/descriptor.proto new file mode 100644 index 00000000..6805b9b4 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/descriptor.proto @@ -0,0 +1,1223 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// The full set of known editions. +enum Edition { + // A placeholder for an unknown edition value. + EDITION_UNKNOWN = 0; + + // Legacy syntax "editions". These pre-date editions, but behave much like + // distinct editions. These can't be used to specify the edition of proto + // files, but feature definitions must supply proto2/proto3 defaults for + // backwards compatibility. + EDITION_PROTO2 = 998; + EDITION_PROTO3 = 999; + + // Editions that have been released. The specific values are arbitrary and + // should not be depended on, but they will always be time-ordered for easy + // comparison. + EDITION_2023 = 1000; + EDITION_2024 = 1001; + + // Placeholder editions for testing feature resolution. These should not be + // used or relyed on outside of tests. + EDITION_1_TEST_ONLY = 1; + EDITION_2_TEST_ONLY = 2; + EDITION_99997_TEST_ONLY = 99997; + EDITION_99998_TEST_ONLY = 99998; + EDITION_99999_TEST_ONLY = 99999; + + // Placeholder for specifying unbounded edition support. This should only + // ever be used by plugins that can expect to never require any changes to + // support a new edition. + EDITION_MAX = 0x7FFFFFFF; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2", "proto3", and "editions". + // + // If `edition` is present, this value must be "editions". + optional string syntax = 12; + + // The edition of the proto file. + optional Edition edition = 14; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + message Declaration { + // The extension number declared within the extension range. + optional int32 number = 1; + + // The fully-qualified name of the extension field. There must be a leading + // dot in front of the full name. + optional string full_name = 2; + + // The fully-qualified type name of the extension field. Unlike + // Metadata.type, Declaration.type must have a leading dot for messages + // and enums. + optional string type = 3; + + // If true, indicates that the number is reserved in the extension range, + // and any extension field with the number will fail to compile. Set this + // when a declared extension field is deleted. + optional bool reserved = 5; + + // If true, indicates that the extension must be defined as repeated. + // Otherwise the extension must be defined as optional. + optional bool repeated = 6; + + reserved 4; // removed is_repeated + } + + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. + repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The verification state of the extension range. + enum VerificationState { + // All the extensions of the range must be declared. + DECLARATION = 0; + UNVERIFIED = 1; + } + + // The verification state of the range. + // TODO: flip the default to DECLARATION once all empty ranges + // are marked as UNVERIFIED. + optional VerificationState verification = 3 + [default = UNVERIFIED, retention = RETENTION_SOURCE]; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported after google.protobuf. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. In Editions, the group wire format + // can be enabled via the `message_encoding` feature. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REPEATED = 3; + // The required label is only allowed in google.protobuf. In proto3 and Editions + // it's explicitly prohibited. In Editions, the `field_presence` feature + // can be used to get this behavior. + LABEL_REQUIRED = 2; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must belong to a oneof to signal + // to old proto3 clients that presence is tracked for this field. This oneof + // is known as a "synthetic" oneof, and this field must be its sole member + // (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + // exist in the descriptor only, and do not generate any API. Synthetic oneofs + // must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. + optional string java_outer_classname = 8; + + // If enabled, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // A proto2 file can set this to true to opt in to UTF-8 checking for Java, + // which will throw an exception if invalid UTF-8 is parsed from the wire or + // assigned to a string field. + // + // TODO: clarify exactly what kinds of field types this option + // applies to, and update these docs accordingly. + // + // Proto3 files already perform these checks. Setting the option explicitly to + // false has no effect: it cannot be used to opt proto3 files out of UTF-8 + // checks. + optional bool java_string_check_utf8 = 27 [default = false]; + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + reserved 42; // removed php_generic_services + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // + // This should only be used as a temporary measure against broken builds due + // to the change in behavior for JSON field name conflicts. + // + // TODO This is legacy behavior we plan to remove once downstream + // teams have had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + + // Any features defined in the specific edition. + optional FeatureSet features = 12; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is only implemented to support use of + // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + // type "bytes" in the open source release -- sorry, we'll try to include + // other types in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + // The option [ctype=CORD] may be applied to a non-repeated field of type + // "bytes". It indicates that in C++, the data should be stored in a Cord + // instead of a string. For very large strings, this may reduce memory + // fragmentation. It may also allow better performance when parsing from a + // Cord, or when parsing with aliasing enabled, as the parsed Cord may then + // alias the original buffer. + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. This option is prohibited in + // Editions, but the `repeated_field_encoding` feature can be used to control + // the behavior. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // Note that lazy message fields are still eagerly verified to check + // ill-formed wireformat or missing required fields. Calling IsInitialized() + // on the outer message would fail if the inner message has missing required + // fields. Failed verification would result in parsing failure (except when + // uninitialized messages are acceptable). + optional bool lazy = 5 [default = false]; + + // unverified_lazy does no correctness checks on the byte stream. This should + // only be used where lazy with verification is prohibitive for performance + // reasons. + optional bool unverified_lazy = 15 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + // Indicate that the field value should not be printed out when using debug + // formats, e.g. when the field contains sensitive credentials. + optional bool debug_redact = 16 [default = false]; + + // If set to RETENTION_SOURCE, the option will be omitted from the binary. + // Note: as of January 2023, support for this is in progress and does not yet + // have an effect (b/264593489). + enum OptionRetention { + RETENTION_UNKNOWN = 0; + RETENTION_RUNTIME = 1; + RETENTION_SOURCE = 2; + } + + optional OptionRetention retention = 17; + + // This indicates the types of entities that the field may apply to when used + // as an option. If it is unset, then the field may be freely used as an + // option on any kind of entity. Note: as of January 2023, support for this is + // in progress and does not yet have an effect (b/264593489). + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0; + TARGET_TYPE_FILE = 1; + TARGET_TYPE_EXTENSION_RANGE = 2; + TARGET_TYPE_MESSAGE = 3; + TARGET_TYPE_FIELD = 4; + TARGET_TYPE_ONEOF = 5; + TARGET_TYPE_ENUM = 6; + TARGET_TYPE_ENUM_ENTRY = 7; + TARGET_TYPE_SERVICE = 8; + TARGET_TYPE_METHOD = 9; + } + + repeated OptionTargetType targets = 19; + + message EditionDefault { + optional Edition edition = 3; + optional string value = 2; // Textproto value. + } + repeated EditionDefault edition_defaults = 20; + + // Any features defined in the specific edition. + optional FeatureSet features = 21; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype + reserved 18; // reserve target, target_obsolete_do_not_use +} + +message OneofOptions { + // Any features defined in the specific edition. + optional FeatureSet features = 1; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // TODO Remove this legacy behavior once downstream teams have + // had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + + // Any features defined in the specific edition. + optional FeatureSet features = 7; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // Any features defined in the specific edition. + optional FeatureSet features = 2; + + // Indicate that fields annotated with this enum value should not be printed + // out when using debug formats, e.g. when the field contains sensitive + // credentials. + optional bool debug_redact = 3 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Any features defined in the specific edition. + optional FeatureSet features = 34; + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // Any features defined in the specific edition. + optional FeatureSet features = 35; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + // "foo.(bar.baz).moo". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Features + +// TODO Enums in C++ gencode (and potentially other languages) are +// not well scoped. This means that each of the feature enums below can clash +// with each other. The short names we've chosen maximize call-site +// readability, but leave us very open to this scenario. A future feature will +// be designed and implemented to handle this, hopefully before we ever hit a +// conflict here. +message FeatureSet { + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0; + EXPLICIT = 1; + IMPLICIT = 2; + LEGACY_REQUIRED = 3; + } + optional FieldPresence field_presence = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, + edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } + ]; + + enum EnumType { + ENUM_TYPE_UNKNOWN = 0; + OPEN = 1; + CLOSED = 2; + } + optional EnumType enum_type = 2 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" } + ]; + + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0; + PACKED = 1; + EXPANDED = 2; + } + optional RepeatedFieldEncoding repeated_field_encoding = 3 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" } + ]; + + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0; + VERIFY = 2; + NONE = 3; + } + optional Utf8Validation utf8_validation = 4 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "NONE" }, + edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" } + ]; + + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0; + LENGTH_PREFIXED = 1; + DELIMITED = 2; + } + optional MessageEncoding message_encoding = 5 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" } + ]; + + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0; + ALLOW = 1; + LEGACY_BEST_EFFORT = 2; + } + optional JsonFormat json_format = 6 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" } + ]; + + reserved 999; + + extensions 1000; // for Protobuf C++ + extensions 1001; // for Protobuf Java + extensions 1002; // for Protobuf Go + + extensions 9995 to 9999; // For internal testing + extensions 10000; // for https://github.com/bufbuild/protobuf-es +} + +// A compiled specification for the defaults of a set of features. These +// messages are generated from FeatureSet extensions and can be used to seed +// feature resolution. The resolution with this object becomes a simple search +// for the closest matching edition, followed by proto merges. +message FeatureSetDefaults { + // A map from every known edition with a unique set of defaults to its + // defaults. Not all editions may be contained here. For a given edition, + // the defaults at the closest matching edition ordered at or before it should + // be used. This field must be in strict ascending order by edition. + message FeatureSetEditionDefault { + optional Edition edition = 3; + optional FeatureSet features = 2; + } + repeated FeatureSetEditionDefault defaults = 1; + + // The minimum supported edition (inclusive) when this was constructed. + // Editions before this will not have defaults. + optional Edition minimum_edition = 4; + + // The maximum known edition (inclusive) when this was constructed. Editions + // after this will not have reliable defaults. + optional Edition maximum_edition = 5; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition appears. + // For example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to moo. + // // + // // Another line attached to moo. + // optional double moo = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to moo or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified object. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + + // Represents the identified object's effect on the element in the original + // .proto file. + enum Semantic { + // There is no effect or the effect is indescribable. + NONE = 0; + // The element is set or otherwise mutated. + SET = 1; + // An alias to the element is returned. + ALIAS = 2; + } + optional Semantic semantic = 5; + } +} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/duration.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/duration.proto new file mode 100644 index 00000000..a0d91df0 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/duration.proto @@ -0,0 +1,115 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/durationpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/empty.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/empty.proto new file mode 100644 index 00000000..22274621 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/empty.proto @@ -0,0 +1,51 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/emptypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +message Empty {} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/field_mask.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/field_mask.proto new file mode 100644 index 00000000..fbdda56e --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/source_context.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/source_context.proto new file mode 100644 index 00000000..fe5415a4 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/struct.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/struct.proto new file mode 100644 index 00000000..e07e3435 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of these +// variants. Absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/timestamp.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/timestamp.proto new file mode 100644 index 00000000..184a18f8 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/timestamp.proto @@ -0,0 +1,144 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/type.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/type.proto new file mode 100644 index 00000000..ae720d48 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/type.proto @@ -0,0 +1,193 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/typepb"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 7; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + } + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 6; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; + // Syntax `editions`. + SYNTAX_EDITIONS = 2; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/wrappers.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/wrappers.proto new file mode 100644 index 00000000..6c4b5ac6 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/grpc/reflection/v1alpha/reflection.proto b/spawn_proxy/proxy/priv/protos/grpc/reflection/v1alpha/reflection.proto new file mode 100644 index 00000000..462e85a2 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/grpc/reflection/v1alpha/reflection.proto @@ -0,0 +1,136 @@ +// Copyright 2016 gRPC authors. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Service exported by server reflection + +syntax = "proto3"; + +package grpc.reflection.v1alpha; + +service ServerReflection { + // The reflection service is structured as a bidirectional stream, ensuring + // all related requests go to a single server. + rpc ServerReflectionInfo(stream ServerReflectionRequest) + returns (stream ServerReflectionResponse); +} + +// The message sent by the client when calling ServerReflectionInfo method. +message ServerReflectionRequest { + string host = 1; + // To use reflection service, the client should set one of the following + // fields in message_request. The server distinguishes requests by their + // defined field and then handles them using corresponding methods. + oneof message_request { + // Find a proto file by the file name. + string file_by_filename = 3; + + // Find the proto file that declares the given fully-qualified symbol name. + // This field should be a fully-qualified symbol name + // (e.g. .[.] or .). + string file_containing_symbol = 4; + + // Find the proto file which defines an extension extending the given + // message type with the given field number. + ExtensionRequest file_containing_extension = 5; + + // Finds the tag numbers used by all known extensions of the given message + // type, and appends them to ExtensionNumberResponse in an undefined order. + // Its corresponding method is best-effort: it's not guaranteed that the + // reflection service will implement this method, and it's not guaranteed + // that this method will provide all extensions. Returns + // StatusCode::UNIMPLEMENTED if it's not implemented. + // This field should be a fully-qualified type name. The format is + // . + string all_extension_numbers_of_type = 6; + + // List the full names of registered services. The content will not be + // checked. + string list_services = 7; + } +} + +// The type name and extension number sent by the client when requesting +// file_containing_extension. +message ExtensionRequest { + // Fully-qualified type name. The format should be . + string containing_type = 1; + int32 extension_number = 2; +} + +// The message sent by the server to answer ServerReflectionInfo method. +message ServerReflectionResponse { + string valid_host = 1; + ServerReflectionRequest original_request = 2; + // The server set one of the following fields accroding to the message_request + // in the request. + oneof message_response { + // This message is used to answer file_by_filename, file_containing_symbol, + // file_containing_extension requests with transitive dependencies. As + // the repeated label is not allowed in oneof fields, we use a + // FileDescriptorResponse message to encapsulate the repeated fields. + // The reflection service is allowed to avoid sending FileDescriptorProtos + // that were previously sent in response to earlier requests in the stream. + FileDescriptorResponse file_descriptor_response = 4; + + // This message is used to answer all_extension_numbers_of_type requst. + ExtensionNumberResponse all_extension_numbers_response = 5; + + // This message is used to answer list_services request. + ListServiceResponse list_services_response = 6; + + // This message is used when an error occurs. + ErrorResponse error_response = 7; + } +} + +// Serialized FileDescriptorProto messages sent by the server answering +// a file_by_filename, file_containing_symbol, or file_containing_extension +// request. +message FileDescriptorResponse { + // Serialized FileDescriptorProto messages. We avoid taking a dependency on + // descriptor.proto, which uses proto2 only features, by making them opaque + // bytes instead. + repeated bytes file_descriptor_proto = 1; +} + +// A list of extension numbers sent by the server answering +// all_extension_numbers_of_type request. +message ExtensionNumberResponse { + // Full name of the base type, including the package name. The format + // is . + string base_type_name = 1; + repeated int32 extension_number = 2; +} + +// A list of ServiceResponse sent by the server answering list_services request. +message ListServiceResponse { + // The information of each service may be expanded in the future, so we use + // ServiceResponse message to encapsulate it. + repeated ServiceResponse service = 1; +} + +// The information of a single service used by ListServiceResponse to answer +// list_services request. +message ServiceResponse { + // Full name of a registered service, including its package name. The format + // is . + string name = 1; +} + +// The error code and error message sent by the server when an error occurs. +message ErrorResponse { + // This field uses the error codes defined in grpc::StatusCode. + int32 error_code = 1; + string error_message = 2; +} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/helloworld.proto b/spawn_proxy/proxy/priv/protos/helloworld.proto new file mode 100644 index 00000000..47aa9793 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/helloworld.proto @@ -0,0 +1,47 @@ +syntax = "proto3"; + +option java_multiple_files = true; +option java_package = "io.grpc.examples.helloworld"; +option java_outer_classname = "HelloWorldProto"; +option objc_class_prefix = "HLW"; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +package helloworld; + +// The greeting service definition. +service GreeterService { + // Sends a greeting + rpc SayHello (HelloRequest) returns (HelloReply) { + option (google.api.http) = { + get: "/v1/greeter/{name}" + }; + } + + rpc SayHelloFrom (HelloRequestFrom) returns (HelloReply) { + option (google.api.http) = { + post: "/v1/greeter" + body: "*" + }; + } +} + +// The request message containing the user's name. +message HelloRequest { + string name = 1; +} + +// HelloRequestFrom! +message HelloRequestFrom { + // Name! + string name = 1; + // From! + string from = 2; +} + +// The response message containing the greetings +message HelloReply { + string message = 1; + google.protobuf.Timestamp today = 2; +} diff --git a/spawn_proxy/proxy/priv/protos/io/cloudevents/v1/spec.proto b/spawn_proxy/proxy/priv/protos/io/cloudevents/v1/spec.proto new file mode 100644 index 00000000..230a8ef9 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/io/cloudevents/v1/spec.proto @@ -0,0 +1,59 @@ +/** + * CloudEvent Protobuf Format + * + * - Required context attributes are explicitly represented. + * - Optional and Extension context attributes are carried in a map structure. + * - Data may be represented as binary, text, or protobuf messages. + */ + + syntax = "proto3"; + + package io.cloudevents.v1; + + import "google/protobuf/any.proto"; + import "google/protobuf/timestamp.proto"; + + option go_package = "cloudevents.io/genproto/v1"; + option java_package = "io.cloudevents.v1.proto"; + option java_multiple_files = true; + option php_namespace = "Io\\CloudEvents\\V1\\Proto"; + option ruby_package = "Io::CloudEvents::V1::Proto"; + + message CloudEvent { + + // -- CloudEvent Context Attributes + + // Required Attributes + string id = 1; + string source = 2; // URI-reference + string spec_version = 3; + string type = 4; + + // Optional & Extension Attributes + map attributes = 5; + + // -- CloudEvent Data (Bytes, Text, or Proto) + oneof data { + bytes binary_data = 6; + string text_data = 7; + google.protobuf.Any proto_data = 8; + } + + /** + * The CloudEvent specification defines + * seven attribute value types... + */ + + message CloudEventAttributeValue { + + oneof attr { + bool ce_boolean = 1; + int32 ce_integer = 2; + string ce_string = 3; + bytes ce_bytes = 4; + string ce_uri = 5; + string ce_uri_ref = 6; + google.protobuf.Timestamp ce_timestamp = 7; + } + } + } \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/modules/helloworld.pb.ex b/spawn_proxy/proxy/priv/protos/modules/helloworld.pb.ex new file mode 100644 index 00000000..e9633918 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos/modules/helloworld.pb.ex @@ -0,0 +1,848 @@ +defmodule Helloworld.HelloRequest do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "HelloRequest", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :name, 1, type: :string +end + +defmodule Helloworld.HelloRequestFrom do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "HelloRequestFrom", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "from", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "from", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :name, 1, type: :string + field :from, 2, type: :string +end + +defmodule Helloworld.HelloReply do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "HelloReply", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "message", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "message", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "today", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "today", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :message, 1, type: :string + field :today, 2, type: Google.Protobuf.Timestamp +end + +defmodule Helloworld.GreeterService.Service do + @moduledoc false + use GRPC.Service, name: "helloworld.GreeterService", protoc_gen_elixir_version: "0.12.0" + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.FileDescriptorProto{ + name: "helloworld.proto", + package: "helloworld", + dependency: ["google/api/annotations.proto", "google/protobuf/timestamp.proto"], + message_type: [ + %Google.Protobuf.DescriptorProto{ + name: "HelloRequest", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + }, + %Google.Protobuf.DescriptorProto{ + name: "HelloRequestFrom", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "from", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "from", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + }, + %Google.Protobuf.DescriptorProto{ + name: "HelloReply", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "message", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "message", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "today", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "today", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + ], + enum_type: [], + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "GreeterService", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "SayHello", + input_type: ".helloworld.HelloRequest", + output_type: ".helloworld.HelloReply", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [ + {72_295_728, 2, + <<18, 18, 47, 118, 49, 47, 103, 114, 101, 101, 116, 101, 114, 47, 123, 110, 97, + 109, 101, 125>>} + ] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + }, + %Google.Protobuf.MethodDescriptorProto{ + name: "SayHelloFrom", + input_type: ".helloworld.HelloRequestFrom", + output_type: ".helloworld.HelloReply", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [ + {72_295_728, 2, + <<34, 11, 47, 118, 49, 47, 103, 114, 101, 101, 116, 101, 114, 58, 1, 42>>} + ] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + } + ], + options: nil, + __unknown_fields__: [] + } + ], + extension: [], + options: %Google.Protobuf.FileOptions{ + java_package: "io.grpc.examples.helloworld", + java_outer_classname: "HelloWorldProto", + optimize_for: :SPEED, + java_multiple_files: true, + go_package: nil, + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + java_generate_equals_and_hash: nil, + deprecated: false, + java_string_check_utf8: false, + cc_enable_arenas: true, + objc_class_prefix: "HLW", + csharp_namespace: nil, + swift_prefix: nil, + php_class_prefix: nil, + php_namespace: nil, + php_generic_services: false, + php_metadata_namespace: nil, + ruby_package: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] + }, + source_code_info: %Google.Protobuf.SourceCodeInfo{ + location: [ + %Google.Protobuf.SourceCodeInfo.Location{ + path: [], + span: [0, 0, 46, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\f", + span: [0, 0, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [2, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\n", + span: [2, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [3, 0, 52], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [8, 1], + span: [3, 0, 52], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [4, 0, 48], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\b", + span: [4, 0, 48], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [5, 0, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b$", + span: [5, 0, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 0], + span: [7, 0, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 1], + span: [8, 0, 41], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [2], + span: [10, 0, 19], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0], + span: [13, 0, 27, 1], + leading_comments: " The greeting service definition.\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 1], + span: [13, 8, 22], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0], + span: [15, 2, 19, 3], + leading_comments: " Sends a greeting\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 1], + span: [15, 6, 14], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 2], + span: [15, 16, 28], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 3], + span: [15, 39, 49], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4], + span: [16, 4, 18, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4, 72_295_728], + span: [16, 4, 18, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1], + span: [21, 2, 26, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 1], + span: [21, 6, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 2], + span: [21, 20, 36], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 3], + span: [21, 47, 57], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4], + span: [22, 4, 25, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4, 72_295_728], + span: [22, 4, 25, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0], + span: [30, 0, 32, 1], + leading_comments: " The request message containing the user's name.\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 1], + span: [30, 8, 20], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0], + span: [31, 2, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 5], + span: [31, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 1], + span: [31, 9, 13], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 3], + span: [31, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1], + span: [35, 0, 40, 1], + leading_comments: " HelloRequestFrom!\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 1], + span: [35, 8, 24], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0], + span: [37, 2, 18], + leading_comments: " Name!\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 5], + span: [37, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 1], + span: ~c"%\t\r", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 3], + span: [37, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 1], + span: [39, 2, 18], + leading_comments: " From!\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 1, 5], + span: [39, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 1, 1], + span: ~c"'\t\r", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 1, 3], + span: [39, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2], + span: [43, 0, 46, 1], + leading_comments: " The response message containing the greetings\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 1], + span: [43, 8, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0], + span: [44, 2, 21], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 5], + span: [44, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 1], + span: [44, 9, 16], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 3], + span: [44, 19, 20], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1], + span: [45, 2, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 6], + span: [45, 2, 27], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 1], + span: [45, 28, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 3], + span: ~c"-$%", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + } + ], + __unknown_fields__: [] + }, + public_dependency: [], + weak_dependency: [], + syntax: "proto3", + edition: nil, + __unknown_fields__: [] + } + end + + rpc :SayHello, Helloworld.HelloRequest, Helloworld.HelloReply + + rpc :SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply +end + +defmodule Helloworld.GreeterService.ActorDispatcher do + @moduledoc since: "1.2.1" + use GRPC.Server, service: Helloworld.GreeterService + + alias Sidecar.GRPC.Dispatcher +end + +defmodule Sidecar.GRPC.ProxyEndpoint do + @moduledoc false + use GRPC.Endpoint + + intercept(GRPC.Server.Interceptors.Logger) + + services = [ + Helloworld.GreeterService.Service + ] + + run(services) +end + +defmodule Sidecar.GRPC.ServiceResolver do + @moduledoc since: "1.2.1" + + @actors [ + { + "GreeterService", + %{ + service_name: "Helloworld.GreeterService", + service_module: Helloworld.GreeterService.Service + } + } + ] + + def has_actor?(actor_name) do + Enum.any?(@actors, fn {name, _} -> actor_name == name end) + end + + def get_descriptor(actor_name) do + actor_attributes = + Enum.filter(@actors, fn {name, _} -> actor_name == name end) + |> Enum.map(fn {_name, attributes} -> attributes end) + |> List.first() + + mod = Map.get(actor_attributes, :service_module) + + mod.descriptor() + |> Map.get(:service) + |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> + actor_name == name + end) + |> List.first() + end +end + +defmodule Sidecar.GRPC.Reflection.Server do + @moduledoc since: "1.2.1" + use GrpcReflection.Server, + version: :v1, + services: [ + Helloworld.GreeterService.Service + ] +end \ No newline at end of file From b900d95cd5cd2b6279658a7c66f8d21a9192a57d Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 19 Feb 2024 12:42:27 -0300 Subject: [PATCH 12/48] Downgrade elixir version to just 1.15 --- .tool-versions | 2 +- config/config.exs | 2 +- lib/actors/config/persistent_term_config.ex | 19 +++++++++++++++++++ lib/sidecar/grpc/code_generator.ex | 15 ++++++++++----- mix.exs | 2 +- mix.lock | 2 +- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/.tool-versions b/.tool-versions index 2d812c27..dc8fa9ef 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -elixir 1.15.0-otp-25 +elixir 1.15 erlang 25.3.2.8 diff --git a/config/config.exs b/config/config.exs index 2737ec9f..df320d9d 100644 --- a/config/config.exs +++ b/config/config.exs @@ -74,4 +74,4 @@ config :mnesiac, schema_type: :disc_copies, table_load_timeout: 600_000 -import_config "#{config_env()}.exs" +#import_config "#{config_env()}.exs" diff --git a/lib/actors/config/persistent_term_config.ex b/lib/actors/config/persistent_term_config.ex index 38c63503..4ea646f1 100644 --- a/lib/actors/config/persistent_term_config.ex +++ b/lib/actors/config/persistent_term_config.ex @@ -28,6 +28,8 @@ if Code.ensure_loaded?(:persistent_term) do {:http_port, "9001"}, {:http_num_acceptors, "150"}, {:grpc_port, "9980"}, + {:grpc_http_transcoding_enabled, "true"}, + {:grpc_compiled_modules_path, "#{File.cwd!()}/priv/protos/modules"}, {:internal_nats_hosts, "nats://127.0.0.1:4222"}, {:internal_nats_tls, "false"}, {:internal_nats_auth, "false"}, @@ -234,6 +236,23 @@ if Code.ensure_loaded?(:persistent_term) do value end + defp load_env({:grpc_http_transcoding_enabled, default}) do + value = + env("PROXY_GRPC_HTTP_TRANSCODING_ENABLED", default) + |> to_bool() + + :persistent_term.put({__MODULE__, :grpc_http_transcoding_enabled}, value) + + value + end + + defp load_env({:grpc_compiled_modules_path, default}) do + value = env("PROXY_GRPC_COMPILED_MODULES_PATH", default) + :persistent_term.put({__MODULE__, :grpc_compiled_modules_path}, value) + + value + end + defp load_env({:http_num_acceptors, default}) do value = env("PROXY_HTTP_NUM_ACCEPTORS", default) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 40bfa333..628fbf62 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -13,6 +13,7 @@ defmodule Sidecar.GRPC.CodeGenerator do """ require Logger + alias Actors.Config.PersistentTermConfig, as: Config alias Mix.Tasks.Protobuf.Generate @doc """ @@ -31,8 +32,10 @@ defmodule Sidecar.GRPC.CodeGenerator do """ def compile_protos(opts \\ []) do include_path = "#{File.cwd!()}/priv/protos" - output_path = Keyword.get(opts, :output_path, "#{File.cwd!()}/priv/protos/modules") - transcoding_enabled? = Keyword.get(opts, :http_transcoding_enabled, true) + output_path = Keyword.get(opts, :output_path, Config.get(:grpc_compiled_modules_path)) + + transcoding_enabled? = + Keyword.get(opts, :http_transcoding_enabled, Config.get(:grpc_http_transcoding_enabled)) {grpc_generator_plugin, handler_generator_plugin} = if transcoding_enabled? do @@ -69,7 +72,9 @@ defmodule Sidecar.GRPC.CodeGenerator do ## Parameters - `opts` (KeywordList): Options for loading modules. - - `:output_path` (String): Path to the directory containing the modules. Default is "#{File.cwd!()}/priv/protos/modules". + - `:output_path` (String): Path to the directory containing the modules. Default is "#{ + File.cwd!() + }/priv/protos/modules". ## Returns @@ -85,8 +90,8 @@ defmodule Sidecar.GRPC.CodeGenerator do This example loads Elixir modules from the specified directory "/path/to/modules" and prints the content of each module. """ - def load_modules(opts) do - path = Keyword.get(opts, :output_path, "#{File.cwd!()}/priv/protos/modules") + def load_modules(opts \\ []) do + path = Keyword.get(opts, :output_path, Config.get(:grpc_compiled_modules_path)) user_defined_modules_files = list_files_with_extension(path, ".pb.ex") diff --git a/mix.exs b/mix.exs index 028b660c..686801f7 100644 --- a/mix.exs +++ b/mix.exs @@ -78,7 +78,7 @@ defmodule Spawn.MixProject do {:protobuf, "~> 0.11"}, {:protobuf_generate, "~> 0.1"}, {:grpc, "~> 0.7"}, - {:grpc_reflection, git: "https://github.com/elixir-grpc/grpc-reflection"}, + {:grpc_reflection, "~> 0.1"}, {:finch, "~> 0.16"}, {:retry, "~> 0.17"}, {:flow, "~> 1.2"}, diff --git a/mix.lock b/mix.lock index f66adb4c..6cdb279e 100644 --- a/mix.lock +++ b/mix.lock @@ -29,7 +29,7 @@ "gnat": {:hex, :gnat, "1.7.1", "491144f9c3aec00e9941d69538e2fd2836271e220315c8d2d87907c20ca7abc8", [:mix], [{:cowlib, "~> 2.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:nkeys, "~> 0.2", [hex: :nkeys, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a5629088d9bdb16d982eb48fd431cf6c5a71e9b026281781983501237ab5b911"}, "gproc": {:hex, :gproc, "0.9.1", "f1df0364423539cf0b80e8201c8b1839e229e5f9b3ccb944c5834626998f5b8c", [:rebar3], [], "hexpm", "905088e32e72127ed9466f0bac0d8e65704ca5e73ee5a62cb073c3117916d507"}, "grpc": {:hex, :grpc, "0.7.0", "a86eab356b0b84406b526786a947ca50e9b9eae87108c873b51e321f8a71e8ed", [:mix], [{:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "632a9507da8d3c12b112b197db4d60da3c95bad02594d37711eeb622d032f254"}, - "grpc_reflection": {:git, "https://github.com/elixir-grpc/grpc-reflection", "2603dd35e203489ccc128a7f9a8b626f6d864977", []}, + "grpc_reflection": {:hex, :grpc_reflection, "0.1.0", "0c835a933c3dd3ff55527a8d491da249b76b762ae56aa43909c87a4f9f1a13ef", [:mix], [{:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "5031b94b115d8e6f66bd71ef1572aca9f2212aa765920c3285a7de382ec5d03e"}, "grpcbox": {:hex, :grpcbox, "0.17.1", "6e040ab3ef16fe699ffb513b0ef8e2e896da7b18931a1ef817143037c454bcce", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.15.1", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.9.1", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "4a3b5d7111daabc569dc9cbd9b202a3237d81c80bf97212fbc676832cb0ceb17"}, "gun": {:hex, :gun, "2.0.1", "160a9a5394800fcba41bc7e6d421295cf9a7894c2252c0678244948e3336ad73", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "a10bc8d6096b9502205022334f719cc9a08d9adcfbfc0dbee9ef31b56274a20b"}, "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, From bd521c95f957becfa757dd4449f1448afb142a5d Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 19 Feb 2024 19:57:34 -0300 Subject: [PATCH 13/48] Adjusts --- config/config.exs | 7 +- config/runtime.exs | 2 +- lib/actors/config/persistent_term_config.ex | 22 ++ lib/sidecar/grpc/code_generator.ex | 11 +- lib/sidecar/grpc/dispatcher.ex | 38 ++-- lib/sidecar/grpc/supervisor.ex | 51 ++++- lib/spawn/actors/actor.pb.ex | 109 ++++++---- lib/spawn/actors/protocol.pb.ex | 189 ++++++++++-------- lib/spawn/actors/state.pb.ex | 7 +- lib/spawn/google/protobuf/any.pb.ex | 4 +- .../grpc/reflection/v1alpha/reflection.pb.ex | 69 ++++--- mix.lock | 7 + priv/protos/modules/helloworld.pb.ex | 6 +- 13 files changed, 325 insertions(+), 197 deletions(-) diff --git a/config/config.exs b/config/config.exs index df320d9d..d7ed4eb2 100644 --- a/config/config.exs +++ b/config/config.exs @@ -19,9 +19,8 @@ config :do_it, DoIt.Commfig, config :logger, backends: [:console], - truncate: 65536 - -# level: :info + truncate: 65536, + level: :debug # compile_time_purge_matching: [ # [level_lower_than: :info] @@ -74,4 +73,4 @@ config :mnesiac, schema_type: :disc_copies, table_load_timeout: 600_000 -#import_config "#{config_env()}.exs" +# import_config "#{config_env()}.exs" diff --git a/config/runtime.exs b/config/runtime.exs index 8b4cef74..7e26aa5b 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -2,5 +2,5 @@ import Config if config_env() == :prod do config :logger, - level: String.to_atom(System.get_env("SPAWN_PROXY_LOGGER_LEVEL", "debug")) + level: String.to_atom(System.get_env("SPAWN_PROXY_LOGGER_LEVEL", "info")) end diff --git a/lib/actors/config/persistent_term_config.ex b/lib/actors/config/persistent_term_config.ex index 4ea646f1..acbf23a4 100644 --- a/lib/actors/config/persistent_term_config.ex +++ b/lib/actors/config/persistent_term_config.ex @@ -28,6 +28,8 @@ if Code.ensure_loaded?(:persistent_term) do {:http_port, "9001"}, {:http_num_acceptors, "150"}, {:grpc_port, "9980"}, + {:grpc_server_enabled, "true"}, + {:grpc_reflection_enabled, "true"}, {:grpc_http_transcoding_enabled, "true"}, {:grpc_compiled_modules_path, "#{File.cwd!()}/priv/protos/modules"}, {:internal_nats_hosts, "nats://127.0.0.1:4222"}, @@ -236,6 +238,26 @@ if Code.ensure_loaded?(:persistent_term) do value end + defp load_env({:grpc_server_enabled, default}) do + value = + env("PROXY_GRPC_SERVER_ENABLED", default) + |> to_bool() + + :persistent_term.put({__MODULE__, :grpc_server_enabled}, value) + + value + end + + defp load_env({:grpc_reflection_enabled, default}) do + value = + env("PROXY_GRPC_REFLECTION_ENABLED", default) + |> to_bool() + + :persistent_term.put({__MODULE__, :grpc_reflection_enabled}, value) + + value + end + defp load_env({:grpc_http_transcoding_enabled, default}) do value = env("PROXY_GRPC_HTTP_TRANSCODING_ENABLED", default) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 628fbf62..9e3efc5a 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -31,6 +31,7 @@ defmodule Sidecar.GRPC.CodeGenerator do """ def compile_protos(opts \\ []) do + Logger.debug("Compiling ActorHost Protocol Buffers...") include_path = "#{File.cwd!()}/priv/protos" output_path = Keyword.get(opts, :output_path, Config.get(:grpc_compiled_modules_path)) @@ -72,9 +73,7 @@ defmodule Sidecar.GRPC.CodeGenerator do ## Parameters - `opts` (KeywordList): Options for loading modules. - - `:output_path` (String): Path to the directory containing the modules. Default is "#{ - File.cwd!() - }/priv/protos/modules". + - `:output_path` (String): Path to the directory containing the modules. Default is "#{File.cwd!()}/priv/protos/modules". ## Returns @@ -91,6 +90,7 @@ defmodule Sidecar.GRPC.CodeGenerator do """ def load_modules(opts \\ []) do + Logger.debug("Loading ActorHost contract modules...") path = Keyword.get(opts, :output_path, Config.get(:grpc_compiled_modules_path)) user_defined_modules_files = list_files_with_extension(path, ".pb.ex") @@ -125,7 +125,10 @@ defmodule Sidecar.GRPC.CodeGenerator do Raises an error if there are issues during the compilation process. """ - def compile_modules(modules) when is_list(modules), do: Enum.each(modules, &do_compile/1) + def compile_modules(modules) when is_list(modules) do + Logger.debug("Compiling ActorHost contract modules...") + Enum.each(modules, &compile_modules/1) + end def compile_modules(module), do: do_compile(module) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 936e8706..d47b3a6b 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -19,6 +19,7 @@ defmodule Sidecar.GRPC.Dispatcher do - `request` - A map containing the following parameters: - `system: system_name` - The name of the actor system. - `actor_name: actor_name` - The name of the actor. + - `action_name: action_name` - The name of action to call. - `input: message` - The input message. - `stream: stream` - The stream (optional). - `descriptor: descriptor` - The service descriptor. @@ -57,38 +58,37 @@ defmodule Sidecar.GRPC.Dispatcher do %{ system: system_name, actor_name: actor_name, - action_name: action_name, - input: message, - stream: stream, descriptor: descriptor - } = request + } = _request ) - when not is_nil(descriptor) do - Logger.debug( - "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" + when is_nil(descriptor) do + Logger.error( + "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}" ) - # TODO - # Before forwading the request, we must find out through the ServiceResolver module what type of RPC - # it is (unary, client streaming, server streaming, etc...). This way we will know how to forward - # the request correctly (synchronously or asynchronously), as well as how to properly handle the GRPC response. + raise GRPC.RPCError, + status: GRPC.Status.failed_precondition(), + message: + "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}" end def dispatch( %{ system: system_name, actor_name: actor_name, + action_name: action_name, + input: message, + stream: stream, descriptor: descriptor } = request - ) - when not is_nil(descriptor) do - Logger.error( - "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}" + ) do + Logger.debug( + "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" ) - raise GRPC.RPCError, - status: GRPC.Status.failed_precondition(), - message: - "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}" + # TODO + # Before forwading the request, we must find out through the ServiceResolver module what type of RPC + # it is (unary, client streaming, server streaming, etc...). This way we will know how to forward + # the request correctly (synchronously or asynchronously), as well as how to properly handle the GRPC response. end end diff --git a/lib/sidecar/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex index 99fb5882..b95f9884 100644 --- a/lib/sidecar/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -7,25 +7,56 @@ defmodule Sidecar.GRPC.Supervisor do alias Sidecar.GRPC.CodeGenerator, as: Generator def init(opts) do - Logger.info("Starting gRPC Server...") + Logger.debug("Parser and compiling Protocol Buffers...") - with :ok <- Generator.compile_protos(), - {:ok, modules} <- Generator.load_modules(opts), - :ok <- Generator.compile_modules(modules) do - children = [ - {GrpcReflection, []}, - {GRPC.Server.Supervisor, - endpoint: Sidecar.GRPC.ProxyEndpoint, port: Config.get(:grpc_port), start_server: true} - ] + with {:compiling_protos, :ok} <- {:compiling_protos, Generator.compile_protos()}, + {:load_modules, {:ok, modules}} <- {:load_modules, Generator.load_modules(opts)}, + {:compiling_modules, :ok} <- {:compiling_modules, Generator.compile_modules(modules)} do + children = + [] + |> maybe_start_reflection(Config.get(:grpc_reflection_enabled)) + |> maybe_start_grpc_server(Config.get(:grpc_server_enabled)) Supervisor.init(children, strategy: :one_for_one) else + {:compiling_protos, error} -> + raise ArgumentError, + "Failed during compilation of ActorHost Protobufs files. Details: #{inspect(error)}" + + {:load_modules, error} -> + raise ArgumentError, + "Failed on load of ActorHost Protobufs modules. Details: #{inspect(error)}" + + {:compiling_modules, error} -> + raise ArgumentError, + "Failed during compilation of ActorHost protobufs modules. Details: #{inspect(error)}" + error -> raise ArgumentError, - "Failed to load ActorHost protobufs modules. Details: #{inspect(error)}" + "Failed to load ActorHost Protobufs modules. Details: #{inspect(error)}" end end + defp maybe_start_reflection(children, false), do: children + + defp maybe_start_reflection(children, true) do + (children ++ [{GrpcReflection, []}]) |> List.flatten() + end + + defp maybe_start_grpc_server(children, false), do: children + + defp maybe_start_grpc_server(children, true) do + port = Config.get(:grpc_port) + Logger.debug("Starting gRPC Server on port #{inspect(port)}...") + + (children ++ + [ + {GRPC.Server.Supervisor, + endpoint: Sidecar.GRPC.ProxyEndpoint, port: port, start_server: true} + ]) + |> List.flatten() + end + def start_link(opts) do Supervisor.start_link( __MODULE__, diff --git a/lib/spawn/actors/actor.pb.ex b/lib/spawn/actors/actor.pb.ex index a6c50b9f..48a9ac1f 100644 --- a/lib/spawn/actors/actor.pb.ex +++ b/lib/spawn/actors/actor.pb.ex @@ -45,12 +45,13 @@ defmodule Eigr.Functions.Protocol.Actors.Kind do } end - field :UNKNOW_KIND, 0 - field :NAMED, 1 - field :UNNAMED, 2 - field :POOLED, 3 - field :PROXY, 4 + field(:UNKNOW_KIND, 0) + field(:NAMED, 1) + field(:UNNAMED, 2) + field(:POOLED, 3) + field(:PROXY, 4) end + defmodule Eigr.Functions.Protocol.Actors.Registry.ActorsEntry do @moduledoc false use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -109,9 +110,10 @@ defmodule Eigr.Functions.Protocol.Actors.Registry.ActorsEntry do } end - field :key, 1, type: :string - field :value, 2, type: Eigr.Functions.Protocol.Actors.Actor + field(:key, 1, type: :string) + field(:value, 2, type: Eigr.Functions.Protocol.Actors.Actor) end + defmodule Eigr.Functions.Protocol.Actors.Registry do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -199,11 +201,13 @@ defmodule Eigr.Functions.Protocol.Actors.Registry do } end - field :actors, 1, + field(:actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.Registry.ActorsEntry, map: true + ) end + defmodule Eigr.Functions.Protocol.Actors.ActorSystem do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -254,9 +258,10 @@ defmodule Eigr.Functions.Protocol.Actors.ActorSystem do } end - field :name, 1, type: :string - field :registry, 2, type: Eigr.Functions.Protocol.Actors.Registry + field(:name, 1, type: :string) + field(:registry, 2, type: Eigr.Functions.Protocol.Actors.Registry) end + defmodule Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -299,10 +304,11 @@ defmodule Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy do } end - oneof :strategy, 0 + oneof(:strategy, 0) - field :timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0 + field(:timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0) end + defmodule Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -345,10 +351,11 @@ defmodule Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy do } end - oneof :strategy, 0 + oneof(:strategy, 0) - field :timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0 + field(:timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0) end + defmodule Eigr.Functions.Protocol.Actors.TimeoutStrategy do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -385,8 +392,9 @@ defmodule Eigr.Functions.Protocol.Actors.TimeoutStrategy do } end - field :timeout, 1, type: :int64 + field(:timeout, 1, type: :int64) end + defmodule Eigr.Functions.Protocol.Actors.Action do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -423,8 +431,9 @@ defmodule Eigr.Functions.Protocol.Actors.Action do } end - field :name, 1, type: :string + field(:name, 1, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.FixedTimerAction do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -475,9 +484,10 @@ defmodule Eigr.Functions.Protocol.Actors.FixedTimerAction do } end - field :seconds, 1, type: :int32 - field :action, 2, type: Eigr.Functions.Protocol.Actors.Action + field(:seconds, 1, type: :int32) + field(:action, 2, type: Eigr.Functions.Protocol.Actors.Action) end + defmodule Eigr.Functions.Protocol.Actors.ActorState.TagsEntry do @moduledoc false use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -536,9 +546,10 @@ defmodule Eigr.Functions.Protocol.Actors.ActorState.TagsEntry do } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.ActorState do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -640,13 +651,15 @@ defmodule Eigr.Functions.Protocol.Actors.ActorState do } end - field :tags, 1, + field(:tags, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorState.TagsEntry, map: true + ) - field :state, 2, type: Google.Protobuf.Any + field(:state, 2, type: Google.Protobuf.Any) end + defmodule Eigr.Functions.Protocol.Actors.Metadata.TagsEntry do @moduledoc false use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -705,9 +718,10 @@ defmodule Eigr.Functions.Protocol.Actors.Metadata.TagsEntry do } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.Metadata do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -809,16 +823,19 @@ defmodule Eigr.Functions.Protocol.Actors.Metadata do } end - field :channel_group, 1, + field(:channel_group, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.Channel, json_name: "channelGroup" + ) - field :tags, 2, + field(:tags, 2, repeated: true, type: Eigr.Functions.Protocol.Actors.Metadata.TagsEntry, map: true + ) end + defmodule Eigr.Functions.Protocol.Actors.Channel do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -869,9 +886,10 @@ defmodule Eigr.Functions.Protocol.Actors.Channel do } end - field :topic, 1, type: :string - field :action, 2, type: :string + field(:topic, 1, type: :string) + field(:action, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.ActorSettings do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -978,20 +996,23 @@ defmodule Eigr.Functions.Protocol.Actors.ActorSettings do } end - field :kind, 1, type: Eigr.Functions.Protocol.Actors.Kind, enum: true - field :stateful, 2, type: :bool + field(:kind, 1, type: Eigr.Functions.Protocol.Actors.Kind, enum: true) + field(:stateful, 2, type: :bool) - field :snapshot_strategy, 3, + field(:snapshot_strategy, 3, type: Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy, json_name: "snapshotStrategy" + ) - field :deactivation_strategy, 4, + field(:deactivation_strategy, 4, type: Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy, json_name: "deactivationStrategy" + ) - field :min_pool_size, 5, type: :int32, json_name: "minPoolSize" - field :max_pool_size, 6, type: :int32, json_name: "maxPoolSize" + field(:min_pool_size, 5, type: :int32, json_name: "minPoolSize") + field(:max_pool_size, 6, type: :int32, json_name: "maxPoolSize") end + defmodule Eigr.Functions.Protocol.Actors.ActorId do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1056,10 +1077,11 @@ defmodule Eigr.Functions.Protocol.Actors.ActorId do } end - field :name, 1, type: :string - field :system, 2, type: :string - field :parent, 3, type: :string + field(:name, 1, type: :string) + field(:system, 2, type: :string) + field(:parent, 3, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.Actor do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1166,14 +1188,15 @@ defmodule Eigr.Functions.Protocol.Actors.Actor do } end - field :id, 1, type: Eigr.Functions.Protocol.Actors.ActorId - field :state, 2, type: Eigr.Functions.Protocol.Actors.ActorState - field :metadata, 6, type: Eigr.Functions.Protocol.Actors.Metadata - field :settings, 3, type: Eigr.Functions.Protocol.Actors.ActorSettings - field :actions, 4, repeated: true, type: Eigr.Functions.Protocol.Actors.Action + field(:id, 1, type: Eigr.Functions.Protocol.Actors.ActorId) + field(:state, 2, type: Eigr.Functions.Protocol.Actors.ActorState) + field(:metadata, 6, type: Eigr.Functions.Protocol.Actors.Metadata) + field(:settings, 3, type: Eigr.Functions.Protocol.Actors.ActorSettings) + field(:actions, 4, repeated: true, type: Eigr.Functions.Protocol.Actors.Action) - field :timer_actions, 5, + field(:timer_actions, 5, repeated: true, type: Eigr.Functions.Protocol.Actors.FixedTimerAction, json_name: "timerActions" + ) end diff --git a/lib/spawn/actors/protocol.pb.ex b/lib/spawn/actors/protocol.pb.ex index 6348af8b..03084a56 100644 --- a/lib/spawn/actors/protocol.pb.ex +++ b/lib/spawn/actors/protocol.pb.ex @@ -39,11 +39,12 @@ defmodule Eigr.Functions.Protocol.Status do } end - field :UNKNOWN, 0 - field :OK, 1 - field :ACTOR_NOT_FOUND, 2 - field :ERROR, 3 + field(:UNKNOWN, 0) + field(:OK, 1) + field(:ACTOR_NOT_FOUND, 2) + field(:ERROR, 3) end + defmodule Eigr.Functions.Protocol.Context.MetadataEntry do @moduledoc false use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -102,9 +103,10 @@ defmodule Eigr.Functions.Protocol.Context.MetadataEntry do } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Context.TagsEntry do @moduledoc false use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -163,9 +165,10 @@ defmodule Eigr.Functions.Protocol.Context.TagsEntry do } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Context do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -359,17 +362,19 @@ defmodule Eigr.Functions.Protocol.Context do } end - field :state, 1, type: Google.Protobuf.Any + field(:state, 1, type: Google.Protobuf.Any) - field :metadata, 4, + field(:metadata, 4, repeated: true, type: Eigr.Functions.Protocol.Context.MetadataEntry, map: true + ) - field :tags, 5, repeated: true, type: Eigr.Functions.Protocol.Context.TagsEntry, map: true - field :caller, 2, type: Eigr.Functions.Protocol.Actors.ActorId - field :self, 3, type: Eigr.Functions.Protocol.Actors.ActorId + field(:tags, 5, repeated: true, type: Eigr.Functions.Protocol.Context.TagsEntry, map: true) + field(:caller, 2, type: Eigr.Functions.Protocol.Actors.ActorId) + field(:self, 3, type: Eigr.Functions.Protocol.Actors.ActorId) end + defmodule Eigr.Functions.Protocol.Noop do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -391,6 +396,7 @@ defmodule Eigr.Functions.Protocol.Noop do } end end + defmodule Eigr.Functions.Protocol.JSONType do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -427,8 +433,9 @@ defmodule Eigr.Functions.Protocol.JSONType do } end - field :content, 1, type: :string + field(:content, 1, type: :string) end + defmodule Eigr.Functions.Protocol.RegistrationRequest do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -479,12 +486,14 @@ defmodule Eigr.Functions.Protocol.RegistrationRequest do } end - field :service_info, 1, type: Eigr.Functions.Protocol.ServiceInfo, json_name: "serviceInfo" + field(:service_info, 1, type: Eigr.Functions.Protocol.ServiceInfo, json_name: "serviceInfo") - field :actor_system, 2, + field(:actor_system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem, json_name: "actorSystem" + ) end + defmodule Eigr.Functions.Protocol.RegistrationResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -535,9 +544,10 @@ defmodule Eigr.Functions.Protocol.RegistrationResponse do } end - field :status, 1, type: Eigr.Functions.Protocol.RequestStatus - field :proxy_info, 2, type: Eigr.Functions.Protocol.ProxyInfo, json_name: "proxyInfo" + field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) + field(:proxy_info, 2, type: Eigr.Functions.Protocol.ProxyInfo, json_name: "proxyInfo") end + defmodule Eigr.Functions.Protocol.ServiceInfo do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -658,14 +668,15 @@ defmodule Eigr.Functions.Protocol.ServiceInfo do } end - field :service_name, 1, type: :string, json_name: "serviceName" - field :service_version, 2, type: :string, json_name: "serviceVersion" - field :service_runtime, 3, type: :string, json_name: "serviceRuntime" - field :support_library_name, 4, type: :string, json_name: "supportLibraryName" - field :support_library_version, 5, type: :string, json_name: "supportLibraryVersion" - field :protocol_major_version, 6, type: :int32, json_name: "protocolMajorVersion" - field :protocol_minor_version, 7, type: :int32, json_name: "protocolMinorVersion" + field(:service_name, 1, type: :string, json_name: "serviceName") + field(:service_version, 2, type: :string, json_name: "serviceVersion") + field(:service_runtime, 3, type: :string, json_name: "serviceRuntime") + field(:support_library_name, 4, type: :string, json_name: "supportLibraryName") + field(:support_library_version, 5, type: :string, json_name: "supportLibraryVersion") + field(:protocol_major_version, 6, type: :int32, json_name: "protocolMajorVersion") + field(:protocol_minor_version, 7, type: :int32, json_name: "protocolMinorVersion") end + defmodule Eigr.Functions.Protocol.SpawnRequest do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -702,8 +713,9 @@ defmodule Eigr.Functions.Protocol.SpawnRequest do } end - field :actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorId + field(:actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorId) end + defmodule Eigr.Functions.Protocol.SpawnResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -740,8 +752,9 @@ defmodule Eigr.Functions.Protocol.SpawnResponse do } end - field :status, 1, type: Eigr.Functions.Protocol.RequestStatus + field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) end + defmodule Eigr.Functions.Protocol.ProxyInfo do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -820,11 +833,12 @@ defmodule Eigr.Functions.Protocol.ProxyInfo do } end - field :protocol_major_version, 1, type: :int32, json_name: "protocolMajorVersion" - field :protocol_minor_version, 2, type: :int32, json_name: "protocolMinorVersion" - field :proxy_name, 3, type: :string, json_name: "proxyName" - field :proxy_version, 4, type: :string, json_name: "proxyVersion" + field(:protocol_major_version, 1, type: :int32, json_name: "protocolMajorVersion") + field(:protocol_minor_version, 2, type: :int32, json_name: "protocolMinorVersion") + field(:proxy_name, 3, type: :string, json_name: "proxyName") + field(:proxy_version, 4, type: :string, json_name: "proxyVersion") end + defmodule Eigr.Functions.Protocol.SideEffect do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -861,8 +875,9 @@ defmodule Eigr.Functions.Protocol.SideEffect do } end - field :request, 1, type: Eigr.Functions.Protocol.InvocationRequest + field(:request, 1, type: Eigr.Functions.Protocol.InvocationRequest) end + defmodule Eigr.Functions.Protocol.Broadcast do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -933,12 +948,13 @@ defmodule Eigr.Functions.Protocol.Broadcast do } end - oneof :payload, 0 + oneof(:payload, 0) - field :channel_group, 1, type: :string, json_name: "channelGroup" - field :value, 3, type: Google.Protobuf.Any, oneof: 0 - field :noop, 4, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field(:channel_group, 1, type: :string, json_name: "channelGroup") + field(:value, 3, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 4, type: Eigr.Functions.Protocol.Noop, oneof: 0) end + defmodule Eigr.Functions.Protocol.Pipe do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -989,9 +1005,10 @@ defmodule Eigr.Functions.Protocol.Pipe do } end - field :actor, 1, type: :string - field :action_name, 2, type: :string, json_name: "actionName" + field(:actor, 1, type: :string) + field(:action_name, 2, type: :string, json_name: "actionName") end + defmodule Eigr.Functions.Protocol.Forward do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1042,9 +1059,10 @@ defmodule Eigr.Functions.Protocol.Forward do } end - field :actor, 1, type: :string - field :action_name, 2, type: :string, json_name: "actionName" + field(:actor, 1, type: :string) + field(:action_name, 2, type: :string, json_name: "actionName") end + defmodule Eigr.Functions.Protocol.Workflow do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1129,13 +1147,14 @@ defmodule Eigr.Functions.Protocol.Workflow do } end - oneof :routing, 0 + oneof(:routing, 0) - field :broadcast, 2, type: Eigr.Functions.Protocol.Broadcast - field :effects, 1, repeated: true, type: Eigr.Functions.Protocol.SideEffect - field :pipe, 3, type: Eigr.Functions.Protocol.Pipe, oneof: 0 - field :forward, 4, type: Eigr.Functions.Protocol.Forward, oneof: 0 + field(:broadcast, 2, type: Eigr.Functions.Protocol.Broadcast) + field(:effects, 1, repeated: true, type: Eigr.Functions.Protocol.SideEffect) + field(:pipe, 3, type: Eigr.Functions.Protocol.Pipe, oneof: 0) + field(:forward, 4, type: Eigr.Functions.Protocol.Forward, oneof: 0) end + defmodule Eigr.Functions.Protocol.InvocationRequest.MetadataEntry do @moduledoc false use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1194,9 +1213,10 @@ defmodule Eigr.Functions.Protocol.InvocationRequest.MetadataEntry do } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.InvocationRequest do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1430,25 +1450,27 @@ defmodule Eigr.Functions.Protocol.InvocationRequest do } end - oneof :payload, 0 + oneof(:payload, 0) - field :system, 1, type: Eigr.Functions.Protocol.Actors.ActorSystem - field :actor, 2, type: Eigr.Functions.Protocol.Actors.Actor - field :action_name, 3, type: :string, json_name: "actionName" - field :value, 4, type: Google.Protobuf.Any, oneof: 0 - field :noop, 7, type: Eigr.Functions.Protocol.Noop, oneof: 0 - field :async, 5, type: :bool - field :caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId + field(:system, 1, type: Eigr.Functions.Protocol.Actors.ActorSystem) + field(:actor, 2, type: Eigr.Functions.Protocol.Actors.Actor) + field(:action_name, 3, type: :string, json_name: "actionName") + field(:value, 4, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 7, type: Eigr.Functions.Protocol.Noop, oneof: 0) + field(:async, 5, type: :bool) + field(:caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId) - field :metadata, 8, + field(:metadata, 8, repeated: true, type: Eigr.Functions.Protocol.InvocationRequest.MetadataEntry, map: true + ) - field :scheduled_to, 9, type: :int64, json_name: "scheduledTo" - field :pooled, 10, type: :bool - field :register_ref, 11, type: :string, json_name: "registerRef" + field(:scheduled_to, 9, type: :int64, json_name: "scheduledTo") + field(:pooled, 10, type: :bool) + field(:register_ref, 11, type: :string, json_name: "registerRef") end + defmodule Eigr.Functions.Protocol.ActorInvocation do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1561,15 +1583,16 @@ defmodule Eigr.Functions.Protocol.ActorInvocation do } end - oneof :payload, 0 + oneof(:payload, 0) - field :actor, 1, type: Eigr.Functions.Protocol.Actors.ActorId - field :action_name, 2, type: :string, json_name: "actionName" - field :current_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "currentContext" - field :value, 4, type: Google.Protobuf.Any, oneof: 0 - field :noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0 - field :caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId + field(:actor, 1, type: Eigr.Functions.Protocol.Actors.ActorId) + field(:action_name, 2, type: :string, json_name: "actionName") + field(:current_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "currentContext") + field(:value, 4, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0) + field(:caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId) end + defmodule Eigr.Functions.Protocol.ActorInvocationResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1696,16 +1719,17 @@ defmodule Eigr.Functions.Protocol.ActorInvocationResponse do } end - oneof :payload, 0 + oneof(:payload, 0) - field :actor_name, 1, type: :string, json_name: "actorName" - field :actor_system, 2, type: :string, json_name: "actorSystem" - field :updated_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "updatedContext" - field :value, 4, type: Google.Protobuf.Any, oneof: 0 - field :noop, 6, type: Eigr.Functions.Protocol.Noop, oneof: 0 - field :workflow, 5, type: Eigr.Functions.Protocol.Workflow - field :checkpoint, 7, type: :bool + field(:actor_name, 1, type: :string, json_name: "actorName") + field(:actor_system, 2, type: :string, json_name: "actorSystem") + field(:updated_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "updatedContext") + field(:value, 4, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 6, type: Eigr.Functions.Protocol.Noop, oneof: 0) + field(:workflow, 5, type: Eigr.Functions.Protocol.Workflow) + field(:checkpoint, 7, type: :bool) end + defmodule Eigr.Functions.Protocol.InvocationResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1804,14 +1828,15 @@ defmodule Eigr.Functions.Protocol.InvocationResponse do } end - oneof :payload, 0 + oneof(:payload, 0) - field :status, 1, type: Eigr.Functions.Protocol.RequestStatus - field :system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem - field :actor, 3, type: Eigr.Functions.Protocol.Actors.Actor - field :value, 4, type: Google.Protobuf.Any, oneof: 0 - field :noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) + field(:system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem) + field(:actor, 3, type: Eigr.Functions.Protocol.Actors.Actor) + field(:value, 4, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0) end + defmodule Eigr.Functions.Protocol.RequestStatus do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -1862,6 +1887,6 @@ defmodule Eigr.Functions.Protocol.RequestStatus do } end - field :status, 1, type: Eigr.Functions.Protocol.Status, enum: true - field :message, 2, type: :string + field(:status, 1, type: Eigr.Functions.Protocol.Status, enum: true) + field(:message, 2, type: :string) end diff --git a/lib/spawn/actors/state.pb.ex b/lib/spawn/actors/state.pb.ex index c79a6c38..4a8db315 100644 --- a/lib/spawn/actors/state.pb.ex +++ b/lib/spawn/actors/state.pb.ex @@ -34,8 +34,9 @@ defmodule Eigr.Functions.Protocol.State.Revision do } end - field :value, 1, type: :int64 + field(:value, 1, type: :int64) end + defmodule Eigr.Functions.Protocol.State.Checkpoint do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -86,6 +87,6 @@ defmodule Eigr.Functions.Protocol.State.Checkpoint do } end - field :revision, 1, type: Eigr.Functions.Protocol.State.Revision - field :state, 2, type: Eigr.Functions.Protocol.Actors.ActorState + field(:revision, 1, type: Eigr.Functions.Protocol.State.Revision) + field(:state, 2, type: Eigr.Functions.Protocol.Actors.ActorState) end diff --git a/lib/spawn/google/protobuf/any.pb.ex b/lib/spawn/google/protobuf/any.pb.ex index 40d471d7..2a3ef175 100644 --- a/lib/spawn/google/protobuf/any.pb.ex +++ b/lib/spawn/google/protobuf/any.pb.ex @@ -48,6 +48,6 @@ defmodule Google.Protobuf.Any do } end - field :type_url, 1, type: :string, json_name: "typeUrl" - field :value, 2, type: :bytes + field(:type_url, 1, type: :string, json_name: "typeUrl") + field(:value, 2, type: :bytes) end diff --git a/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex b/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex index acc59fcc..29a76e93 100644 --- a/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex +++ b/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex @@ -110,24 +110,27 @@ defmodule Grpc.Reflection.V1alpha.ServerReflectionRequest do } end - oneof :message_request, 0 + oneof(:message_request, 0) - field :host, 1, type: :string - field :file_by_filename, 3, type: :string, json_name: "fileByFilename", oneof: 0 - field :file_containing_symbol, 4, type: :string, json_name: "fileContainingSymbol", oneof: 0 + field(:host, 1, type: :string) + field(:file_by_filename, 3, type: :string, json_name: "fileByFilename", oneof: 0) + field(:file_containing_symbol, 4, type: :string, json_name: "fileContainingSymbol", oneof: 0) - field :file_containing_extension, 5, + field(:file_containing_extension, 5, type: Grpc.Reflection.V1alpha.ExtensionRequest, json_name: "fileContainingExtension", oneof: 0 + ) - field :all_extension_numbers_of_type, 6, + field(:all_extension_numbers_of_type, 6, type: :string, json_name: "allExtensionNumbersOfType", oneof: 0 + ) - field :list_services, 7, type: :string, json_name: "listServices", oneof: 0 + field(:list_services, 7, type: :string, json_name: "listServices", oneof: 0) end + defmodule Grpc.Reflection.V1alpha.ExtensionRequest do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -178,9 +181,10 @@ defmodule Grpc.Reflection.V1alpha.ExtensionRequest do } end - field :containing_type, 1, type: :string, json_name: "containingType" - field :extension_number, 2, type: :int32, json_name: "extensionNumber" + field(:containing_type, 1, type: :string, json_name: "containingType") + field(:extension_number, 2, type: :int32, json_name: "extensionNumber") end + defmodule Grpc.Reflection.V1alpha.ServerReflectionResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -293,34 +297,40 @@ defmodule Grpc.Reflection.V1alpha.ServerReflectionResponse do } end - oneof :message_response, 0 + oneof(:message_response, 0) - field :valid_host, 1, type: :string, json_name: "validHost" + field(:valid_host, 1, type: :string, json_name: "validHost") - field :original_request, 2, + field(:original_request, 2, type: Grpc.Reflection.V1alpha.ServerReflectionRequest, json_name: "originalRequest" + ) - field :file_descriptor_response, 4, + field(:file_descriptor_response, 4, type: Grpc.Reflection.V1alpha.FileDescriptorResponse, json_name: "fileDescriptorResponse", oneof: 0 + ) - field :all_extension_numbers_response, 5, + field(:all_extension_numbers_response, 5, type: Grpc.Reflection.V1alpha.ExtensionNumberResponse, json_name: "allExtensionNumbersResponse", oneof: 0 + ) - field :list_services_response, 6, + field(:list_services_response, 6, type: Grpc.Reflection.V1alpha.ListServiceResponse, json_name: "listServicesResponse", oneof: 0 + ) - field :error_response, 7, + field(:error_response, 7, type: Grpc.Reflection.V1alpha.ErrorResponse, json_name: "errorResponse", oneof: 0 + ) end + defmodule Grpc.Reflection.V1alpha.FileDescriptorResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -357,8 +367,9 @@ defmodule Grpc.Reflection.V1alpha.FileDescriptorResponse do } end - field :file_descriptor_proto, 1, repeated: true, type: :bytes, json_name: "fileDescriptorProto" + field(:file_descriptor_proto, 1, repeated: true, type: :bytes, json_name: "fileDescriptorProto") end + defmodule Grpc.Reflection.V1alpha.ExtensionNumberResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -409,9 +420,10 @@ defmodule Grpc.Reflection.V1alpha.ExtensionNumberResponse do } end - field :base_type_name, 1, type: :string, json_name: "baseTypeName" - field :extension_number, 2, repeated: true, type: :int32, json_name: "extensionNumber" + field(:base_type_name, 1, type: :string, json_name: "baseTypeName") + field(:extension_number, 2, repeated: true, type: :int32, json_name: "extensionNumber") end + defmodule Grpc.Reflection.V1alpha.ListServiceResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -448,8 +460,9 @@ defmodule Grpc.Reflection.V1alpha.ListServiceResponse do } end - field :service, 1, repeated: true, type: Grpc.Reflection.V1alpha.ServiceResponse + field(:service, 1, repeated: true, type: Grpc.Reflection.V1alpha.ServiceResponse) end + defmodule Grpc.Reflection.V1alpha.ServiceResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -486,8 +499,9 @@ defmodule Grpc.Reflection.V1alpha.ServiceResponse do } end - field :name, 1, type: :string + field(:name, 1, type: :string) end + defmodule Grpc.Reflection.V1alpha.ErrorResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -538,9 +552,10 @@ defmodule Grpc.Reflection.V1alpha.ErrorResponse do } end - field :error_code, 1, type: :int32, json_name: "errorCode" - field :error_message, 2, type: :string, json_name: "errorMessage" + field(:error_code, 1, type: :int32, json_name: "errorCode") + field(:error_message, 2, type: :string, json_name: "errorMessage") end + defmodule Grpc.Reflection.V1alpha.ServerReflection.Service do @moduledoc false use GRPC.Service, @@ -567,9 +582,11 @@ defmodule Grpc.Reflection.V1alpha.ServerReflection.Service do } end - rpc :ServerReflectionInfo, - stream(Grpc.Reflection.V1alpha.ServerReflectionRequest), - stream(Grpc.Reflection.V1alpha.ServerReflectionResponse) + rpc( + :ServerReflectionInfo, + stream(Grpc.Reflection.V1alpha.ServerReflectionRequest), + stream(Grpc.Reflection.V1alpha.ServerReflectionResponse) + ) end defmodule Grpc.Reflection.V1alpha.ServerReflection.Stub do diff --git a/mix.lock b/mix.lock index 6cdb279e..53bf73ed 100644 --- a/mix.lock +++ b/mix.lock @@ -1,5 +1,7 @@ %{ "acceptor_pool": {:hex, :acceptor_pool, "1.0.0", "43c20d2acae35f0c2bcd64f9d2bde267e459f0f3fd23dab26485bf518c281b21", [:rebar3], [], "hexpm", "0cbcd83fdc8b9ad2eee2067ef8b91a14858a5883cb7cd800e6fcd5803e158788"}, + "bakeware": {:hex, :bakeware, "0.2.4", "0aaf49b34f4bab2aa433f9ff1485d9401e421603160abd6d269c469fc7b65212", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "7b97bcf6fbeee53bb32441d6c495bf478d26f9575633cfef6831e421e86ada6d"}, + "bandit": {:hex, :bandit, "1.2.2", "569fe5d0efb107c9af37a1e37e25ce2ceec293101a2d4bc512876fc3207192b5", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "2f89adb7281c78d4e75733e0a9e1b24f46f84d2993963d6fa57d0eafadec5f03"}, "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "castore": {:hex, :castore, "1.0.5", "9eeebb394cc9a0f3ae56b813459f990abb0a3dedee1be6b27fdb50301930502f", [:mix], [], "hexpm", "8d7c597c3e4a64c395980882d4bca3cebb8d74197c590dc272cfd3b6a6310578"}, "cc_precompiler": {:hex, :cc_precompiler, "0.1.9", "e8d3364f310da6ce6463c3dd20cf90ae7bbecbf6c5203b98bf9b48035592649b", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "9dcab3d0f3038621f1601f13539e7a9ee99843862e66ad62827b0c42b2f58a54"}, @@ -56,6 +58,7 @@ "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, "nimble_pool": {:hex, :nimble_pool, "1.0.0", "5eb82705d138f4dd4423f69ceb19ac667b3b492ae570c9f5c900bb3d2f50a847", [:mix], [], "hexpm", "80be3b882d2d351882256087078e1b1952a28bf98d0a287be87e4a24a710b67a"}, "nkeys": {:hex, :nkeys, "0.2.2", "b1ab3324ed4f3a2c9658d7e80feeef86b4d15fbfd12ca5c8cf068289f582fcfa", [:mix], [{:ed25519, "~> 1.3", [hex: :ed25519, repo: "hexpm", optional: false]}], "hexpm", "3578802427b8d1d11ea6dd785c2ab774f527e2c3e449e67bd34612ab71ca471d"}, + "observer_cli": {:hex, :observer_cli, "1.7.4", "3c1bfb6d91bf68f6a3d15f46ae20da0f7740d363ee5bc041191ce8722a6c4fae", [:mix, :rebar3], [{:recon, "~> 2.5.1", [hex: :recon, repo: "hexpm", optional: false]}], "hexpm", "50de6d95d814f447458bd5d72666a74624eddb0ef98bdcee61a0153aae0865ff"}, "opentelemetry": {:hex, :opentelemetry, "1.3.1", "f0a342a74379e3540a634e7047967733da4bc8b873ec9026e224b2bd7369b1fc", [:rebar3], [{:opentelemetry_api, "~> 1.2.2", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "de476b2ac4faad3e3fe3d6e18b35dec9cb338c3b9910c2ce9317836dacad3483"}, "opentelemetry_api": {:hex, :opentelemetry_api, "1.2.2", "693f47b0d8c76da2095fe858204cfd6350c27fe85d00e4b763deecc9588cf27a", [:mix, :rebar3], [{:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "dc77b9a00f137a858e60a852f14007bb66eda1ffbeb6c05d5fe6c9e678b05e9d"}, "opentelemetry_exporter": {:hex, :opentelemetry_exporter, "1.6.0", "f4fbf69aa9f1541b253813221b82b48a9863bc1570d8ecc517bc510c0d1d3d8c", [:rebar3], [{:grpcbox, ">= 0.0.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry, "~> 1.3", [hex: :opentelemetry, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.2", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:tls_certificate_check, "~> 1.18", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "1802d1dca297e46f21e5832ecf843c451121e875f73f04db87355a6cb2ba1710"}, @@ -70,15 +73,19 @@ "protobuf": {:hex, :protobuf, "0.12.0", "58c0dfea5f929b96b5aa54ec02b7130688f09d2de5ddc521d696eec2a015b223", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "75fa6cbf262062073dd51be44dd0ab940500e18386a6c4e87d5819a58964dc45"}, "protobuf_generate": {:hex, :protobuf_generate, "0.1.1", "f6098b85161dcfd48a4f6f1abee4ee5e057981dfc50aafb1aa4bd5b0529aa89b", [:mix], [{:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "93a38c8e2aba2a17e293e9ef1359122741f717103984aa6d1ebdca0efb17ab9d"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, + "recon": {:hex, :recon, "2.5.4", "05dd52a119ee4059fa9daa1ab7ce81bc7a8161a2f12e9d42e9d551ffd2ba901c", [:mix, :rebar3], [], "hexpm", "e9ab01ac7fc8572e41eb59385efeb3fb0ff5bf02103816535bacaedf327d0263"}, "retry": {:hex, :retry, "0.18.0", "dc58ebe22c95aa00bc2459f9e0c5400e6005541cf8539925af0aa027dc860543", [:mix], [], "hexpm", "9483959cc7bf69c9e576d9dfb2b678b71c045d3e6f39ab7c9aa1489df4492d73"}, "shards": {:hex, :shards, "1.1.0", "ed3032e63ae99f0eaa6d012b8b9f9cead48b9a810b3f91aeac266cfc4118eff6", [:make, :rebar3], [], "hexpm", "1d188e565a54a458a7a601c2fd1e74f5cfeba755c5a534239266d28b7ff124c7"}, + "sobelow": {:hex, :sobelow, "0.13.0", "218afe9075904793f5c64b8837cc356e493d88fddde126a463839351870b8d1e", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cd6e9026b85fc35d7529da14f95e85a078d9dd1907a9097b3ba6ac7ebbe34a0d"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "tds": {:hex, :tds, "2.3.5", "fedfb96d53206f01eac62ead859e47e1541a62e1553e9eb7a8801c7dca59eae8", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.9 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "52e350f5dd5584bbcff9859e331be144d290b41bd4c749b936014a17660662f2"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.2", "2caabe9344ec17eafe5403304771c3539f3b6e2f7fb6a6f602558c825d0d0bfb", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9b43db0dc33863930b9ef9d27137e78974756f5f198cae18409970ed6fa5b561"}, "telemetry_metrics_prometheus_core": {:hex, :telemetry_metrics_prometheus_core, "1.2.0", "b583c3f18508f5c5561b674d16cf5d9afd2ea3c04505b7d92baaeac93c1b8260", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "9cba950e1c4733468efbe3f821841f34ac05d28e7af7798622f88ecdbbe63ea3"}, "telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"}, + "thousand_island": {:hex, :thousand_island, "1.3.2", "bc27f9afba6e1a676dd36507d42e429935a142cf5ee69b8e3f90bff1383943cd", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0e085b93012cd1057b378fce40cbfbf381ff6d957a382bfdd5eca1a98eec2535"}, "tls_certificate_check": {:hex, :tls_certificate_check, "1.21.0", "042ab2c0c860652bc5cf69c94e3a31f96676d14682e22ec7813bd173ceff1788", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "6cee6cffc35a390840d48d463541d50746a7b0e421acaadb833cfc7961e490e7"}, + "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, "x509": {:hex, :x509, "0.8.8", "aaf5e58b19a36a8e2c5c5cff0ad30f64eef5d9225f0fd98fb07912ee23f7aba3", [:mix], [], "hexpm", "ccc3bff61406e5bb6a63f06d549f3dba3a1bbb456d84517efaaa210d8a33750f"}, "yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"}, "yaml_elixir": {:hex, :yaml_elixir, "2.9.0", "9a256da867b37b8d2c1ffd5d9de373a4fda77a32a45b452f1708508ba7bbcb53", [:mix], [{:yamerl, "~> 0.10", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "0cb0e7d4c56f5e99a6253ed1a670ed0e39c13fc45a6da054033928607ac08dfc"}, diff --git a/priv/protos/modules/helloworld.pb.ex b/priv/protos/modules/helloworld.pb.ex index 2069d128..ace15d6d 100644 --- a/priv/protos/modules/helloworld.pb.ex +++ b/priv/protos/modules/helloworld.pb.ex @@ -779,9 +779,9 @@ defmodule Helloworld.GreeterService.Service do } end - rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply) + rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply, %{}) - rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply) + rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply, %{}) end defmodule Helloworld.GreeterService.ActorDispatcher do @@ -875,4 +875,4 @@ defmodule Sidecar.GRPC.Reflection.Server do services: [ Helloworld.GreeterService.Service ] -end +end \ No newline at end of file From 9c8c4191e70873feab0d83aa6e445988fe0e11f9 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 19 Feb 2024 21:28:57 -0300 Subject: [PATCH 14/48] Added a protobuf extensio for mapping actor ids --- compile-pb.sh | 1 + lib/sidecar/grpc/dispatcher.ex | 129 ++++++++++- lib/spawn/actors/extensions.pb.ex | 10 + .../functions/protocol/actors/actor.proto | 1 + .../protocol/actors/extensions.proto | 9 + priv/protos/helloworld.proto | 5 +- priv/protos/modules/helloworld.pb.ex | 200 +++++++++++++----- 7 files changed, 300 insertions(+), 55 deletions(-) create mode 100644 lib/spawn/actors/extensions.pb.ex create mode 100644 priv/protos/eigr/functions/protocol/actors/extensions.proto diff --git a/compile-pb.sh b/compile-pb.sh index 890fcd28..71e03a94 100755 --- a/compile-pb.sh +++ b/compile-pb.sh @@ -7,6 +7,7 @@ set -o pipefail protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib/spawn/grpc --proto_path=priv/protos/grpc/ priv/protos/grpc/reflection/v1alpha/reflection.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/any.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/extensions.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/actor.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/protocol.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/state.proto diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index d47b3a6b..e06e904f 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -8,6 +8,8 @@ defmodule Sidecar.GRPC.Dispatcher do """ require Logger + alias Eigr.Functions.Protocol.Actors.ActorId + alias GRPC.Server alias Sidecar.GRPC.ServiceResolver, as: ActorResolver @@ -78,7 +80,7 @@ defmodule Sidecar.GRPC.Dispatcher do actor_name: actor_name, action_name: action_name, input: message, - stream: stream, + stream: %GRPC.Server.Stream{grpc_type: grpc_type} = stream, descriptor: descriptor } = request ) do @@ -90,5 +92,130 @@ defmodule Sidecar.GRPC.Dispatcher do # Before forwading the request, we must find out through the ServiceResolver module what type of RPC # it is (unary, client streaming, server streaming, etc...). This way we will know how to forward # the request correctly (synchronously or asynchronously), as well as how to properly handle the GRPC response. + case grpc_type do + :client_stream -> + handle_client_stream(system_name, actor_name, action_name, message, stream, descriptor) + + :server_stream -> + handle_server_stream(system_name, actor_name, action_name, message, stream, descriptor) + + :bidirectional_stream -> + handle_bidirectional_stream( + system_name, + actor_name, + action_name, + message, + stream, + descriptor + ) + + _ -> + handle_unary(system_name, actor_name, action_name, message, stream, descriptor) + end + end + + defp handle_unary(system_name, actor_name, action_name, message, stream, descriptor) do + req = + build_id(system_name, actor_name, message) + |> build_request(message) + end + + defp handle_client_stream(system_name, actor_name, action_name, message, stream, descriptor) do + req = + build_id(system_name, actor_name, message) + |> build_request(message) + end + + defp handle_server_stream(system_name, actor_name, action_name, message, stream, descriptor) do + req = + build_id(system_name, actor_name, message) + |> build_request(message) + end + + defp handle_bidirectional_stream( + system_name, + actor_name, + action_name, + message, + stream, + descriptor + ) do + req = + build_id(system_name, actor_name, message) + |> build_request(message) + end + + defp build_id(system_name, actor_name, message) do + %Google.Protobuf.DescriptorProto{field: attributes} = message.descriptor() + + # %Google.Protobuf.DescriptorProto{ + # name: "HelloRequest", + # field: [ + # %Google.Protobuf.FieldDescriptorProto{ + # name: "name", + # extendee: nil, + # number: 1, + # label: :LABEL_OPTIONAL, + # type: :TYPE_STRING, + # type_name: nil, + # default_value: nil, + # options: %Google.Protobuf.FieldOptions{ + # ctype: :STRING, + # packed: nil, + # deprecated: false, + # lazy: false, + # jstype: :JS_NORMAL, + # weak: false, + # unverified_lazy: false, + # debug_redact: false, + # uninterpreted_option: [], + # __pb_extensions__: %{ + # {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true + # }, + # __unknown_fields__: [] + # }, + # oneof_index: nil, + # json_name: "name", + # proto3_optional: nil, + # __unknown_fields__: [] + # } + # ], + # nested_type: [], + # enum_type: [], + # extension_range: [], + # extension: [], + # options: nil, + # oneof_decl: [], + # reserved_range: [], + # reserved_name: [], + # __unknown_fields__: [] + # } + + name = + Enum.map(attributes, fn %Google.Protobuf.FieldDescriptorProto{name: name, options: options} = + _field -> + if not is_nil(options) do + extension = options.__pb_extensions__ + + if not is_nil(extension) and + Map.has_key?(extension, {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id}) do + String.to_atom(name) + else + nil + end + else + nil + end + end) + + id = + if Map.has_key?(message, name) do + %ActorId{system: system_name, name: Map.get(message, name), parent: actor_name} + else + %ActorId{system: system_name, name: actor_name} + end + end + + def build_request(actor_id, message) do end end diff --git a/lib/spawn/actors/extensions.pb.ex b/lib/spawn/actors/extensions.pb.ex new file mode 100644 index 00000000..7e072be5 --- /dev/null +++ b/lib/spawn/actors/extensions.pb.ex @@ -0,0 +1,10 @@ +defmodule Eigr.Functions.Protocol.Actors.PbExtension do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + extend(Google.Protobuf.FieldOptions, :actor_id, 9999, + optional: true, + type: :bool, + json_name: "actorId" + ) +end diff --git a/priv/protos/eigr/functions/protocol/actors/actor.proto b/priv/protos/eigr/functions/protocol/actors/actor.proto index 9e72b0ca..6d015d4f 100644 --- a/priv/protos/eigr/functions/protocol/actors/actor.proto +++ b/priv/protos/eigr/functions/protocol/actors/actor.proto @@ -7,6 +7,7 @@ import "google/protobuf/any.proto"; option java_package = "io.eigr.functions.protocol.actors"; option go_package = "github.com/eigr/go-support/eigr/actors;actors"; + message Registry { map actors = 1; } diff --git a/priv/protos/eigr/functions/protocol/actors/extensions.proto b/priv/protos/eigr/functions/protocol/actors/extensions.proto new file mode 100644 index 00000000..8df587ac --- /dev/null +++ b/priv/protos/eigr/functions/protocol/actors/extensions.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package eigr.functions.protocol.actors; + +import "google/protobuf/descriptor.proto"; + +extend google.protobuf.FieldOptions { + bool actor_id = 9999; +} \ No newline at end of file diff --git a/priv/protos/helloworld.proto b/priv/protos/helloworld.proto index 47aa9793..cf94c447 100644 --- a/priv/protos/helloworld.proto +++ b/priv/protos/helloworld.proto @@ -7,6 +7,7 @@ option objc_class_prefix = "HLW"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; +import "eigr/functions/protocol/actors/extensions.proto"; package helloworld; @@ -29,13 +30,13 @@ service GreeterService { // The request message containing the user's name. message HelloRequest { - string name = 1; + string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; } // HelloRequestFrom! message HelloRequestFrom { // Name! - string name = 1; + string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; // From! string from = 2; } diff --git a/priv/protos/modules/helloworld.pb.ex b/priv/protos/modules/helloworld.pb.ex index ace15d6d..700d509b 100644 --- a/priv/protos/modules/helloworld.pb.ex +++ b/priv/protos/modules/helloworld.pb.ex @@ -15,7 +15,19 @@ defmodule Helloworld.HelloRequest do type: :TYPE_STRING, type_name: nil, default_value: nil, - options: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + uninterpreted_option: [], + __pb_extensions__: %{{Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true}, + __unknown_fields__: [] + }, oneof_index: nil, json_name: "name", proto3_optional: nil, @@ -34,7 +46,7 @@ defmodule Helloworld.HelloRequest do } end - field :name, 1, type: :string + field :name, 1, type: :string, deprecated: false end defmodule Helloworld.HelloRequestFrom do @@ -54,7 +66,19 @@ defmodule Helloworld.HelloRequestFrom do type: :TYPE_STRING, type_name: nil, default_value: nil, - options: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + uninterpreted_option: [], + __pb_extensions__: %{{Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true}, + __unknown_fields__: [] + }, oneof_index: nil, json_name: "name", proto3_optional: nil, @@ -87,7 +111,7 @@ defmodule Helloworld.HelloRequestFrom do } end - field :name, 1, type: :string + field :name, 1, type: :string, deprecated: false field :from, 2, type: :string end @@ -154,7 +178,11 @@ defmodule Helloworld.GreeterService.Service do %Google.Protobuf.FileDescriptorProto{ name: "helloworld.proto", package: "helloworld", - dependency: ["google/api/annotations.proto", "google/protobuf/timestamp.proto"], + dependency: [ + "google/api/annotations.proto", + "google/protobuf/timestamp.proto", + "eigr/functions/protocol/actors/extensions.proto" + ], message_type: [ %Google.Protobuf.DescriptorProto{ name: "HelloRequest", @@ -167,7 +195,21 @@ defmodule Helloworld.GreeterService.Service do type: :TYPE_STRING, type_name: nil, default_value: nil, - options: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + uninterpreted_option: [], + __pb_extensions__: %{ + {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true + }, + __unknown_fields__: [] + }, oneof_index: nil, json_name: "name", proto3_optional: nil, @@ -195,7 +237,21 @@ defmodule Helloworld.GreeterService.Service do type: :TYPE_STRING, type_name: nil, default_value: nil, - options: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + uninterpreted_option: [], + __pb_extensions__: %{ + {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true + }, + __unknown_fields__: [] + }, oneof_index: nil, json_name: "name", proto3_optional: nil, @@ -346,7 +402,7 @@ defmodule Helloworld.GreeterService.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 46, 1], + span: [0, 0, 47, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -440,9 +496,17 @@ defmodule Helloworld.GreeterService.Service do leading_detached_comments: [], __unknown_fields__: [] }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 2], + span: [9, 0, 57], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, %Google.Protobuf.SourceCodeInfo.Location{ path: [2], - span: [10, 0, 19], + span: [11, 0, 19], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -450,7 +514,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0], - span: [13, 0, 27, 1], + span: [14, 0, 28, 1], leading_comments: " The greeting service definition.\n", trailing_comments: nil, leading_detached_comments: [], @@ -458,7 +522,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 1], - span: [13, 8, 22], + span: [14, 8, 22], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -466,7 +530,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0], - span: [15, 2, 19, 3], + span: [16, 2, 20, 3], leading_comments: " Sends a greeting\n", trailing_comments: nil, leading_detached_comments: [], @@ -474,7 +538,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 1], - span: [15, 6, 14], + span: [16, 6, 14], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -482,7 +546,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 2], - span: [15, 16, 28], + span: [16, 16, 28], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -490,7 +554,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 3], - span: [15, 39, 49], + span: [16, 39, 49], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -498,7 +562,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4], - span: [16, 4, 18, 6], + span: [17, 4, 19, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -506,7 +570,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4, 72_295_728], - span: [16, 4, 18, 6], + span: [17, 4, 19, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -514,7 +578,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1], - span: [21, 2, 26, 3], + span: [22, 2, 27, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -522,7 +586,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 1], - span: [21, 6, 18], + span: [22, 6, 18], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -530,7 +594,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 2], - span: [21, 20, 36], + span: [22, 20, 36], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -538,7 +602,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 3], - span: [21, 47, 57], + span: [22, 47, 57], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -546,7 +610,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4], - span: [22, 4, 25, 6], + span: [23, 4, 26, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -554,7 +618,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4, 72_295_728], - span: [22, 4, 25, 6], + span: [23, 4, 26, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -562,7 +626,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0], - span: [30, 0, 32, 1], + span: [31, 0, 33, 1], leading_comments: " The request message containing the user's name.\n", trailing_comments: nil, leading_detached_comments: [], @@ -570,7 +634,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 1], - span: [30, 8, 20], + span: [31, 8, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -578,7 +642,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0], - span: [31, 2, 18], + span: [32, 2, 70], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -586,7 +650,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 5], - span: [31, 2, 8], + span: [32, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -594,7 +658,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 1], - span: [31, 9, 13], + span: ~c" \t\r", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -602,7 +666,23 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 3], - span: [31, 16, 17], + span: [32, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 8], + span: [32, 18, 69], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 8, 9999], + span: [32, 19, 68], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -610,7 +690,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1], - span: [35, 0, 40, 1], + span: [36, 0, 41, 1], leading_comments: " HelloRequestFrom!\n", trailing_comments: nil, leading_detached_comments: [], @@ -618,7 +698,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 1], - span: [35, 8, 24], + span: [36, 8, 24], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -626,7 +706,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0], - span: [37, 2, 18], + span: [38, 2, 70], leading_comments: " Name!\n", trailing_comments: nil, leading_detached_comments: [], @@ -634,7 +714,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 5], - span: [37, 2, 8], + span: [38, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -642,7 +722,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 1], - span: ~c"%\t\r", + span: ~c"&\t\r", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -650,7 +730,23 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 3], - span: [37, 16, 17], + span: [38, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 8], + span: [38, 18, 69], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 8, 9999], + span: [38, 19, 68], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -658,7 +754,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1], - span: [39, 2, 18], + span: [40, 2, 18], leading_comments: " From!\n", trailing_comments: nil, leading_detached_comments: [], @@ -666,7 +762,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1, 5], - span: [39, 2, 8], + span: [40, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -674,7 +770,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1, 1], - span: ~c"'\t\r", + span: ~c"(\t\r", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -682,7 +778,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1, 3], - span: [39, 16, 17], + span: [40, 16, 17], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -690,7 +786,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2], - span: [43, 0, 46, 1], + span: [44, 0, 47, 1], leading_comments: " The response message containing the greetings\n", trailing_comments: nil, leading_detached_comments: [], @@ -698,7 +794,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 1], - span: [43, 8, 18], + span: [44, 8, 18], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -706,7 +802,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 0], - span: [44, 2, 21], + span: [45, 2, 21], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -714,7 +810,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 0, 5], - span: [44, 2, 8], + span: [45, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -722,7 +818,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 0, 1], - span: [44, 9, 16], + span: [45, 9, 16], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -730,7 +826,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 0, 3], - span: [44, 19, 20], + span: [45, 19, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -738,7 +834,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1], - span: [45, 2, 38], + span: [46, 2, 38], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -746,7 +842,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1, 6], - span: [45, 2, 27], + span: [46, 2, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -754,7 +850,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1, 1], - span: [45, 28, 33], + span: [46, 28, 33], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -762,7 +858,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1, 3], - span: ~c"-$%", + span: ~c".$%", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -779,9 +875,9 @@ defmodule Helloworld.GreeterService.Service do } end - rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply, %{}) + rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply) - rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply, %{}) + rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply) end defmodule Helloworld.GreeterService.ActorDispatcher do @@ -875,4 +971,4 @@ defmodule Sidecar.GRPC.Reflection.Server do services: [ Helloworld.GreeterService.Service ] -end \ No newline at end of file +end From 3bcdd7f87ed145784cf5ace6da3e8def0dc18316 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 21 Feb 2024 19:08:11 -0300 Subject: [PATCH 15/48] Some refactor --- lib/sidecar/grpc/dispatcher.ex | 169 +++++++++++++++++---------------- 1 file changed, 88 insertions(+), 81 deletions(-) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index e06e904f..c3108df2 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -8,7 +8,11 @@ defmodule Sidecar.GRPC.Dispatcher do """ require Logger + alias Actors.Registry.ActorRegistry + alias Actors.Registry.HostActor + alias Eigr.Functions.Protocol.Actors.Actor alias Eigr.Functions.Protocol.Actors.ActorId + alias Eigr.Functions.Protocol.Actors.ActorSettings alias GRPC.Server alias Sidecar.GRPC.ServiceResolver, as: ActorResolver @@ -35,22 +39,22 @@ defmodule Sidecar.GRPC.Dispatcher do action_name: "SayHello", input: %{data: "some_data"}, stream: %GRPC.Server.Stream{}, - descriptor: %Google.Protobuf.FileDescriptorProto{ - name: "helloworld.proto", - package: "helloworld"}, - service: [ - %Google.Protobuf.ServiceDescriptorProto{ - name: "GreeterService", - method: [ - %Google.Protobuf.MethodDescriptorProto{ - name: "SayHello", - input_type: ".helloworld.HelloRequest", - output_type: ".helloworld.HelloReply", - } - ] - } - ] - } + descriptor: %Google.Protobuf.FileDescriptorProto{ + name: "helloworld.proto", + package: "helloworld"}, + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "GreeterActor", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "SayHello", + input_type: ".helloworld.HelloRequest", + output_type: ".helloworld.HelloReply", + } + ] + } + ] + } } Sidecar.GRPC.Dispatcher.dispatch(request) @@ -145,75 +149,78 @@ defmodule Sidecar.GRPC.Dispatcher do |> build_request(message) end + # %Google.Protobuf.DescriptorProto{ + # name: "HelloRequest", + # field: [ + # %Google.Protobuf.FieldDescriptorProto{ + # name: "name", + # extendee: nil, + # number: 1, + # label: :LABEL_OPTIONAL, + # type: :TYPE_STRING, + # type_name: nil, + # default_value: nil, + # options: %Google.Protobuf.FieldOptions{ + # ctype: :STRING, + # packed: nil, + # deprecated: false, + # lazy: false, + # jstype: :JS_NORMAL, + # weak: false, + # unverified_lazy: false, + # debug_redact: false, + # uninterpreted_option: [], + # __pb_extensions__: %{ + # {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true + # }, + # __unknown_fields__: [] + # }, + # oneof_index: nil, + # json_name: "name", + # proto3_optional: nil, + # __unknown_fields__: [] + # } + # ], + # nested_type: [], + # enum_type: [], + # extension_range: [], + # extension: [], + # options: nil, + # oneof_decl: [], + # reserved_range: [], + # reserved_name: [], + # __unknown_fields__: [] + # } defp build_id(system_name, actor_name, message) do - %Google.Protobuf.DescriptorProto{field: attributes} = message.descriptor() - - # %Google.Protobuf.DescriptorProto{ - # name: "HelloRequest", - # field: [ - # %Google.Protobuf.FieldDescriptorProto{ - # name: "name", - # extendee: nil, - # number: 1, - # label: :LABEL_OPTIONAL, - # type: :TYPE_STRING, - # type_name: nil, - # default_value: nil, - # options: %Google.Protobuf.FieldOptions{ - # ctype: :STRING, - # packed: nil, - # deprecated: false, - # lazy: false, - # jstype: :JS_NORMAL, - # weak: false, - # unverified_lazy: false, - # debug_redact: false, - # uninterpreted_option: [], - # __pb_extensions__: %{ - # {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true - # }, - # __unknown_fields__: [] - # }, - # oneof_index: nil, - # json_name: "name", - # proto3_optional: nil, - # __unknown_fields__: [] - # } - # ], - # nested_type: [], - # enum_type: [], - # extension_range: [], - # extension: [], - # options: nil, - # oneof_decl: [], - # reserved_range: [], - # reserved_name: [], - # __unknown_fields__: [] - # } - - name = - Enum.map(attributes, fn %Google.Protobuf.FieldDescriptorProto{name: name, options: options} = - _field -> - if not is_nil(options) do - extension = options.__pb_extensions__ - - if not is_nil(extension) and - Map.has_key?(extension, {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id}) do - String.to_atom(name) + actor_id = %ActorId{system: system_name, name: actor_name} + host_actor = ActorRegistry.lookup(actor_id) + + case host_actor do + {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{kind: :NAMED}}}} -> + actor_id + + {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{kind: :UNNAMED}}}} -> + name = + Enum.find_value(message.descriptor().field, fn %Google.Protobuf.FieldDescriptorProto{ + name: name, + options: + %{__pb_extensions__: ext} = _options + } -> + Map.get(ext, {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id}, false) && name + end) + + id = + if not is_nil(name) and Map.has_key?(message, name) do + %ActorId{system: system_name, name: Map.get(message, name), parent: actor_name} else nil end - else - nil - end - end) - - id = - if Map.has_key?(message, name) do - %ActorId{system: system_name, name: Map.get(message, name), parent: actor_name} - else - %ActorId{system: system_name, name: actor_name} - end + + id + + _ -> + nil + end end def build_request(actor_id, message) do From c4ee513ea95b00219d9876c3d8ee5fc41d2ade4a Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Thu, 22 Feb 2024 23:21:22 -0300 Subject: [PATCH 16/48] Build payload --- lib/sidecar/grpc/dispatcher.ex | 63 ++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index c3108df2..c927ca58 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -10,11 +10,16 @@ defmodule Sidecar.GRPC.Dispatcher do alias Actors.Registry.ActorRegistry alias Actors.Registry.HostActor + alias Actors.Actor.CallerProducer + alias Eigr.Functions.Protocol.Actors.Actor alias Eigr.Functions.Protocol.Actors.ActorId alias Eigr.Functions.Protocol.Actors.ActorSettings + alias Eigr.Functions.Protocol.Actors.ActorSystem + alias Eigr.Functions.Protocol.InvocationRequest alias GRPC.Server + alias Sidecar.GRPC.ServiceResolver, as: ActorResolver @doc """ @@ -92,10 +97,6 @@ defmodule Sidecar.GRPC.Dispatcher do "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" ) - # TODO - # Before forwading the request, we must find out through the ServiceResolver module what type of RPC - # it is (unary, client streaming, server streaming, etc...). This way we will know how to forward - # the request correctly (synchronously or asynchronously), as well as how to properly handle the GRPC response. case grpc_type do :client_stream -> handle_client_stream(system_name, actor_name, action_name, message, stream, descriptor) @@ -121,19 +122,22 @@ defmodule Sidecar.GRPC.Dispatcher do defp handle_unary(system_name, actor_name, action_name, message, stream, descriptor) do req = build_id(system_name, actor_name, message) - |> build_request(message) + |> build_request(message, action_name, async: false) + |> request(async: false) end defp handle_client_stream(system_name, actor_name, action_name, message, stream, descriptor) do req = build_id(system_name, actor_name, message) - |> build_request(message) + |> build_request(message, action_name, async: true) + |> request(async: true) end defp handle_server_stream(system_name, actor_name, action_name, message, stream, descriptor) do req = build_id(system_name, actor_name, message) - |> build_request(message) + |> build_request(message, action_name, async: true) + |> request(async: true) end defp handle_bidirectional_stream( @@ -146,7 +150,8 @@ defmodule Sidecar.GRPC.Dispatcher do ) do req = build_id(system_name, actor_name, message) - |> build_request(message) + |> build_request(message, action_name, async: false) + |> request(async: false) end # %Google.Protobuf.DescriptorProto{ @@ -200,29 +205,49 @@ defmodule Sidecar.GRPC.Dispatcher do actor_id {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{kind: :UNNAMED}}}} -> - name = + {ctype, name} = Enum.find_value(message.descriptor().field, fn %Google.Protobuf.FieldDescriptorProto{ name: name, + ctype: ctype, options: %{__pb_extensions__: ext} = _options } -> - Map.get(ext, {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id}, false) && name + Map.get(ext, {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id}, false) && + {ctype, name} end) - id = - if not is_nil(name) and Map.has_key?(message, name) do - %ActorId{system: system_name, name: Map.get(message, name), parent: actor_name} - else - nil - end - - id + if not is_nil(name) and Map.has_key?(message, name) do + %ActorId{system: system_name, name: get_name(ctype, message, name), parent: actor_name} + else + nil + end _ -> nil end end - def build_request(actor_id, message) do + defp get_name(:STRING, message, attribute), do: Map.get(message, attribute) + + defp get_name(_ctype, message, attribute), do: "#{inspect(Map.get(message, attribute))}" + + def build_request(actor_id, message, action_name, opts \\ []) do + async = Keyword.get(opts, :async, false) + + %InvocationRequest{ + async: async, + system: %ActorSystem{}, + actor: %Actor{id: actor_id}, + action_name: action_name, + payload: {:value, nil} + } + end + + def request(nil, opts \\ []) + + def request(nil, _opts), do: {:error, :invalid_payload} + + def request(%InvocationRequest{} = message, opts) do + CallerProducer.invoke(message) end end From f73f0a02028a7c062f23a2f8b4dd588d973e8741 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Fri, 23 Feb 2024 13:07:51 -0300 Subject: [PATCH 17/48] Some refactor --- lib/sidecar/grpc/dispatcher.ex | 335 +++++++++--------- .../generators/service_resolver_generator.ex | 2 - 2 files changed, 158 insertions(+), 179 deletions(-) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index c927ca58..21e447be 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -4,7 +4,6 @@ defmodule Sidecar.GRPC.Dispatcher do This module handles the dispatching of gRPC messages to Actors based on the provided parameters. It logs relevant information and raises an error if the service descriptor is not found. - """ require Logger @@ -19,68 +18,57 @@ defmodule Sidecar.GRPC.Dispatcher do alias Eigr.Functions.Protocol.InvocationRequest alias GRPC.Server + alias GRPC.Server.Stream, as: GRPCStream alias Sidecar.GRPC.ServiceResolver, as: ActorResolver @doc """ - Dispatches a gRPC message to the specified actor. - - ### Parameters: - - - `request` - A map containing the following parameters: - - `system: system_name` - The name of the actor system. - - `actor_name: actor_name` - The name of the actor. - - `action_name: action_name` - The name of action to call. - - `input: message` - The input message. - - `stream: stream` - The stream (optional). - - `descriptor: descriptor` - The service descriptor. - - ### Example: - - ```elixir - request = %{ - system: "spawn-system", - actor_name: "GreeterActor", - action_name: "SayHello", - input: %{data: "some_data"}, - stream: %GRPC.Server.Stream{}, - descriptor: %Google.Protobuf.FileDescriptorProto{ - name: "helloworld.proto", - package: "helloworld"}, - service: [ - %Google.Protobuf.ServiceDescriptorProto{ - name: "GreeterActor", - method: [ - %Google.Protobuf.MethodDescriptorProto{ - name: "SayHello", - input_type: ".helloworld.HelloRequest", - output_type: ".helloworld.HelloReply", - } - ] - } - ] - } + Dispatches a gRPC message to the specified actor. + + ### Parameters: + + - `request` - A map containing the following parameters: + - `system: system_name` - The name of the actor system. + - `actor_name: actor_name` - The name of the actor. + - `action_name: action_name` - The name of action to call. + - `input: message` - The input message. + - `stream: stream` - The stream (optional). + - `descriptor: descriptor` - The service descriptor. + + ### Example: + + ```elixir + request = %{ + system: "spawn-system", + actor_name: "GreeterActor", + action_name: "SayHello", + input: %{data: "some_data"}, + stream: %GRPC.Server.Stream{}, + descriptor: %Google.Protobuf.FileDescriptorProto{ + name: "helloworld.proto", + package: "helloworld"}, + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "GreeterActor", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "SayHello", + input_type: ".helloworld.HelloRequest", + output_type: ".helloworld.HelloReply", + } + ] + } + ] } + } - Sidecar.GRPC.Dispatcher.dispatch(request) - + Sidecar.GRPC.Dispatcher.dispatch(request) """ - def dispatch( - %{ - system: system_name, - actor_name: actor_name, - descriptor: descriptor - } = _request - ) - when is_nil(descriptor) do - Logger.error( - "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}" + def dispatch(%{system: system_name, actor_name: actor_name, descriptor: nil} = _request) do + handle_error( + "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}", + GRPC.Status.failed_precondition() ) - - raise GRPC.RPCError, - status: GRPC.Status.failed_precondition(), - message: - "Service descriptor not found. Impossible to call Actor #{system_name}:#{actor_name}" end def dispatch( @@ -89,149 +77,138 @@ defmodule Sidecar.GRPC.Dispatcher do actor_name: actor_name, action_name: action_name, input: message, - stream: %GRPC.Server.Stream{grpc_type: grpc_type} = stream, - descriptor: descriptor + stream: %GRPCStream{grpc_type: grpc_type} = stream, + descriptor: _descriptor } = request ) do Logger.debug( "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" ) - case grpc_type do - :client_stream -> - handle_client_stream(system_name, actor_name, action_name, message, stream, descriptor) - - :server_stream -> - handle_server_stream(system_name, actor_name, action_name, message, stream, descriptor) - - :bidirectional_stream -> - handle_bidirectional_stream( - system_name, - actor_name, - action_name, - message, - stream, - descriptor - ) + handle_dispatch(system_name, actor_name, action_name, message, stream, grpc_type) + end + + defp handle_dispatch(system_name, actor_name, action_name, message, stream, :client_stream), + do: handle_client_stream(system_name, actor_name, action_name, message, stream) + + defp handle_dispatch(system_name, actor_name, action_name, message, stream, :server_stream), + do: handle_server_stream(system_name, actor_name, action_name, message, stream) + + defp handle_dispatch( + system_name, + actor_name, + action_name, + message, + stream, + :bidirectional_stream + ), + do: handle_bidirectional_stream(system_name, actor_name, action_name, message, stream) + + defp handle_dispatch(system_name, actor_name, action_name, message, stream, _), + do: handle_unary(system_name, actor_name, action_name, message, stream) + + defp handle_client_stream(system_name, actor_name, action_name, message, stream) do + Stream.each(message, fn msg -> + dispatch_async(system_name, actor_name, action_name, msg, stream) + end) + |> Stream.run() + end - _ -> - handle_unary(system_name, actor_name, action_name, message, stream, descriptor) + defp handle_server_stream(system_name, actor_name, action_name, message, stream) do + dispatch_async(system_name, actor_name, action_name, message, stream) + end + + defp handle_bidirectional_stream(system_name, actor_name, action_name, message, stream) do + Stream.each(message, fn msg -> + dispatch_sync(system_name, actor_name, action_name, msg, stream) + end) + |> Stream.run() + end + + defp handle_unary(system_name, actor_name, action_name, message, stream) do + dispatch_sync(system_name, actor_name, action_name, message, stream) + end + + defp dispatch_sync(system_name, actor_name, action_name, message, stream) do + build_actor_id(system_name, actor_name, message) + |> build_request(action_name, message, async: false) + |> invoke_request() + |> case do + {:ok, response} -> + Server.send_reply(stream, response) + + error -> + log_and_raise_error( + "Failure during Actor processing. Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) end end - defp handle_unary(system_name, actor_name, action_name, message, stream, descriptor) do - req = - build_id(system_name, actor_name, message) - |> build_request(message, action_name, async: false) - |> request(async: false) + defp dispatch_async(system_name, actor_name, action_name, message, stream) do + build_actor_id(system_name, actor_name, message) + |> build_request(action_name, message, async: true) + |> invoke_request() + |> case do + {:ok, :async} -> + Server.send_reply(stream, %{}) + + error -> + log_and_raise_error( + "Failure during Actor processing. Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) + end end - defp handle_client_stream(system_name, actor_name, action_name, message, stream, descriptor) do - req = - build_id(system_name, actor_name, message) - |> build_request(message, action_name, async: true) - |> request(async: true) + defp build_actor_id(system_name, actor_name, message) do + {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{} = actor_settings}}} = + ActorRegistry.lookup(%ActorId{system: system_name, name: actor_name}) + + build_actor_id_from_settings(system_name, actor_name, actor_settings, message) end - defp handle_server_stream(system_name, actor_name, action_name, message, stream, descriptor) do - req = - build_id(system_name, actor_name, message) - |> build_request(message, action_name, async: true) - |> request(async: true) + defp build_actor_id_from_settings( + system_name, + actor_name, + %ActorSettings{kind: :NAMED} = _settings, + _message + ) do + %ActorId{system: system_name, name: actor_name} end - defp handle_bidirectional_stream( + defp build_actor_id_from_settings( system_name, actor_name, - action_name, - message, - stream, - descriptor + %ActorSettings{kind: :UNNAMED} = _settings, + message ) do - req = - build_id(system_name, actor_name, message) - |> build_request(message, action_name, async: false) - |> request(async: false) + {ctype, name} = find_actor_name_and_ctype(message) + actor_id_name = get_actor_id_name(ctype, message, name) + %ActorId{system: system_name, name: actor_id_name, parent: actor_name} end - # %Google.Protobuf.DescriptorProto{ - # name: "HelloRequest", - # field: [ - # %Google.Protobuf.FieldDescriptorProto{ - # name: "name", - # extendee: nil, - # number: 1, - # label: :LABEL_OPTIONAL, - # type: :TYPE_STRING, - # type_name: nil, - # default_value: nil, - # options: %Google.Protobuf.FieldOptions{ - # ctype: :STRING, - # packed: nil, - # deprecated: false, - # lazy: false, - # jstype: :JS_NORMAL, - # weak: false, - # unverified_lazy: false, - # debug_redact: false, - # uninterpreted_option: [], - # __pb_extensions__: %{ - # {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true - # }, - # __unknown_fields__: [] - # }, - # oneof_index: nil, - # json_name: "name", - # proto3_optional: nil, - # __unknown_fields__: [] - # } - # ], - # nested_type: [], - # enum_type: [], - # extension_range: [], - # extension: [], - # options: nil, - # oneof_decl: [], - # reserved_range: [], - # reserved_name: [], - # __unknown_fields__: [] - # } - defp build_id(system_name, actor_name, message) do - actor_id = %ActorId{system: system_name, name: actor_name} - host_actor = ActorRegistry.lookup(actor_id) - - case host_actor do - {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{kind: :NAMED}}}} -> - actor_id - - {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{kind: :UNNAMED}}}} -> - {ctype, name} = - Enum.find_value(message.descriptor().field, fn %Google.Protobuf.FieldDescriptorProto{ - name: name, - ctype: ctype, - options: - %{__pb_extensions__: ext} = _options - } -> - Map.get(ext, {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id}, false) && - {ctype, name} - end) - - if not is_nil(name) and Map.has_key?(message, name) do - %ActorId{system: system_name, name: get_name(ctype, message, name), parent: actor_name} - else - nil - end - - _ -> - nil - end + defp build_actor_id_from_settings(_, _, _, _), do: nil + + defp find_actor_name_and_ctype(message) do + Enum.find_value(message.descriptor().field, fn %Google.Protobuf.FieldDescriptorProto{ + name: name, + options: %Google.Protobuf.FieldOptions{ + ctype: ctype, + __pb_extensions__: ext + } + } -> + Map.get(ext, {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id}, false) && + {ctype, name} + end) end - defp get_name(:STRING, message, attribute), do: Map.get(message, attribute) + defp get_actor_id_name(:STRING, message, attribute), do: Map.get(message, attribute) - defp get_name(_ctype, message, attribute), do: "#{inspect(Map.get(message, attribute))}" + defp get_actor_id_name(_ctype, message, attribute), + do: "#{inspect(Map.get(message, attribute))}" - def build_request(actor_id, message, action_name, opts \\ []) do + defp build_request(actor_id, action_name, message, opts) do async = Keyword.get(opts, :async, false) %InvocationRequest{ @@ -243,11 +220,15 @@ defmodule Sidecar.GRPC.Dispatcher do } end - def request(nil, opts \\ []) + defp invoke_request(nil), do: {:error, :invalid_payload} + defp invoke_request(request), do: CallerProducer.invoke(request) - def request(nil, _opts), do: {:error, :invalid_payload} + defp log_and_raise_error(message, status) do + Logger.error(message) + raise GRPC.RPCError, status: status, message: message + end - def request(%InvocationRequest{} = message, opts) do - CallerProducer.invoke(message) + defp handle_error(message, status) do + log_and_raise_error(message, status) end end diff --git a/lib/sidecar/grpc/generators/service_resolver_generator.ex b/lib/sidecar/grpc/generators/service_resolver_generator.ex index 56019a3d..d109f1c1 100644 --- a/lib/sidecar/grpc/generators/service_resolver_generator.ex +++ b/lib/sidecar/grpc/generators/service_resolver_generator.ex @@ -8,7 +8,6 @@ defmodule Sidecar.GRPC.Generators.ServiceResolverGenerator do """ @behaviour ProtobufGenerate.Plugin - alias Actors.Config.PersistentTermConfig, as: Config alias Protobuf.Protoc.Generator.Util @impl true @@ -56,7 +55,6 @@ defmodule Sidecar.GRPC.Generators.ServiceResolverGenerator do Enum.map(svcs, fn svc -> service_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) actor_name = Macro.camelize(svc.name) - name = Util.prepend_package_prefix(ctx.package, svc.name) methods = for m <- svc.method do From c40c092b29551a3838c0725d4b7bb40a43dc4dd6 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Fri, 23 Feb 2024 16:26:25 -0300 Subject: [PATCH 18/48] Encode payload --- lib/sidecar/grpc/dispatcher.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 21e447be..98698880 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -7,9 +7,9 @@ defmodule Sidecar.GRPC.Dispatcher do """ require Logger + alias Actors.Actor.CallerProducer alias Actors.Registry.ActorRegistry alias Actors.Registry.HostActor - alias Actors.Actor.CallerProducer alias Eigr.Functions.Protocol.Actors.Actor alias Eigr.Functions.Protocol.Actors.ActorId @@ -17,11 +17,15 @@ defmodule Sidecar.GRPC.Dispatcher do alias Eigr.Functions.Protocol.Actors.ActorSystem alias Eigr.Functions.Protocol.InvocationRequest + alias Google.Protobuf.Any + alias GRPC.Server alias GRPC.Server.Stream, as: GRPCStream alias Sidecar.GRPC.ServiceResolver, as: ActorResolver + import alias Spawn.Utils.AnySerializer, only: [any_pack!: 1] + @doc """ Dispatches a gRPC message to the specified actor. @@ -216,7 +220,7 @@ defmodule Sidecar.GRPC.Dispatcher do system: %ActorSystem{}, actor: %Actor{id: actor_id}, action_name: action_name, - payload: {:value, nil} + payload: {:value, any_pack!(message)} } end From 9bf27fb3c54d6a4a32b363c65f6e76b382e58daa Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Fri, 23 Feb 2024 16:41:16 -0300 Subject: [PATCH 19/48] Fix imports --- lib/sidecar/grpc/dispatcher.ex | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 98698880..ebb35cd9 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -17,14 +17,12 @@ defmodule Sidecar.GRPC.Dispatcher do alias Eigr.Functions.Protocol.Actors.ActorSystem alias Eigr.Functions.Protocol.InvocationRequest - alias Google.Protobuf.Any - alias GRPC.Server alias GRPC.Server.Stream, as: GRPCStream alias Sidecar.GRPC.ServiceResolver, as: ActorResolver - import alias Spawn.Utils.AnySerializer, only: [any_pack!: 1] + import Spawn.Utils.AnySerializer, only: [any_pack!: 1] @doc """ Dispatches a gRPC message to the specified actor. @@ -135,7 +133,7 @@ defmodule Sidecar.GRPC.Dispatcher do defp dispatch_sync(system_name, actor_name, action_name, message, stream) do build_actor_id(system_name, actor_name, message) - |> build_request(action_name, message, async: false) + |> build_request(system_name, action_name, message, async: false) |> invoke_request() |> case do {:ok, response} -> @@ -151,7 +149,7 @@ defmodule Sidecar.GRPC.Dispatcher do defp dispatch_async(system_name, actor_name, action_name, message, stream) do build_actor_id(system_name, actor_name, message) - |> build_request(action_name, message, async: true) + |> build_request(system_name, action_name, message, async: true) |> invoke_request() |> case do {:ok, :async} -> @@ -212,12 +210,12 @@ defmodule Sidecar.GRPC.Dispatcher do defp get_actor_id_name(_ctype, message, attribute), do: "#{inspect(Map.get(message, attribute))}" - defp build_request(actor_id, action_name, message, opts) do + defp build_request(actor_id, actor_system, action_name, message, opts) do async = Keyword.get(opts, :async, false) %InvocationRequest{ async: async, - system: %ActorSystem{}, + system: %ActorSystem{name: actor_system}, actor: %Actor{id: actor_id}, action_name: action_name, payload: {:value, any_pack!(message)} From 80d81deeb5e106a63ca6ea0521dd7af17ceb8c5e Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Fri, 23 Feb 2024 18:14:54 -0300 Subject: [PATCH 20/48] Fix actor not found --- lib/sidecar/grpc/dispatcher.ex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index ebb35cd9..9f24908b 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -20,8 +20,6 @@ defmodule Sidecar.GRPC.Dispatcher do alias GRPC.Server alias GRPC.Server.Stream, as: GRPCStream - alias Sidecar.GRPC.ServiceResolver, as: ActorResolver - import Spawn.Utils.AnySerializer, only: [any_pack!: 1] @doc """ @@ -210,6 +208,8 @@ defmodule Sidecar.GRPC.Dispatcher do defp get_actor_id_name(_ctype, message, attribute), do: "#{inspect(Map.get(message, attribute))}" + defp build_request(nil, _, _, _, _), do: nil + defp build_request(actor_id, actor_system, action_name, message, opts) do async = Keyword.get(opts, :async, false) @@ -223,6 +223,7 @@ defmodule Sidecar.GRPC.Dispatcher do end defp invoke_request(nil), do: {:error, :invalid_payload} + defp invoke_request(request), do: CallerProducer.invoke(request) defp log_and_raise_error(message, status) do From 2c649bf1ed58dbb8d14aba917d2a69a1ae35b5f9 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 27 May 2024 14:47:28 -0300 Subject: [PATCH 21/48] Correct lock --- mix.lock | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/mix.lock b/mix.lock index 8a2a3607..bc5a9b06 100644 --- a/mix.lock +++ b/mix.lock @@ -1,10 +1,8 @@ %{ "acceptor_pool": {:hex, :acceptor_pool, "1.0.0", "43c20d2acae35f0c2bcd64f9d2bde267e459f0f3fd23dab26485bf518c281b21", [:rebar3], [], "hexpm", "0cbcd83fdc8b9ad2eee2067ef8b91a14858a5883cb7cd800e6fcd5803e158788"}, - "bakeware": {:hex, :bakeware, "0.2.4", "0aaf49b34f4bab2aa433f9ff1485d9401e421603160abd6d269c469fc7b65212", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "7b97bcf6fbeee53bb32441d6c495bf478d26f9575633cfef6831e421e86ada6d"}, - "bandit": {:hex, :bandit, "1.2.2", "569fe5d0efb107c9af37a1e37e25ce2ceec293101a2d4bc512876fc3207192b5", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "2f89adb7281c78d4e75733e0a9e1b24f46f84d2993963d6fa57d0eafadec5f03"}, "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, - "cc_precompiler": {:hex, :cc_precompiler, "0.1.9", "e8d3364f310da6ce6463c3dd20cf90ae7bbecbf6c5203b98bf9b48035592649b", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "9dcab3d0f3038621f1601f13539e7a9ee99843862e66ad62827b0c42b2f58a54"}, + "cc_precompiler": {:hex, :cc_precompiler, "0.1.10", "47c9c08d8869cf09b41da36538f62bc1abd3e19e41701c2cea2675b53c704258", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "f6e046254e53cd6b41c6bacd70ae728011aa82b2742a80d6e2214855c6e06b22"}, "chatterbox": {:hex, :ts_chatterbox, "0.15.1", "5cac4d15dd7ad61fc3c4415ce4826fc563d4643dee897a558ec4ea0b1c835c9c", [:rebar3], [{:hpack, "~> 0.3.0", [hex: :hpack_erl, repo: "hexpm", optional: false]}], "hexpm", "4f75b91451338bc0da5f52f3480fa6ef6e3a2aeecfc33686d6b3d0a0948f31aa"}, "cloak": {:hex, :cloak, "1.1.4", "aba387b22ea4d80d92d38ab1890cc528b06e0e7ef2a4581d71c3fdad59e997e7", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "92b20527b9aba3d939fab0dd32ce592ff86361547cfdc87d74edce6f980eb3d7"}, "cloak_ecto": {:hex, :cloak_ecto, "1.3.0", "0de127c857d7452ba3c3367f53fb814b0410ff9c680a8d20fbe8b9a3c57a1118", [:mix], [{:cloak, "~> 1.1.1", [hex: :cloak, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}], "hexpm", "314beb0c123b8a800418ca1d51065b27ba3b15f085977e65c0f7b2adab2de1cc"}, @@ -16,23 +14,24 @@ "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "decorator": {:hex, :decorator, "1.4.0", "a57ac32c823ea7e4e67f5af56412d12b33274661bb7640ec7fc882f8d23ac419", [:mix], [], "hexpm", "0a07cedd9083da875c7418dea95b78361197cf2bf3211d743f6f7ce39656597f"}, - "delta_crdt": {:hex, :delta_crdt, "0.6.4", "79d235eef82a58bb0cb668bc5b9558d2e65325ccb46b74045f20b36fd41671da", [:mix], [{:merkle_map, "~> 0.2.0", [hex: :merkle_map, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4a81f579c06aeeb625db54c6c109859a38aa00d837e3e7f8ac27b40cea34885a"}, + "delta_crdt": {:hex, :delta_crdt, "0.6.5", "c7bb8c2c7e60f59e46557ab4e0224f67ba22f04c02826e273738f3dcc4767adc", [:mix], [{:merkle_map, "~> 0.2.0", [hex: :merkle_map, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c6ae23a525d30f96494186dd11bf19ed9ae21d9fe2c1f1b217d492a7cc7294ae"}, "earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"}, "ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"}, "ecto_sql": {:hex, :ecto_sql, "3.11.2", "c7cc7f812af571e50b80294dc2e535821b3b795ce8008d07aa5f336591a185a8", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "73c07f995ac17dbf89d3cfaaf688fcefabcd18b7b004ac63b0dc4ef39499ed6b"}, "ecto_sqlite3": {:hex, :ecto_sqlite3, "0.13.0", "0c3dc8ff24f378ef108619fd5c18bbbea43cb86dc8733c1c596bd7e0a5bb9e28", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.11", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:exqlite, "~> 0.9", [hex: :exqlite, repo: "hexpm", optional: false]}], "hexpm", "8ab7d8bf6663b811b80c9fa8730780f7077106c40a3fdbae384fe8f82315b257"}, "ed25519": {:hex, :ed25519, "1.4.1", "479fb83c3e31987c9cad780e6aeb8f2015fb5a482618cdf2a825c9aff809afc4", [:mix], [], "hexpm", "0dacb84f3faa3d8148e81019ca35f9d8dcee13232c32c9db5c2fb8ff48c80ec7"}, - "elixir_make": {:hex, :elixir_make, "0.7.8", "505026f266552ee5aabca0b9f9c229cbb496c689537c9f922f3eb5431157efc7", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "7a71945b913d37ea89b06966e1342c85cfe549b15e6d6d081e8081c493062c07"}, + "elixir_make": {:hex, :elixir_make, "0.8.3", "d38d7ee1578d722d89b4d452a3e36bcfdc644c618f0d063b874661876e708683", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "5c99a18571a756d4af7a4d89ca75c28ac899e6103af6f223982f09ce44942cc9"}, "ex_doc": {:hex, :ex_doc, "0.33.0", "690562b153153c7e4d455dc21dab86e445f66ceba718defe64b0ef6f0bd83ba0", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "3f69adc28274cb51be37d09b03e4565232862a4b10288a3894587b0131412124"}, - "exqlite": {:hex, :exqlite, "0.19.0", "0f3ee29e35bed38552dd0ed59600aa81c78f867f5b5ff0e17d330148e0465483", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "55a8fbb0443f03d4a256e3458bd1203eff5037a6624b76460eaaa9080f462b06"}, + "exqlite": {:hex, :exqlite, "0.23.0", "6e851c937a033299d0784994c66da24845415072adbc455a337e20087bce9033", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.8", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "404341cceec5e6466aaed160cf0b58be2019b60af82588c215e1224ebd3ec831"}, "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, "finch": {:hex, :finch, "0.18.0", "944ac7d34d0bd2ac8998f79f7a811b21d87d911e77a786bc5810adb75632ada4", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6 or ~> 1.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "69f5045b042e531e53edc2574f15e25e735b522c37e2ddb766e15b979e03aa65"}, "flow": {:hex, :flow, "1.2.4", "1dd58918287eb286656008777cb32714b5123d3855956f29aa141ebae456922d", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}], "hexpm", "874adde96368e71870f3510b91e35bc31652291858c86c0e75359cbdd35eb211"}, "gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"}, "gnat": {:hex, :gnat, "1.8.3", "ee12f84b46617d4cef4c0e1ac586ec8bf80b422878866e128e2f37b7cb20a21a", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:nkeys, "~> 0.2", [hex: :nkeys, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ae88816038ccd3dfc9cfcf5b79a5a4dc52623a25062f1e9c9e7641751bf42ceb"}, + "google_protos": {:hex, :google_protos, "0.4.0", "93e1be2c1a07517ffed761f69047776caf35e4acd385aac4f5ce4fedd07f3660", [:mix], [{:protobuf, "~> 0.10", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "4c54983d78761a3643e2198adf0f5d40a5a8b08162f3fc91c50faa257f3fa19f"}, "gproc": {:hex, :gproc, "0.9.1", "f1df0364423539cf0b80e8201c8b1839e229e5f9b3ccb944c5834626998f5b8c", [:rebar3], [], "hexpm", "905088e32e72127ed9466f0bac0d8e65704ca5e73ee5a62cb073c3117916d507"}, "grpc": {:hex, :grpc, "0.8.1", "a8a5884a0d41fc30679c269d0332571cebb43cbfd6eb3d4819169778e866343e", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1cccd9fd83547a562f315cc0e1ee1879546f0a44193b5c8eb8d68dae0bb2065b"}, - "grpc_reflection": {:hex, :grpc_reflection, "0.1.0", "0c835a933c3dd3ff55527a8d491da249b76b762ae56aa43909c87a4f9f1a13ef", [:mix], [{:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "5031b94b115d8e6f66bd71ef1572aca9f2212aa765920c3285a7de382ec5d03e"}, + "grpc_reflection": {:hex, :grpc_reflection, "0.1.3", "17bead7b3c653d65622e2984c057b781b1fc470114c010d1b68f16f8143b9183", [:mix], [{:google_protos, "~> 0.4.0", [hex: :google_protos, repo: "hexpm", optional: false]}, {:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "3c80644a6a8631de3d2c862013988f4986b0f3a987ce57d06f6176a50bb90fe2"}, "grpcbox": {:hex, :grpcbox, "0.17.1", "6e040ab3ef16fe699ffb513b0ef8e2e896da7b18931a1ef817143037c454bcce", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.15.1", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.9.1", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "4a3b5d7111daabc569dc9cbd9b202a3237d81c80bf97212fbc676832cb0ceb17"}, "gun": {:hex, :gun, "2.1.0", "b4e4cbbf3026d21981c447e9e7ca856766046eff693720ba43114d7f5de36e87", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "52fc7fc246bfc3b00e01aea1c2854c70a366348574ab50c57dfe796d24a0101d"}, "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, @@ -55,38 +54,33 @@ "mnesiac": {:hex, :mnesiac, "0.3.14", "5ea3f1f3e615073629d0822bcf2297be73149beee2d1f7e482c1943894f59b53", [:mix], [{:libcluster, "~> 3.3", [hex: :libcluster, repo: "hexpm", optional: true]}], "hexpm", "e51b38bf983b9320aba56d5dce79dbf50cbff07f7495e70b89eb45461b8d32fa"}, "myxql": {:hex, :myxql, "0.6.4", "1502ea37ee23c31b79725b95d4cc3553693c2bda7421b1febc50722fd988c918", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a3307f4671f3009d3708283649adf205bfe280f7e036fc8ef7f16dbf821ab8e9"}, "nebulex": {:hex, :nebulex, "2.6.1", "58c1924fa9f4e844c3470c20e6351b311a556652de29ed3b05fd2e5d817c6fef", [:mix], [{:decorator, "~> 1.4", [hex: :decorator, repo: "hexpm", optional: true]}, {:shards, "~> 1.1", [hex: :shards, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "177949fef2dc34a0055d7140b6bc94f6904225e2b5bbed6266ea9679522d23c6"}, - "nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"}, + "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, - "nimble_pool": {:hex, :nimble_pool, "1.0.0", "5eb82705d138f4dd4423f69ceb19ac667b3b492ae570c9f5c900bb3d2f50a847", [:mix], [], "hexpm", "80be3b882d2d351882256087078e1b1952a28bf98d0a287be87e4a24a710b67a"}, + "nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"}, "nkeys": {:hex, :nkeys, "0.2.2", "b1ab3324ed4f3a2c9658d7e80feeef86b4d15fbfd12ca5c8cf068289f582fcfa", [:mix], [{:ed25519, "~> 1.3", [hex: :ed25519, repo: "hexpm", optional: false]}], "hexpm", "3578802427b8d1d11ea6dd785c2ab774f527e2c3e449e67bd34612ab71ca471d"}, - "observer_cli": {:hex, :observer_cli, "1.7.4", "3c1bfb6d91bf68f6a3d15f46ae20da0f7740d363ee5bc041191ce8722a6c4fae", [:mix, :rebar3], [{:recon, "~> 2.5.1", [hex: :recon, repo: "hexpm", optional: false]}], "hexpm", "50de6d95d814f447458bd5d72666a74624eddb0ef98bdcee61a0153aae0865ff"}, "opentelemetry": {:hex, :opentelemetry, "1.4.0", "f928923ed80adb5eb7894bac22e9a198478e6a8f04020ae1d6f289fdcad0b498", [:rebar3], [{:opentelemetry_api, "~> 1.3.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "50b32ce127413e5d87b092b4d210a3449ea80cd8224090fe68d73d576a3faa15"}, "opentelemetry_api": {:hex, :opentelemetry_api, "1.3.0", "03e2177f28dd8d11aaa88e8522c81c2f6a788170fe52f7a65262340961e663f9", [:mix, :rebar3], [{:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "b9e5ff775fd064fa098dba3c398490b77649a352b40b0b730a6b7dc0bdd68858"}, "opentelemetry_exporter": {:hex, :opentelemetry_exporter, "1.7.0", "dec4e90c0667cf11a3642f7fe71982dbc0c6bfbb8725a0b13766830718cf0d98", [:rebar3], [{:grpcbox, ">= 0.0.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry, "~> 1.4.0", [hex: :opentelemetry, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.3.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:tls_certificate_check, "~> 1.18", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "d0f25f6439ec43f2561537c3fabbe177b38547cddaa3a692cbb8f4770dbefc1e"}, "opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "0.2.0", "b67fe459c2938fcab341cb0951c44860c62347c005ace1b50f8402576f241435", [:mix, :rebar3], [], "hexpm", "d61fa1f5639ee8668d74b527e6806e0503efc55a42db7b5f39939d84c07d6895"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, "phoenix_pubsub_nats": {:hex, :phoenix_pubsub_nats, "0.2.2", "aedfbda3552299a399cc5d1486f05c313f9eb81e0364e9916e6b3b9ffb40ff41", [:mix], [{:gnat, "~> 1.6", [hex: :gnat, repo: "hexpm", optional: false]}, {:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}], "hexpm", "63d117a379f5cc6ba3f9b61a322f821365d3a9b197e43243e0e3b7e47b462a7d"}, - "plug": {:hex, :plug, "1.15.3", "712976f504418f6dff0a3e554c40d705a9bcf89a7ccef92fc6a5ef8f16a30a97", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cc4365a3c010a56af402e0809208873d113e9c38c401cabd88027ef4f5c01fd2"}, - "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, + "plug": {:hex, :plug, "1.16.0", "1d07d50cb9bb05097fdf187b31cf087c7297aafc3fed8299aac79c128a707e47", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cbf53aa1f5c4d758a7559c0bd6d59e286c2be0c6a1fac8cc3eee2f638243b93e"}, + "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, "pluggable": {:hex, :pluggable, "1.1.0", "7eba3bc70c0caf4d9056c63c882df8862f7534f0145da7ab3a47ca73e4adb1e4", [:mix], [], "hexpm", "d12eb00ea47b21e92cd2700d6fbe3737f04b64e71b63aad1c0accde87c751637"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, - "postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"}, + "postgrex": {:hex, :postgrex, "0.18.0", "f34664101eaca11ff24481ed4c378492fed2ff416cd9b06c399e90f321867d7e", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a042989ba1bc1cca7383ebb9e461398e3f89f868c92ce6671feb7ef132a252d1"}, "protobuf": {:hex, :protobuf, "0.12.0", "58c0dfea5f929b96b5aa54ec02b7130688f09d2de5ddc521d696eec2a015b223", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "75fa6cbf262062073dd51be44dd0ab940500e18386a6c4e87d5819a58964dc45"}, - "protobuf_generate": {:hex, :protobuf_generate, "0.1.1", "f6098b85161dcfd48a4f6f1abee4ee5e057981dfc50aafb1aa4bd5b0529aa89b", [:mix], [{:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "93a38c8e2aba2a17e293e9ef1359122741f717103984aa6d1ebdca0efb17ab9d"}, + "protobuf_generate": {:hex, :protobuf_generate, "0.1.2", "45b9a9ae8606333cdea993ceaaecd799d206cdfe23348d37c06207eac76cbee6", [:mix], [{:protobuf, "~> 0.12", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "55b0ff8385703317ca90e1bd30a2ece99e80ae0c73e6ebcfb374e84e57870d61"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, - "recon": {:hex, :recon, "2.5.4", "05dd52a119ee4059fa9daa1ab7ce81bc7a8161a2f12e9d42e9d551ffd2ba901c", [:mix, :rebar3], [], "hexpm", "e9ab01ac7fc8572e41eb59385efeb3fb0ff5bf02103816535bacaedf327d0263"}, "retry": {:hex, :retry, "0.18.0", "dc58ebe22c95aa00bc2459f9e0c5400e6005541cf8539925af0aa027dc860543", [:mix], [], "hexpm", "9483959cc7bf69c9e576d9dfb2b678b71c045d3e6f39ab7c9aa1489df4492d73"}, "shards": {:hex, :shards, "1.1.1", "8b42323457d185b26b15d05187784ce6c5d1e181b35c46fca36c45f661defe02", [:make, :rebar3], [], "hexpm", "169a045dae6668cda15fbf86d31bf433d0dbbaec42c8c23ca4f8f2d405ea8eda"}, - "sobelow": {:hex, :sobelow, "0.13.0", "218afe9075904793f5c64b8837cc356e493d88fddde126a463839351870b8d1e", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cd6e9026b85fc35d7529da14f95e85a078d9dd1907a9097b3ba6ac7ebbe34a0d"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "tds": {:hex, :tds, "2.3.5", "fedfb96d53206f01eac62ead859e47e1541a62e1553e9eb7a8801c7dca59eae8", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.9 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "52e350f5dd5584bbcff9859e331be144d290b41bd4c749b936014a17660662f2"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, "telemetry_metrics": {:hex, :telemetry_metrics, "1.0.0", "29f5f84991ca98b8eb02fc208b2e6de7c95f8bb2294ef244a176675adc7775df", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f23713b3847286a534e005126d4c959ebcca68ae9582118ce436b521d1d47d5d"}, "telemetry_metrics_prometheus_core": {:hex, :telemetry_metrics_prometheus_core, "1.2.1", "c9755987d7b959b557084e6990990cb96a50d6482c683fb9622a63837f3cd3d8", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "5e2c599da4983c4f88a33e9571f1458bf98b0cf6ba930f1dc3a6e8cf45d5afb6"}, "telemetry_poller": {:hex, :telemetry_poller, "1.1.0", "58fa7c216257291caaf8d05678c8d01bd45f4bdbc1286838a28c4bb62ef32999", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9eb9d9cbfd81cbd7cdd24682f8711b6e2b691289a0de6826e58452f28c103c8f"}, - "thousand_island": {:hex, :thousand_island, "1.3.2", "bc27f9afba6e1a676dd36507d42e429935a142cf5ee69b8e3f90bff1383943cd", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0e085b93012cd1057b378fce40cbfbf381ff6d957a382bfdd5eca1a98eec2535"}, "tls_certificate_check": {:hex, :tls_certificate_check, "1.22.1", "0f450cc1568a67a65ce5e15df53c53f9a098c3da081c5f126199a72505858dc1", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "3092be0babdc0e14c2e900542351e066c0fa5a9cf4b3597559ad1e67f07938c0"}, - "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, "x509": {:hex, :x509, "0.8.8", "aaf5e58b19a36a8e2c5c5cff0ad30f64eef5d9225f0fd98fb07912ee23f7aba3", [:mix], [], "hexpm", "ccc3bff61406e5bb6a63f06d549f3dba3a1bbb456d84517efaaa210d8a33750f"}, "yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"}, "yaml_elixir": {:hex, :yaml_elixir, "2.9.0", "9a256da867b37b8d2c1ffd5d9de373a4fda77a32a45b452f1708508ba7bbcb53", [:mix], [{:yamerl, "~> 0.10", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "0cb0e7d4c56f5e99a6253ed1a670ed0e39c13fc45a6da054033928607ac08dfc"}, From cba7712ccf183f54e3799e82bdbf48eff1aab53f Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 27 May 2024 18:31:11 -0300 Subject: [PATCH 22/48] Include modeling with actors documentation --- docs/modeling_with_actors.md | 104 ++++++++++++++++++++++++++++++++++- 1 file changed, 103 insertions(+), 1 deletion(-) diff --git a/docs/modeling_with_actors.md b/docs/modeling_with_actors.md index 05e85ddd..3167bb9e 100644 --- a/docs/modeling_with_actors.md +++ b/docs/modeling_with_actors.md @@ -1,2 +1,104 @@ # Modeling Systems with Actors -TODO \ No newline at end of file + +### Modeling with the Actor Model in Software Architecture + +The Actor Model, introduced by Carl Hewitt in 1973, is a conceptual framework for dealing with concurrent computation. Unlike traditional models that rely on shared state and locks, the Actor Model provides a highly modular and scalable approach to designing systems, making it particularly well-suited for distributed and concurrent applications. + +At its core, the Actor Model revolves around the concept of "actors"—independent entities that encapsulate state and behavior. Each actor can: +1. Receive messages from other actors. +2. Process these messages using its internal behavior. +3. Send messages to other actors. +4. Create new actors. + +This model inherently avoids issues like race conditions and deadlocks by ensuring that each actor processes only one message at a time. Consequently, the state is modified in a thread-safe manner, as actors do not share state directly but communicate exclusively through message passing. + +### Key Benefits + +1. **Concurrency and Scalability**: Since actors operate independently, systems based on the Actor Model can easily scale across multiple processors or machines. This makes it ideal for cloud-native applications and services that demand high concurrency. + +2. **Fault Tolerance**: Actors can be designed to monitor and manage other actors, allowing for robust error handling and recovery strategies. This self-healing capability is a cornerstone of resilient system design. + +3. **Modularity**: Actors encapsulate state and behavior, promoting a modular structure that is easier to reason about, test, and maintain. This separation of concerns aligns well with microservices architecture, where each service can be seen as an actor. + +### Using the Actor Model to Build Business Applications + +In the realm of business applications, the Actor Model can be employed to create robust, scalable, and maintainable systems. Here’s how it can be leveraged: + +1. **Order Processing Systems**: In e-commerce platforms, each order can be represented as an actor. The order actor can handle various stages of the order lifecycle, including validation, payment processing, inventory adjustment, and shipping. By encapsulating these processes within an actor, the system can handle a large number of orders concurrently without interference. + +2. **Customer Service Applications**: Each customer session can be modeled as an actor, managing individual interactions and maintaining state throughout the session. This is particularly useful in chatbots and automated customer service systems where maintaining context and state consistency is crucial. + +3. **Financial Systems**: In banking applications, transactions can be modeled as actors. This allows for secure, concurrent processing of transactions, ensuring that the system can handle multiple operations simultaneously without risking data corruption. + +### Architectural Decisions Influenced by Actor Model Constraints + +Implementing the Actor Model in business applications necessitates careful architectural planning due to its unique constraints and capabilities: + +1. **State Management**: Actors maintain their state internally and do not share state. This requires designing the system in such a way that all necessary information is passed through messages. This may involve breaking down complex processes into smaller, message-driven interactions. + +2. **Message Passing**: Since actors communicate solely through asynchronous messages, it’s essential to design a robust messaging infrastructure. This includes choosing appropriate messaging protocols, ensuring message delivery guarantees (e.g., at-least-once, at-most-once, or exactly-once delivery), and handling message serialization/deserialization. + +3. **Error Handling and Supervision**: Actors can supervise other actors, which means designing a supervision strategy is crucial. This involves defining how actors should respond to failures—whether they should restart, escalate the error, or stop entirely. Effective supervision trees help in building resilient applications. + +4. **Distributed Coordination**: In distributed systems, coordinating actors across multiple nodes can be challenging. Architectural decisions should account for network partitions, latency, and data consistency. Utilizing Spawn framework can simplify these aspects by providing built-in support for distributed actor systems. + +5. **Scalability Considerations**: Scaling an actor-based system requires monitoring actor workloads and ensuring that actors are efficiently distributed across available resources. Load balancing strategies and dynamic actor creation/destruction policies need to be defined to maintain optimal performance. + +### Granularity of Actors and Its Impact + +One critical architectural decision in the Actor Model is determining the granularity of actors. Granularity refers to the size and number of actors within the system, affecting both performance and maintainability. + +#### Fine-Grained vs. Coarse-Grained Actors + +1. **Fine-Grained Actors**: In this approach, actors are small, representing very specific tasks or entities. For example, each item in an inventory system might be an individual actor. + - **Pros**: High concurrency, fine control over individual components, easier to scale specific parts of the system. + - **Cons**: Higher overhead due to the increased number of actors, potential performance issues due to frequent message passing, complex actor management. + +2. **Coarse-Grained Actors**: Here, actors represent larger aggregates, such as an entire inventory or order processing system. + - **Pros**: Reduced overhead, fewer messages, simpler management. + - **Cons**: Reduced concurrency, potential bottlenecks if a single actor becomes overwhelmed, more complex internal state management. + +### Managing Granularity + +To effectively manage granularity, consider the following strategies: + +1. **Profiling and Performance Testing**: Continuously monitor the performance of your actor system. Identify bottlenecks and adjust the granularity accordingly. Profiling tools specific to actor systems, such as those available in Spawn, can help pinpoint performance issues. + +2. **Dynamic Actor Creation**: Use patterns like actor hierarchies and dynamic actor creation to balance the load. For instance, a coarse-grained actor can create fine-grained child actors to handle specific tasks when needed, thus balancing load dynamically. + +3. **State Partitioning**: Partition state across multiple actors where applicable. In a fine-grained system, ensure that each actor holds only the necessary state for its specific responsibility, reducing the overhead of managing large states. + +4. **Batch Processing**: In some cases, batch processing within actors can reduce the message-passing overhead. Group related tasks and process them in batches within a single actor, which can be particularly useful in coarse-grained systems. + +### Modeling Actors as Business Entities + +In business applications, actors can be modeled as business entities to better align with real-world processes and operations. Here’s how to effectively model actors as business entities like users, transactions, and more: + +1. **User Actors**: Each user can be represented as an actor, encapsulating the user's state, preferences, and actions. This actor can handle messages related to user authentication, profile updates, and interaction with other parts of the system. + - **Example**: In a social media platform, a user actor might manage friend requests, message notifications, and content creation. + +2. **Transaction Actors**: Transactions in financial systems can be modeled as actors to ensure secure and isolated processing. Each transaction actor handles the entire lifecycle of a transaction, from initiation to completion, including rollback in case of failures. + - **Example**: In a banking application, a transaction actor can manage the transfer of funds between accounts, ensuring consistency and integrity. + +3. **Order Actors**: For e-commerce platforms, orders can be represented as actors. Each order actor manages the stages of the order lifecycle, such as validation, payment processing, inventory update, and shipping. + - **Example**: An order actor can interact with inventory actors to check stock availability and with payment actors to process transactions. + +### Actor Model and Architectural Patterns + +Actors can be used to implement various architectural patterns, enhancing the robustness and scalability of business applications: + +1. **Saga Pattern**: The Saga pattern is used to manage long-running transactions by breaking them into a series of smaller, isolated transactions that can be individually committed or compensated. Actors are well-suited for implementing the Saga pattern due to their message-passing capabilities and independent state management. + - **Implementation**: Each step of a saga can be an actor, with a coordinator actor managing the overall process. The coordinator sends messages to initiate each step and handles compensation actions in case of failures. + +2. **Event Sourcing**: Actors can be used to implement event sourcing, where changes to the state are stored as a sequence of events. Each actor can manage its event log, ensuring that the state can be reconstructed by replaying events. + - **Implementation**: An order actor, for instance, can log events such as "OrderPlaced," "PaymentProcessed," and "OrderShipped." Replaying these events can reconstruct the current state of the order. + +3. **CQRS (Command Query Responsibility Segregation)**: In a CQRS architecture, actors can handle commands (state-changing operations) and queries (read operations) separately, improving scalability and performance. + - **Implementation**: Command actors handle operations that modify the state, while query actors provide read-only views of the state. This separation can enhance performance by allowing the system to scale read and write operations independently. + +4. **State Machines**: Actors can represent state machines, where each state of the actor corresponds to a different behavior. This is particularly useful in scenarios where an entity has a well-defined lifecycle with distinct states. + - **Implementation**: Consider a user registration process. The user actor can have states like "New," "EmailSent," "Verified," and "Active." Each state defines how the actor responds to messages, enabling clear and maintainable transitions. + +### Conclusion + +The Actor Model offers a robust paradigm for building scalable, resilient, and maintainable software systems. By embracing message-passing and encapsulating state within actors, developers can address the complexities of concurrency and distribution effectively. In business applications, this model can streamline processes such as order handling, customer interactions, and financial transactions. The granularity of actors significantly impacts system performance and maintainability, requiring careful management through profiling, dynamic actor creation, state partitioning, and batch processing. Additionally, actors can be modeled as business entities, aligning system design with real-world processes. By implementing architectural patterns like Sagas \ No newline at end of file From cbe480bf3b50b56458dc09b07cfda1b7d9edfeaf Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Thu, 30 May 2024 11:33:49 -0300 Subject: [PATCH 23/48] fix bandit version conflict --- mix.lock | 10 +++++----- spawn_proxy/proxy/mix.exs | 2 +- spawn_sdk/spawn_sdk_example/mix.lock | 21 +++++++++++---------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/mix.lock b/mix.lock index 8a2a3607..a5718bec 100644 --- a/mix.lock +++ b/mix.lock @@ -1,7 +1,7 @@ %{ "acceptor_pool": {:hex, :acceptor_pool, "1.0.0", "43c20d2acae35f0c2bcd64f9d2bde267e459f0f3fd23dab26485bf518c281b21", [:rebar3], [], "hexpm", "0cbcd83fdc8b9ad2eee2067ef8b91a14858a5883cb7cd800e6fcd5803e158788"}, "bakeware": {:hex, :bakeware, "0.2.4", "0aaf49b34f4bab2aa433f9ff1485d9401e421603160abd6d269c469fc7b65212", [:make, :mix], [{:elixir_make, "~> 0.6", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "7b97bcf6fbeee53bb32441d6c495bf478d26f9575633cfef6831e421e86ada6d"}, - "bandit": {:hex, :bandit, "1.2.2", "569fe5d0efb107c9af37a1e37e25ce2ceec293101a2d4bc512876fc3207192b5", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "2f89adb7281c78d4e75733e0a9e1b24f46f84d2993963d6fa57d0eafadec5f03"}, + "bandit": {:hex, :bandit, "1.5.2", "ed0a41c43a9e529c670d0fd48371db4027e7b80d43b1942893e17deb8bed0540", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "35ddbdce7e8a2a3c6b5093f7299d70832a43ed2f4a1852885a61d334cab1b4ad"}, "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, "cc_precompiler": {:hex, :cc_precompiler, "0.1.9", "e8d3364f310da6ce6463c3dd20cf90ae7bbecbf6c5203b98bf9b48035592649b", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "9dcab3d0f3038621f1601f13539e7a9ee99843862e66ad62827b0c42b2f58a54"}, @@ -38,7 +38,7 @@ "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, "horde": {:hex, :horde, "0.9.0", "522342bd7149aeed453c97692a8bca9cf7c9368c5a489afd802e575dc8df54a6", [:mix], [{:delta_crdt, "~> 0.6.2", [hex: :delta_crdt, repo: "hexpm", optional: false]}, {:libring, "~> 1.4", [hex: :libring, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_poller, "~> 0.5.0 or ~> 1.0", [hex: :telemetry_poller, repo: "hexpm", optional: false]}], "hexpm", "fae11e5bc9c980038607d0c3338cdf7f97124a5d5382fd4b6fb6beaab8e214fe"}, "hpack": {:hex, :hpack_erl, "0.3.0", "2461899cc4ab6a0ef8e970c1661c5fc6a52d3c25580bc6dd204f84ce94669926", [:rebar3], [], "hexpm", "d6137d7079169d8c485c6962dfe261af5b9ef60fbc557344511c1e65e3d95fb0"}, - "hpax": {:hex, :hpax, "0.2.0", "5a58219adcb75977b2edce5eb22051de9362f08236220c9e859a47111c194ff5", [:mix], [], "hexpm", "bea06558cdae85bed075e6c036993d43cd54d447f76d8190a8db0dc5893fa2f1"}, + "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"}, "iter": {:hex, :iter, "0.1.2", "bd5dbba48ba67e0f134889a4a29f2b377db6cdcee0661f3c29439e7b649e317a", [:mix], [], "hexpm", "e79f53ed36105ae72582fd3ef224ca2539ccc00cdc27e6e7fe69c49119c4e39b"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, "k8s": {:hex, :k8s, "2.6.1", "ef949e268a65fc45e4481e1071b96c8aa7eae028f0f451052c301d72aae649a2", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: false]}, {:mint_web_socket, "~> 1.0", [hex: :mint_web_socket, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.8", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "a95bde29b60ea94b2ba341969f911e94ae38fc635a332549c39e726ba76ebe10"}, @@ -66,8 +66,8 @@ "opentelemetry_semantic_conventions": {:hex, :opentelemetry_semantic_conventions, "0.2.0", "b67fe459c2938fcab341cb0951c44860c62347c005ace1b50f8402576f241435", [:mix, :rebar3], [], "hexpm", "d61fa1f5639ee8668d74b527e6806e0503efc55a42db7b5f39939d84c07d6895"}, "phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"}, "phoenix_pubsub_nats": {:hex, :phoenix_pubsub_nats, "0.2.2", "aedfbda3552299a399cc5d1486f05c313f9eb81e0364e9916e6b3b9ffb40ff41", [:mix], [{:gnat, "~> 1.6", [hex: :gnat, repo: "hexpm", optional: false]}, {:jason, "~> 1.3", [hex: :jason, repo: "hexpm", optional: false]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}], "hexpm", "63d117a379f5cc6ba3f9b61a322f821365d3a9b197e43243e0e3b7e47b462a7d"}, - "plug": {:hex, :plug, "1.15.3", "712976f504418f6dff0a3e554c40d705a9bcf89a7ccef92fc6a5ef8f16a30a97", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cc4365a3c010a56af402e0809208873d113e9c38c401cabd88027ef4f5c01fd2"}, - "plug_crypto": {:hex, :plug_crypto, "2.0.0", "77515cc10af06645abbfb5e6ad7a3e9714f805ae118fa1a70205f80d2d70fe73", [:mix], [], "hexpm", "53695bae57cc4e54566d993eb01074e4d894b65a3766f1c43e2c61a1b0f45ea9"}, + "plug": {:hex, :plug, "1.16.0", "1d07d50cb9bb05097fdf187b31cf087c7297aafc3fed8299aac79c128a707e47", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cbf53aa1f5c4d758a7559c0bd6d59e286c2be0c6a1fac8cc3eee2f638243b93e"}, + "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, "pluggable": {:hex, :pluggable, "1.1.0", "7eba3bc70c0caf4d9056c63c882df8862f7534f0145da7ab3a47ca73e4adb1e4", [:mix], [], "hexpm", "d12eb00ea47b21e92cd2700d6fbe3737f04b64e71b63aad1c0accde87c751637"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, "postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"}, @@ -84,7 +84,7 @@ "telemetry_metrics": {:hex, :telemetry_metrics, "1.0.0", "29f5f84991ca98b8eb02fc208b2e6de7c95f8bb2294ef244a176675adc7775df", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f23713b3847286a534e005126d4c959ebcca68ae9582118ce436b521d1d47d5d"}, "telemetry_metrics_prometheus_core": {:hex, :telemetry_metrics_prometheus_core, "1.2.1", "c9755987d7b959b557084e6990990cb96a50d6482c683fb9622a63837f3cd3d8", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "5e2c599da4983c4f88a33e9571f1458bf98b0cf6ba930f1dc3a6e8cf45d5afb6"}, "telemetry_poller": {:hex, :telemetry_poller, "1.1.0", "58fa7c216257291caaf8d05678c8d01bd45f4bdbc1286838a28c4bb62ef32999", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9eb9d9cbfd81cbd7cdd24682f8711b6e2b691289a0de6826e58452f28c103c8f"}, - "thousand_island": {:hex, :thousand_island, "1.3.2", "bc27f9afba6e1a676dd36507d42e429935a142cf5ee69b8e3f90bff1383943cd", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "0e085b93012cd1057b378fce40cbfbf381ff6d957a382bfdd5eca1a98eec2535"}, + "thousand_island": {:hex, :thousand_island, "1.3.5", "6022b6338f1635b3d32406ff98d68b843ba73b3aa95cfc27154223244f3a6ca5", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2be6954916fdfe4756af3239fb6b6d75d0b8063b5df03ba76fd8a4c87849e180"}, "tls_certificate_check": {:hex, :tls_certificate_check, "1.22.1", "0f450cc1568a67a65ce5e15df53c53f9a098c3da081c5f126199a72505858dc1", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "3092be0babdc0e14c2e900542351e066c0fa5a9cf4b3597559ad1e67f07938c0"}, "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, "x509": {:hex, :x509, "0.8.8", "aaf5e58b19a36a8e2c5c5cff0ad30f64eef5d9225f0fd98fb07912ee23f7aba3", [:mix], [], "hexpm", "ccc3bff61406e5bb6a63f06d549f3dba3a1bbb456d84517efaaa210d8a33750f"}, diff --git a/spawn_proxy/proxy/mix.exs b/spawn_proxy/proxy/mix.exs index 0fb35727..2d722eac 100644 --- a/spawn_proxy/proxy/mix.exs +++ b/spawn_proxy/proxy/mix.exs @@ -31,7 +31,7 @@ defmodule Proxy.MixProject do [ {:spawn, path: "../../"}, {:bakeware, "~> 0.2"}, - {:bandit, "~> 1.1"}, + {:bandit, "~> 1.5"}, {:observer_cli, "~> 1.7"}, {:sobelow, "~> 0.13", only: [:dev, :test], runtime: false} ] diff --git a/spawn_sdk/spawn_sdk_example/mix.lock b/spawn_sdk/spawn_sdk_example/mix.lock index cc408f49..c7c4878a 100644 --- a/spawn_sdk/spawn_sdk_example/mix.lock +++ b/spawn_sdk/spawn_sdk_example/mix.lock @@ -4,13 +4,13 @@ "benchee": {:hex, :benchee, "1.1.0", "f3a43817209a92a1fade36ef36b86e1052627fd8934a8b937ac9ab3a76c43062", [:mix], [{:deep_merge, "~> 1.0", [hex: :deep_merge, repo: "hexpm", optional: false]}, {:statistex, "~> 1.0", [hex: :statistex, repo: "hexpm", optional: false]}], "hexpm", "7da57d545003165a012b587077f6ba90b89210fd88074ce3c60ce239eb5e6d93"}, "benchee_html": {:hex, :benchee_html, "1.0.0", "5b4d24effebd060f466fb460ec06576e7b34a00fc26b234fe4f12c4f05c95947", [:mix], [{:benchee, ">= 0.99.0 and < 2.0.0", [hex: :benchee, repo: "hexpm", optional: false]}, {:benchee_json, "~> 1.0", [hex: :benchee_json, repo: "hexpm", optional: false]}], "hexpm", "5280af9aac432ff5ca4216d03e8a93f32209510e925b60e7f27c33796f69e699"}, "benchee_json": {:hex, :benchee_json, "1.0.0", "cc661f4454d5995c08fe10dd1f2f72f229c8f0fb1c96f6b327a8c8fc96a91fe5", [:mix], [{:benchee, ">= 0.99.0 and < 2.0.0", [hex: :benchee, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "da05d813f9123505f870344d68fb7c86a4f0f9074df7d7b7e2bb011a63ec231c"}, - "castore": {:hex, :castore, "1.0.4", "ff4d0fb2e6411c0479b1d965a814ea6d00e51eb2f58697446e9c41a97d940b28", [:mix], [], "hexpm", "9418c1b8144e11656f0be99943db4caf04612e3eaecefb5dae9a2a87565584f8"}, + "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, "cc_precompiler": {:hex, :cc_precompiler, "0.1.9", "e8d3364f310da6ce6463c3dd20cf90ae7bbecbf6c5203b98bf9b48035592649b", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "9dcab3d0f3038621f1601f13539e7a9ee99843862e66ad62827b0c42b2f58a54"}, "chatterbox": {:hex, :ts_chatterbox, "0.13.0", "6f059d97bcaa758b8ea6fffe2b3b81362bd06b639d3ea2bb088335511d691ebf", [:rebar3], [{:hpack, "~>0.2.3", [hex: :hpack_erl, repo: "hexpm", optional: false]}], "hexpm", "b93d19104d86af0b3f2566c4cba2a57d2e06d103728246ba1ac6c3c0ff010aa7"}, "cloak": {:hex, :cloak, "1.1.2", "7e0006c2b0b98d976d4f559080fabefd81f0e0a50a3c4b621f85ceeb563e80bb", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "940d5ac4fcd51b252930fd112e319ea5ae6ab540b722f3ca60a85666759b9585"}, "cloak_ecto": {:hex, :cloak_ecto, "1.2.0", "e86a3df3bf0dc8980f70406bcb0af2858bac247d55494d40bc58a152590bd402", [:mix], [{:cloak, "~> 1.1.1", [hex: :cloak, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}], "hexpm", "8bcc677185c813fe64b786618bd6689b1707b35cd95acaae0834557b15a0c62f"}, - "cowboy": {:hex, :cowboy, "2.11.0", "356bf784599cf6f2cdc6ad12fdcfb8413c2d35dab58404cf000e1feaed3f5645", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "0fa395437f1b0e104e0e00999f39d2ac5f4082ac5049b67a5b6d56ecc31b1403"}, - "cowlib": {:hex, :cowlib, "2.12.1", "a9fa9a625f1d2025fe6b462cb865881329b5caff8f1854d1cbc9f9533f00e1e1", [:make, :rebar3], [], "hexpm", "163b73f6367a7341b33c794c4e88e7dbfe6498ac42dcd69ef44c5bc5507c8db0"}, + "cowboy": {:hex, :cowboy, "2.12.0", "f276d521a1ff88b2b9b4c54d0e753da6c66dd7be6c9fca3d9418b561828a3731", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:ranch, "1.8.0", [hex: :ranch, repo: "hexpm", optional: false]}], "hexpm", "8a7abe6d183372ceb21caa2709bec928ab2b72e18a3911aa1771639bef82651e"}, + "cowlib": {:hex, :cowlib, "2.13.0", "db8f7505d8332d98ef50a3ef34b34c1afddec7506e4ee4dd4a3a266285d282ca", [:make, :rebar3], [], "hexpm", "e1e1284dc3fc030a64b1ad0d8382ae7e99da46c3246b815318a4b848873800a4"}, "ctx": {:hex, :ctx, "0.6.0", "8ff88b70e6400c4df90142e7f130625b82086077a45364a78d208ed3ed53c7fe", [:rebar3], [], "hexpm", "a14ed2d1b67723dbebbe423b28d7615eb0bdcba6ff28f2d1f1b0a7e1d4aa5fc2"}, "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, @@ -29,15 +29,16 @@ "flow": {:hex, :flow, "1.2.4", "1dd58918287eb286656008777cb32714b5123d3855956f29aa141ebae456922d", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}], "hexpm", "874adde96368e71870f3510b91e35bc31652291858c86c0e75359cbdd35eb211"}, "gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"}, "gnat": {:hex, :gnat, "1.7.1", "491144f9c3aec00e9941d69538e2fd2836271e220315c8d2d87907c20ca7abc8", [:mix], [{:cowlib, "~> 2.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:nkeys, "~> 0.2", [hex: :nkeys, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "a5629088d9bdb16d982eb48fd431cf6c5a71e9b026281781983501237ab5b911"}, + "google_protos": {:hex, :google_protos, "0.4.0", "93e1be2c1a07517ffed761f69047776caf35e4acd385aac4f5ce4fedd07f3660", [:mix], [{:protobuf, "~> 0.10", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "4c54983d78761a3643e2198adf0f5d40a5a8b08162f3fc91c50faa257f3fa19f"}, "gproc": {:hex, :gproc, "0.8.0", "cea02c578589c61e5341fce149ea36ccef236cc2ecac8691fba408e7ea77ec2f", [:rebar3], [], "hexpm", "580adafa56463b75263ef5a5df4c86af321f68694e7786cb057fd805d1e2a7de"}, - "grpc": {:hex, :grpc, "0.7.0", "a86eab356b0b84406b526786a947ca50e9b9eae87108c873b51e321f8a71e8ed", [:mix], [{:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "632a9507da8d3c12b112b197db4d60da3c95bad02594d37711eeb622d032f254"}, - "grpc_reflection": {:git, "https://github.com/elixir-grpc/grpc-reflection", "07a295d2dec47edd112de64355b0e4d9a129324b", []}, + "grpc": {:hex, :grpc, "0.8.1", "a8a5884a0d41fc30679c269d0332571cebb43cbfd6eb3d4819169778e866343e", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1cccd9fd83547a562f315cc0e1ee1879546f0a44193b5c8eb8d68dae0bb2065b"}, + "grpc_reflection": {:hex, :grpc_reflection, "0.1.3", "17bead7b3c653d65622e2984c057b781b1fc470114c010d1b68f16f8143b9183", [:mix], [{:google_protos, "~> 0.4.0", [hex: :google_protos, repo: "hexpm", optional: false]}, {:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "3c80644a6a8631de3d2c862013988f4986b0f3a987ce57d06f6176a50bb90fe2"}, "grpcbox": {:hex, :grpcbox, "0.16.0", "b83f37c62d6eeca347b77f9b1ec7e9f62231690cdfeb3a31be07cd4002ba9c82", [:rebar3], [{:acceptor_pool, "~>1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~>0.13.0", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~>0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~>0.8.0", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "294df743ae20a7e030889f00644001370a4f7ce0121f3bbdaf13cf3169c62913"}, - "gun": {:hex, :gun, "2.0.1", "160a9a5394800fcba41bc7e6d421295cf9a7894c2252c0678244948e3336ad73", [:make, :rebar3], [{:cowlib, "2.12.1", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "a10bc8d6096b9502205022334f719cc9a08d9adcfbfc0dbee9ef31b56274a20b"}, + "gun": {:hex, :gun, "2.1.0", "b4e4cbbf3026d21981c447e9e7ca856766046eff693720ba43114d7f5de36e87", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "52fc7fc246bfc3b00e01aea1c2854c70a366348574ab50c57dfe796d24a0101d"}, "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, "horde": {:hex, :horde, "0.9.0", "522342bd7149aeed453c97692a8bca9cf7c9368c5a489afd802e575dc8df54a6", [:mix], [{:delta_crdt, "~> 0.6.2", [hex: :delta_crdt, repo: "hexpm", optional: false]}, {:libring, "~> 1.4", [hex: :libring, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_poller, "~> 0.5.0 or ~> 1.0", [hex: :telemetry_poller, repo: "hexpm", optional: false]}], "hexpm", "fae11e5bc9c980038607d0c3338cdf7f97124a5d5382fd4b6fb6beaab8e214fe"}, "hpack": {:hex, :hpack_erl, "0.2.3", "17670f83ff984ae6cd74b1c456edde906d27ff013740ee4d9efaa4f1bf999633", [:rebar3], [], "hexpm", "06f580167c4b8b8a6429040df36cc93bba6d571faeaec1b28816523379cbb23a"}, - "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"}, + "hpax": {:hex, :hpax, "0.2.0", "5a58219adcb75977b2edce5eb22051de9362f08236220c9e859a47111c194ff5", [:mix], [], "hexpm", "bea06558cdae85bed075e6c036993d43cd54d447f76d8190a8db0dc5893fa2f1"}, "iter": {:hex, :iter, "0.1.2", "bd5dbba48ba67e0f134889a4a29f2b377db6cdcee0661f3c29439e7b649e317a", [:mix], [], "hexpm", "e79f53ed36105ae72582fd3ef224ca2539ccc00cdc27e6e7fe69c49119c4e39b"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, "jsx": {:hex, :jsx, "2.8.3", "a05252d381885240744d955fbe3cf810504eb2567164824e19303ea59eef62cf", [:mix, :rebar3], [], "hexpm", "fc3499fed7a726995aa659143a248534adc754ebd16ccd437cd93b649a95091f"}, @@ -48,7 +49,7 @@ "meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"}, "merkle_map": {:hex, :merkle_map, "0.2.1", "01a88c87a6b9fb594c67c17ebaf047ee55ffa34e74297aa583ed87148006c4c8", [:mix], [], "hexpm", "fed4d143a5c8166eee4fa2b49564f3c4eace9cb252f0a82c1613bba905b2d04d"}, "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, - "mint": {:hex, :mint, "1.5.1", "8db5239e56738552d85af398798c80648db0e90f343c8469f6c6d8898944fb6f", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "4a63e1e76a7c3956abd2c72f370a0d0aecddc3976dea5c27eccbecfa5e7d5b1e"}, + "mint": {:hex, :mint, "1.6.0", "88a4f91cd690508a04ff1c3e28952f322528934be541844d54e0ceb765f01d5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "3c5ae85d90a5aca0a49c0d8b67360bbe407f3b54f1030a111047ff988e8fefaa"}, "mint_web_socket": {:hex, :mint_web_socket, "1.0.3", "aab42fff792a74649916236d0b01f560a0b3f03ca5dea693c230d1c44736b50e", [:mix], [{:mint, "~> 1.4 and >= 1.4.1", [hex: :mint, repo: "hexpm", optional: false]}], "hexpm", "ca3810ca44cc8532e3dce499cc17f958596695d226bb578b2fbb88c09b5954b0"}, "mnesiac": {:hex, :mnesiac, "0.3.14", "5ea3f1f3e615073629d0822bcf2297be73149beee2d1f7e482c1943894f59b53", [:mix], [{:libcluster, "~> 3.3", [hex: :libcluster, repo: "hexpm", optional: true]}], "hexpm", "e51b38bf983b9320aba56d5dce79dbf50cbff07f7495e70b89eb45461b8d32fa"}, "myxql": {:hex, :myxql, "0.6.4", "1502ea37ee23c31b79725b95d4cc3553693c2bda7421b1febc50722fd988c918", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a3307f4671f3009d3708283649adf205bfe280f7e036fc8ef7f16dbf821ab8e9"}, @@ -79,8 +80,8 @@ "statistex": {:hex, :statistex, "1.0.0", "f3dc93f3c0c6c92e5f291704cf62b99b553253d7969e9a5fa713e5481cd858a5", [:mix], [], "hexpm", "ff9d8bee7035028ab4742ff52fc80a2aa35cece833cf5319009b52f1b5a86c27"}, "tds": {:hex, :tds, "2.3.4", "534749dd9ef61af960fcafa9cbb7186d6d7b9f92ea0133fb25da07b121c8295c", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.9 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "bb9a53d4688a85fd566f342f76b50d39adfc4b410062886ef908365ead24ba3f"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, - "telemetry_metrics": {:hex, :telemetry_metrics, "0.6.1", "315d9163a1d4660aedc3fee73f33f1d355dcc76c5c3ab3d59e76e3edf80eef1f", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "7be9e0871c41732c233be71e4be11b96e56177bf15dde64a8ac9ce72ac9834c6"}, - "telemetry_metrics_prometheus_core": {:hex, :telemetry_metrics_prometheus_core, "1.1.0", "4e15f6d7dbedb3a4e3aed2262b7e1407f166fcb9c30ca3f96635dfbbef99965c", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "0dd10e7fe8070095df063798f82709b0a1224c31b8baf6278b423898d591a069"}, + "telemetry_metrics": {:hex, :telemetry_metrics, "1.0.0", "29f5f84991ca98b8eb02fc208b2e6de7c95f8bb2294ef244a176675adc7775df", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "f23713b3847286a534e005126d4c959ebcca68ae9582118ce436b521d1d47d5d"}, + "telemetry_metrics_prometheus_core": {:hex, :telemetry_metrics_prometheus_core, "1.2.1", "c9755987d7b959b557084e6990990cb96a50d6482c683fb9622a63837f3cd3d8", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_metrics, "~> 0.6 or ~> 1.0", [hex: :telemetry_metrics, repo: "hexpm", optional: false]}], "hexpm", "5e2c599da4983c4f88a33e9571f1458bf98b0cf6ba930f1dc3a6e8cf45d5afb6"}, "telemetry_poller": {:hex, :telemetry_poller, "1.0.0", "db91bb424e07f2bb6e73926fcafbfcbcb295f0193e0a00e825e589a0a47e8453", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "b3a24eafd66c3f42da30fc3ca7dda1e9d546c12250a2d60d7b81d264fbec4f6e"}, "tls_certificate_check": {:hex, :tls_certificate_check, "1.19.0", "c76c4c5d79ee79a2b11c84f910c825d6f024a78427c854f515748e9bd025e987", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "4083b4a298add534c96125337cb01161c358bb32dd870d5a893aae685fd91d70"}, "toml": {:hex, :toml, "0.7.0", "fbcd773caa937d0c7a02c301a1feea25612720ac3fa1ccb8bfd9d30d822911de", [:mix], [], "hexpm", "0690246a2478c1defd100b0c9b89b4ea280a22be9a7b313a8a058a2408a2fa70"}, From 6e113a9f33d7f33a8a63139e1c6e2376d9e0b3b1 Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Thu, 30 May 2024 12:30:20 -0300 Subject: [PATCH 24/48] symlink protos priv path --- priv/protos/helloworld.proto | 5 +- spawn_proxy/proxy/priv/protos | 1 + .../functions/protocol/actors/actor.proto | 169 --- .../functions/protocol/actors/protocol.proto | 452 ------ .../functions/protocol/actors/state.proto | 28 - .../priv/protos/google/api/annotations.proto | 31 - .../proxy/priv/protos/google/api/http.proto | 375 ----- .../priv/protos/google/protobuf/any.proto | 158 --- .../priv/protos/google/protobuf/api.proto | 207 --- .../protos/google/protobuf/descriptor.proto | 1223 ----------------- .../protos/google/protobuf/duration.proto | 115 -- .../priv/protos/google/protobuf/empty.proto | 51 - .../protos/google/protobuf/field_mask.proto | 245 ---- .../google/protobuf/source_context.proto | 48 - .../priv/protos/google/protobuf/struct.proto | 95 -- .../protos/google/protobuf/timestamp.proto | 144 -- .../priv/protos/google/protobuf/type.proto | 193 --- .../protos/google/protobuf/wrappers.proto | 123 -- .../grpc/reflection/v1alpha/reflection.proto | 136 -- .../proxy/priv/protos/helloworld.proto | 47 - .../priv/protos/io/cloudevents/v1/spec.proto | 59 - .../priv/protos/modules/helloworld.pb.ex | 848 ------------ 22 files changed, 3 insertions(+), 4750 deletions(-) create mode 120000 spawn_proxy/proxy/priv/protos delete mode 100644 spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/actor.proto delete mode 100644 spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/protocol.proto delete mode 100644 spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/state.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/api/annotations.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/api/http.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/any.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/api.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/descriptor.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/duration.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/empty.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/field_mask.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/source_context.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/struct.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/timestamp.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/type.proto delete mode 100644 spawn_proxy/proxy/priv/protos/google/protobuf/wrappers.proto delete mode 100644 spawn_proxy/proxy/priv/protos/grpc/reflection/v1alpha/reflection.proto delete mode 100644 spawn_proxy/proxy/priv/protos/helloworld.proto delete mode 100644 spawn_proxy/proxy/priv/protos/io/cloudevents/v1/spec.proto delete mode 100644 spawn_proxy/proxy/priv/protos/modules/helloworld.pb.ex diff --git a/priv/protos/helloworld.proto b/priv/protos/helloworld.proto index cf94c447..47aa9793 100644 --- a/priv/protos/helloworld.proto +++ b/priv/protos/helloworld.proto @@ -7,7 +7,6 @@ option objc_class_prefix = "HLW"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; -import "eigr/functions/protocol/actors/extensions.proto"; package helloworld; @@ -30,13 +29,13 @@ service GreeterService { // The request message containing the user's name. message HelloRequest { - string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; + string name = 1; } // HelloRequestFrom! message HelloRequestFrom { // Name! - string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; + string name = 1; // From! string from = 2; } diff --git a/spawn_proxy/proxy/priv/protos b/spawn_proxy/proxy/priv/protos new file mode 120000 index 00000000..94135011 --- /dev/null +++ b/spawn_proxy/proxy/priv/protos @@ -0,0 +1 @@ +../../../priv/protos/ \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/actor.proto b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/actor.proto deleted file mode 100644 index 9e72b0ca..00000000 --- a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/actor.proto +++ /dev/null @@ -1,169 +0,0 @@ -syntax = "proto3"; - -package eigr.functions.protocol.actors; - -import "google/protobuf/any.proto"; - -option java_package = "io.eigr.functions.protocol.actors"; -option go_package = "github.com/eigr/go-support/eigr/actors;actors"; - -message Registry { - map actors = 1; -} - -message ActorSystem { - string name = 1; - Registry registry = 2; -} - -// A strategy for save state. -message ActorSnapshotStrategy { - oneof strategy { - // the timeout strategy. - TimeoutStrategy timeout = 1; - } -} - -// A strategy which a user function's entity is passivated. -message ActorDeactivationStrategy { - oneof strategy { - // the timeout strategy. - TimeoutStrategy timeout = 1; - } -} - -// A strategy based on a timeout. -message TimeoutStrategy { - // The timeout in millis - int64 timeout = 1; -} - -// A action represents an action that the user can perform on an Actor. -// Actions in supporting languages are represented by functions or methods. -// An Actor action has nothing to do with the semantics of Actions in a CQRS/EventSourced system. -// It just represents an action that supporting languages can invoke. -message Action { - - // The name of the function or method in the supporting language that has been registered in Ator. - string name = 1; -} - -// A FixedTimerAction is similar to a regular Action, its main differences are that it is scheduled to run at regular intervals -// and only takes the actor's state as an argument. -// Timer Actions are good for executing loops that manipulate the actor's own state. -// In Elixir or other languages in BEAM it would be similar to invoking Process.send_after(self(), atom, msg, timeout) -message FixedTimerAction { - - // The time to wait until the action is triggered - int32 seconds = 1; - - // See Action description Above - Action action = 2; -} - -message ActorState { - map tags = 1; - google.protobuf.Any state = 2; -} - -// Metadata represents a set of key-value pairs that can be used to -// provide additional information about an Actor. -message Metadata { - // A channel group represents a way to send actions to various actors - // that belong to a certain semantic group. Following the Pub-Sub pattern. - repeated Channel channel_group = 1; - - map tags = 2; -} - -// Represents a Pub-Sub binding, where a actor can be subscribed to a channel -// and map a specific action to a specific topic if necessary -// if the action is not informed, the default action will be "receive". -message Channel { - string topic = 1; - string action = 2; -} - -// The type that defines the runtime characteristics of the Actor. -// Regardless of the type of actor it is important that -// all actors are registered during the proxy and host initialization phase. -enum Kind { - // When no type is informed, the default to be assumed will be the Named pattern. - UNKNOW_KIND = 0; - - // NAMED actors as the name suggests have only one real instance of themselves running - // during their entire lifecycle. That is, they are the opposite of the UNNAMED type Actors. - NAMED = 1; - - // UNNAMED actors are used to create children of this based actor at runtime - UNNAMED = 2; - - // Pooled Actors are similar to Unnamed actors, but unlike them, - // their identifying name will always be the one registered at the system initialization stage. - // The great advantage of Pooled actors is that they have multiple instances of themselves - // acting as a request service pool. - // Pooled actors are also stateless actors, that is, they will not have their - // in-memory state persisted via Statesstore. This is done to avoid problems - // with the correctness of the stored state. - // Pooled Actors are generally used for tasks where the Actor Model would perform worse - // than other concurrency models and for tasks that do not require state concerns. - // Integration flows, data caching, proxies are good examples of use cases - // for this type of Actor. - POOLED = 3; - - // Reserved for future use - PROXY = 4; -} - -message ActorSettings { - - // Indicates the type of Actor to be configured. - Kind kind = 1; - - // Indicates whether an actor's state should be persisted in a definitive store. - bool stateful = 2; - - // Snapshot strategy - ActorSnapshotStrategy snapshot_strategy = 3; - - // Deactivate strategy - ActorDeactivationStrategy deactivation_strategy = 4; - - // When kind is POOLED this is used to define minimun actor instances - int32 min_pool_size = 5; - - // When kind is POOLED this is used to define maximum actor instances - int32 max_pool_size = 6; -} - -message ActorId { - // The name of a Actor Entity. - string name = 1; - - // Name of a ActorSystem - string system = 2; - - // When the Actor is of the Unnamed type, - // the name of the parent Actor must be informed here. - string parent = 3; -} - -message Actor { - // Actor Identification - ActorId id = 1; - - // A Actor state. - ActorState state = 2; - - // Actor metadata - Metadata metadata = 6; - - // Actor settings. - ActorSettings settings = 3; - - // The actions registered for an actor - repeated Action actions = 4; - - // The registered timer actions for an actor. - repeated FixedTimerAction timer_actions = 5; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/protocol.proto b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/protocol.proto deleted file mode 100644 index 90794567..00000000 --- a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/protocol.proto +++ /dev/null @@ -1,452 +0,0 @@ -// The Spawn Protocol -// -// Spawn is divided into two main parts namely: -// -// 1. A sidecar proxy that exposes the server part of the Spawn Protocol in the form of an HTTP API. -// 2. A user function, written in any language that supports HTTP, that exposes the client part of the Spawn Protocol. -// -// Both are client and server of their counterparts. -// -// In turn, the proxy exposes an HTTP endpoint for registering a user function a.k.a ActorSystem. -// -// A user function that wants to register actors in Proxy Spawn must proceed by making a POST request to the following endpoint: -// -// ` -// POST /api/v1/system HTTP 1.1 -// HOST: localhost -// User-Agent: user-function-client/0.1.0 (this is just example) -// Accept: application/octet-stream -// Content-Type: application/octet-stream -// -// registration request type bytes encoded here :-) -// ` -// -// The general flow of a registration action is as follows: -// -//╔═══════════════════╗ ╔═══════════════════╗ ╔═══════════════════╗ -//║ User Function ║ ║Local Spawn Sidecar║ ║ Actor ║ -//╚═══════════════════╝ ╚═══════════════════╝ ╚═══════════════════╝ -// ║ ║ ║ -// ║ ║ ║ -// ║ HTTP POST ║ ║ -// ║ Registration ║ ║ -// ║ Request ║ ║ -// ╠─────────────────────────────────────▶║ ║ -// ║ ║ Upfront start Actors with ║ -// ║ ╠───────BEAM Distributed Protocol─────▶║ -// ║ ║ ║ -// ║ ║ ╠───┐Initialize -// ║ ║ ║ │ State -// ║ ║ ║ │ Store -// ║ ║ ║◀──┘ -// ║ HTTP Registration ║ ║ -// ║ Response ║ ║ -// ║◀─────────────────────────────────────╣ ║ -// ║ ║ ║ -// ║ ║ ║ -// ║ ║ ║ -// ║ ║ ║ -// ║ ║ ║ -// ║ ║ ║ -// ║ ║ ║ -// ║ ║ ║ -// -// ███████████ ███████████ ███████████ -// -// -// ## Spawning Actors -// -// Actors are usually created at the beginning of the SDK's communication flow with the Proxy by the registration step described above. -// However, some use cases require that Actors can be created ***on the fly***. -// In other words, Spawn is used to bring to life Actors previously registered as Unnameds, giving them a name and thus creating a concrete instance -// at runtime for that Actor. Actors created with the Spawn feature are generally used when you want to share a behavior while maintaining -// the isolation characteristics of the actors. -// For these situations we have the Spawning flow described below. -// -// A user function that wants to Spawning new Actors in Proxy Spawn must proceed by making a POST request to the following endpoint: -// -// ``` -// POST /system/:system_name/actors/spawn HTTP 1.1 -// HOST: localhost -// User-Agent: user-function-client/0.1.0 (this is just example) -// Accept: application/octet-stream -// Content-Type: application/octet-stream -// -// SpawnRequest type bytes encoded here :-) -// ``` -// -// The general flow of a Spawning Actors is as follows: -// -// ``` -// +----------------+ +---------------------+ +-------+ -// | User Function | | Local Spawn Sidecar | | Actor | -// +----------------+ +---------------------+ +-------+ -// | | | -// | HTTP POST SpawnRequest | | -// |------------------------------------------------------>| | -// | | | -// | | Upfront start Actors with BEAM Distributed Protocol | -// | |---------------------------------------------------->| -// | | | -// | | |Initialize Statestore -// | | |---------------------- -// | | | | -// | | |<--------------------- -// | | | -// | HTTP SpawnResponse | | -// |<------------------------------------------------------| | -// | | | -// ``` -// -// Once the system has been initialized, that is, the registration step has been successfully completed, -// then the user function will be able to make requests to the System Actors. -// This is done through a post request to the Proxy at the `/system/:name/actors/:actor_name/invoke` endpoint. -// -// A user function that wants to call actors in Proxy Spawn must proceed by making a POST request as the follow: -// -// ` -// POST /system/:name/actors/:actor_name/invoke HTTP 1.1 -// HOST: localhost -// User-Agent: user-function-client/0.1.0 (this is just example) -// Accept: application/octet-stream -// Content-Type: application/octet-stream -// -// invocation request type bytes encoded here :-) -// ` -// -// Assuming that two user functions were registered in different separate Proxies, the above request would go the following way: -// -//╔═══════════════════╗ ╔═══════════════════╗ ╔═════════════════════════╗ ╔═════════════════════════════╗ -//║ User Function ║ ║Local Spawn Sidecar║ ║ Remote User Function B ║ ║Remote Spawn Sidecar/Actor B ║ -//╚═══════════════════╝ ╚═══════════════════╝ ╚═════════════════════════╝ ╚═════════════════════════════╝ -// ║ HTTP POST ║ ║ ║ -// ║ Registration ║ ║ ║ -// ║ Request ║ ║ ║ -// ╠─────────────────────────────────────▶║ ║ ║ -// ║ ╠───┐ ║ ║ -// ║ ║ │Lookup for ║ ║ -// ║ ║ │ Actor ║ ║ -// ║ ║◀──┘ ║ ║ -// ║ ║ ║ BEAM Distributed ║ -// ║ ╠─────────────────────────────────────╬────────────protocol call──────────▶║ -// ║ ║ ║ ║ -// ║ ║ ║ HTTP POST: ║ -// ║ ║ ║◀──────/api/v1/actors/actions───────╣ -// ║ ║ ║ ║ -// ║ ║ ╠───┐ ║ -// ║ ║ ║ │Handle request, ║ -// ║ ║ ║ │execute action ║ -// ║ ║ ║◀──┘ ║ -// ║ ║ ║ Reply with the ║ -// ║ ║ ╠────────────result and the ────────▶║ -// ║ ║ ║ new state of ║────┐ -// ║ ║ ║ ║ │ -// ║ ║ ║ ║ │Store new State -// ║ ║ Send response to the ║ ║ ◀──┘ -// ║ Respond to user with ║◀─────────Spawn Sidecar A────────────╬────────────────────────────────────╣ -// ║ result value ║ ║ ║ -// ║◀─────────────────────────────────────╣ ║ ║ -// ║ ║ ║ ║ -// ║ ║ ║ ║ -// -// ███████████ ████████████ ███████████ ███████████ -// -// -syntax = "proto3"; - -package eigr.functions.protocol; - -import "eigr/functions/protocol/actors/actor.proto"; -import "google/protobuf/any.proto"; - -option java_package = "io.eigr.functions.protocol"; -option go_package = "github.com/eigr/go-support/eigr/protocol;protocol"; - -// Context is where current and/or updated state is stored -// to be transmitted to/from proxy and user function -// -// Params: -// * state: Actor state passed back and forth between proxy and user function. -// * metadata: Meta information that comes in invocations -// * tags: Meta information stored in the actor -// * caller: ActorId of who is calling target actor -// * self: ActorId of itself -message Context { - - google.protobuf.Any state = 1; - - map metadata = 4; - - map tags = 5; - - // Who is calling target actor - eigr.functions.protocol.actors.ActorId caller = 2; - - // The target actor itself - eigr.functions.protocol.actors.ActorId self = 3; -} - -// Noop is used when the input or output value of a function or method -// does not matter to the caller of a Workflow or when the user just wants to receive -// the Context in the request, that is, -// he does not care about the input value only with the state. -message Noop {} - -// JSON is an alternative that some SDKs can opt in -// it will bypass any type validation in spawn actors state / payloads -message JSONType { - string content = 1; -} - -message RegistrationRequest { - - ServiceInfo service_info = 1; - - eigr.functions.protocol.actors.ActorSystem actor_system = 2; -} - -message RegistrationResponse { - - RequestStatus status = 1; - - ProxyInfo proxy_info = 2; -} - -message ServiceInfo { - - // The name of the actor system, eg, "my-actor-system". - string service_name = 1; - - // The version of the service. - string service_version = 2; - - // A description of the runtime for the service. Can be anything, but examples might be: - // - node v10.15.2 - // - OpenJDK Runtime Environment 1.8.0_192-b12 - string service_runtime = 3; - - // If using a support library, the name of that library, eg "spawn-jvm" - string support_library_name = 4; - - // The version of the support library being used. - string support_library_version = 5; - - // Spawn protocol major version accepted by the support library. - int32 protocol_major_version = 6; - - // Spawn protocol minor version accepted by the support library. - int32 protocol_minor_version = 7; -} - -message SpawnRequest { - repeated eigr.functions.protocol.actors.ActorId actors = 1; -} - -message SpawnResponse { - RequestStatus status = 1; -} - -message ProxyInfo { - - int32 protocol_major_version = 1; - - int32 protocol_minor_version = 2; - - string proxy_name = 3; - - string proxy_version = 4; -} - -// When a Host Function is invoked it returns the updated state and return value to the call. -// It can also return a number of side effects to other Actors as a result of its computation. -// These side effects will be forwarded to the respective Actors asynchronously and should not affect the Host Function's response to its caller. -// Internally side effects is just a special kind of InvocationRequest. -// Useful for handle handle `recipient list` and `Composed Message Processor` patterns: -// https://www.enterpriseintegrationpatterns.com/patterns/messaging/RecipientList.html -// https://www.enterpriseintegrationpatterns.com/patterns/messaging/DistributionAggregate.html -message SideEffect { - InvocationRequest request = 1; -} - -// Broadcast a message to many Actors -// Useful for handle `recipient list`, `publish-subscribe channel`, and `scatter-gatther` patterns: -// https://www.enterpriseintegrationpatterns.com/patterns/messaging/RecipientList.html -// https://www.enterpriseintegrationpatterns.com/patterns/messaging/PublishSubscribeChannel.html -// https://www.enterpriseintegrationpatterns.com/patterns/messaging/BroadcastAggregate.html -message Broadcast { - // Target topic or channel - string channel_group = 1; - - // Payload - oneof payload { - google.protobuf.Any value = 3; - Noop noop = 4; - } -} - -// Sends the output of a action of an Actor to the input of another action of an Actor -// Useful for handle `pipes` pattern: -// https://www.enterpriseintegrationpatterns.com/patterns/messaging/PipesAndFilters.html -message Pipe { - // Target Actor - string actor = 1; - - // Action. - string action_name = 2; -} - -// Sends the input of a action of an Actor to the input of another action of an Actor -// Useful for handle `content-basead router` pattern -// https://www.enterpriseintegrationpatterns.com/patterns/messaging/ContentBasedRouter.html -message Forward { - // Target Actor - string actor = 1; - - // Action. - string action_name = 2; -} - -// Container for archicetural message patterns -message Workflow { - - Broadcast broadcast = 2; - - repeated SideEffect effects = 1; - - oneof routing { - Pipe pipe = 3; - Forward forward = 4; - } -} - -// The user function when it wants to send a message to an Actor uses the InvocationRequest message type. -// -// Params: -// * system: See ActorSystem message. -// * actor: The target Actor, i.e. the one that the user function is calling to perform some computation. -// * caller: The caller Actor -// * action_name: The function or method on the target Actor that will receive this request -// and perform some useful computation with the sent data. -// * value: This is the value sent by the user function to be computed by the request's target Actor action. -// * async: Indicates whether the action should be processed synchronously, where a response should be sent back to the user function, -// or whether the action should be processed asynchronously, i.e. no response sent to the caller and no waiting. -// * metadata: Meta information or headers -// * register_ref: If the invocation should register the specific actor with the given name without having to call register before -message InvocationRequest { - - eigr.functions.protocol.actors.ActorSystem system = 1; - - eigr.functions.protocol.actors.Actor actor = 2; - - string action_name = 3; - - oneof payload { - google.protobuf.Any value = 4; - Noop noop = 7; - } - - bool async = 5; - - eigr.functions.protocol.actors.ActorId caller = 6; - - map metadata = 8; - - int64 scheduled_to = 9; - - bool pooled = 10; - - string register_ref = 11; -} - -// ActorInvocation is a translation message between a local invocation made via InvocationRequest -// and the real Actor that intends to respond to this invocation and that can be located anywhere in the cluster. -// -// Params: -// * actor: The ActorId handling the InvocationRequest request, also called the target Actor. -// * action_name: The function or method on the target Actor that will receive this request -// and perform some useful computation with the sent data. -// * current_context: The current Context with current state value of the target Actor. -// That is, the same as found via matching in %Actor{name: target_actor, state: %ActorState{state: value} = actor_state}. -// In this case, the Context type will contain in the value attribute the same `value` as the matching above. -// * payload: The value to be passed to the function or method corresponding to action_name. -message ActorInvocation { - - eigr.functions.protocol.actors.ActorId actor = 1; - - string action_name = 2; - - Context current_context = 3; - - oneof payload { - google.protobuf.Any value = 4; - Noop noop = 5; - } - - eigr.functions.protocol.actors.ActorId caller = 6; -} - -// The user function's response after executing the action originated by the local proxy request via ActorInvocation. -// -// Params: -// actor_name: The name of the Actor handling the InvocationRequest request, also called the target Actor. -// actor_system: The name of ActorSystem registered in Registration step. -// updated_context: The Context with updated state value of the target Actor after user function has processed a request. -// value: The value that the original request proxy will forward in response to the InvocationRequest type request. -// This is the final response from the point of view of the user who invoked the Actor call and its subsequent processing. -message ActorInvocationResponse { - - string actor_name = 1; - - string actor_system = 2; - - Context updated_context = 3; - - oneof payload { - google.protobuf.Any value = 4; - Noop noop = 6; - } - - Workflow workflow = 5; - - bool checkpoint = 7; -} - -// InvocationResponse is the response that the proxy that received the InvocationRequest request will forward to the request's original user function. -// -// Params: -// status: Status of request. Could be one of [UNKNOWN, OK, ACTOR_NOT_FOUND, ERROR]. -// system: The original ActorSystem of the InvocationRequest request. -// actor: The target Actor originally sent in the InvocationRequest message. -// value: The value resulting from the request processing that the target Actor made. -// This value must be passed by the user function to the one who requested the initial request in InvocationRequest. -message InvocationResponse { - - RequestStatus status = 1; - - eigr.functions.protocol.actors.ActorSystem system = 2; - - eigr.functions.protocol.actors.Actor actor = 3; - - oneof payload { - google.protobuf.Any value = 4; - Noop noop = 5; - } -} - -enum Status { - - UNKNOWN = 0; - - OK = 1; - - ACTOR_NOT_FOUND = 2; - - ERROR = 3; -} - -message RequestStatus { - - Status status = 1; - - string message = 2; -} diff --git a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/state.proto b/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/state.proto deleted file mode 100644 index ddfbe43a..00000000 --- a/spawn_proxy/proxy/priv/protos/eigr/functions/protocol/actors/state.proto +++ /dev/null @@ -1,28 +0,0 @@ -// The Spawn State Extension Protocol -// -// -syntax = "proto3"; - -package eigr.functions.protocol.state; - -import "eigr/functions/protocol/actors/actor.proto"; - -option java_package = "io.eigr.functions.protocol.state"; -option go_package = "github.com/eigr/go-support/eigr/protocol/state;state"; - -// A revision is just a version number for a record in the snapshot table that stores the actors' state. -// When an actor has its snaphost timeout, it increments its internal revision number and saves it along with its internal data. -// Some of the persistence adapters can use this revision number to find the state of an Actor at a given point in time. -// As Actors in Spawn persist their internal data as snapshots from time to time a revision number may not indicate the state of a given change -// but will most likely point to the exact time that a given actor's internal state was persisted into the database. -message Revision { - int64 value = 1; -} - -// A checkpoint encapsulates a revision and the state it represents. -message Checkpoint { - - Revision revision = 1; - - eigr.functions.protocol.actors.ActorState state = 2; -} diff --git a/spawn_proxy/proxy/priv/protos/google/api/annotations.proto b/spawn_proxy/proxy/priv/protos/google/api/annotations.proto deleted file mode 100644 index efdab3db..00000000 --- a/spawn_proxy/proxy/priv/protos/google/api/annotations.proto +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationsProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -extend google.protobuf.MethodOptions { - // See `HttpRule`. - HttpRule http = 72295728; -} diff --git a/spawn_proxy/proxy/priv/protos/google/api/http.proto b/spawn_proxy/proxy/priv/protos/google/api/http.proto deleted file mode 100644 index 113fa936..00000000 --- a/spawn_proxy/proxy/priv/protos/google/api/http.proto +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright 2015 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "HttpProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -message Http { - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - repeated HttpRule rules = 1; - - // When set to true, URL path parameters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - bool fully_decode_reserved_expansion = 2; -} - -// # gRPC Transcoding -// -// gRPC Transcoding is a feature for mapping between a gRPC method and one or -// more HTTP REST endpoints. It allows developers to build a single API service -// that supports both gRPC APIs and REST APIs. Many systems, including [Google -// APIs](https://github.com/googleapis/googleapis), -// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC -// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), -// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature -// and use it for large scale production services. -// -// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies -// how different portions of the gRPC request message are mapped to the URL -// path, URL query parameters, and HTTP request body. It also controls how the -// gRPC response message is mapped to the HTTP response body. `HttpRule` is -// typically specified as an `google.api.http` annotation on the gRPC method. -// -// Each mapping specifies a URL path template and an HTTP method. The path -// template may refer to one or more fields in the gRPC request message, as long -// as each field is a non-repeated field with a primitive (non-message) type. -// The path template controls how fields of the request message are mapped to -// the URL path. -// -// Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/{name=messages/*}" -// }; -// } -// } -// message GetMessageRequest { -// string name = 1; // Mapped to URL path. -// } -// message Message { -// string text = 1; // The resource content. -// } -// -// This enables an HTTP REST to gRPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` -// -// Any fields in the request message which are not bound by the path template -// automatically become HTTP query parameters if there is no HTTP request body. -// For example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get:"/v1/messages/{message_id}" -// }; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // Mapped to URL path. -// int64 revision = 2; // Mapped to URL query parameter `revision`. -// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. -// } -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -// "foo"))` -// -// Note that fields which are mapped to URL query parameters must have a -// primitive type or a repeated primitive type or a non-repeated message type. -// In the case of a repeated type, the parameter can be repeated in the URL -// as `...?param=A¶m=B`. In the case of a message type, each field of the -// message is mapped to a separate parameter, such as -// `...?foo.a=A&foo.b=B&foo.c=C`. -// -// For HTTP methods that allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice when -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// This enables the following two alternative HTTP JSON to RPC mappings: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -// "123456")` -// -// ## Rules for HTTP mapping -// -// 1. Leaf request fields (recursive expansion nested messages in the request -// message) are classified into three categories: -// - Fields referred by the path template. They are passed via the URL path. -// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP -// request body. -// - All other fields are passed via the URL query parameters, and the -// parameter name is the field path in the request message. A repeated -// field can be represented as multiple query parameters under the same -// name. -// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields -// are passed via URL path and HTTP request body. -// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all -// fields are passed via URL path and URL query parameters. -// -// ### Path template syntax -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single URL path segment. The syntax `**` matches -// zero or more URL path segments, which must be the last part of the URL path -// except the `Verb`. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` -// contains any reserved character, such characters should be percent-encoded -// before the matching. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path on the client -// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The -// server side does the reverse decoding. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{var}`. -// -// If a variable contains multiple path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path on the -// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. -// The server side does the reverse decoding, except "%2F" and "%2f" are left -// unchanged. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{+var}`. -// -// ## Using gRPC API Service Configuration -// -// gRPC API Service Configuration (service config) is a configuration language -// for configuring a gRPC service to become a user-facing product. The -// service config is simply the YAML representation of the `google.api.Service` -// proto message. -// -// As an alternative to annotating your proto file, you can configure gRPC -// transcoding in your service config YAML files. You do this by specifying a -// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same -// effect as the proto annotation. This can be particularly useful if you -// have a proto that is reused in multiple services. Note that any transcoding -// specified in the service config will override any matching transcoding -// configuration in the proto. -// -// Example: -// -// http: -// rules: -// # Selects a gRPC method and applies HttpRule to it. -// - selector: example.v1.Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// ## Special notes -// -// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the -// proto to JSON conversion must follow the [proto3 -// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). -// -// While the single segment variable follows the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String -// Expansion, the multi segment variable **does not** follow RFC 6570 Section -// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding -// for multi segment variables. -// -// The path variables **must not** refer to any repeated or mapped field, -// because client libraries are not capable of handling such variable expansion. -// -// The path variables **must not** capture the leading "/" character. The reason -// is that the most common use case "{var}" does not capture the leading "/" -// character. For consistency, all path variables must share the same behavior. -// -// Repeated message fields must not be mapped to URL query parameters, because -// no client library can support such complicated mapping. -// -// If an API needs to use a JSON array for request or response body, it can map -// the request or response body to a repeated field. However, some gRPC -// Transcoding implementations may not support this feature. -message HttpRule { - // Selects a method to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - string selector = 1; - - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - oneof pattern { - // Maps to HTTP GET. Used for listing and getting information about - // resources. - string get = 2; - - // Maps to HTTP PUT. Used for replacing a resource. - string put = 3; - - // Maps to HTTP POST. Used for creating a resource or performing an action. - string post = 4; - - // Maps to HTTP DELETE. Used for deleting a resource. - string delete = 5; - - // Maps to HTTP PATCH. Used for updating a resource. - string patch = 6; - - // The custom pattern is used for specifying an HTTP method that is not - // included in the `pattern` field, such as HEAD, or "*" to leave the - // HTTP method unspecified for this rule. The wild-card rule is useful - // for services that provide content to Web (HTML) clients. - CustomHttpPattern custom = 8; - } - - // The name of the request field whose value is mapped to the HTTP request - // body, or `*` for mapping all request fields not captured by the path - // pattern to the HTTP body, or omitted for not having any HTTP request body. - // - // NOTE: the referred field must be present at the top-level of the request - // message type. - string body = 7; - - // Optional. The name of the response field whose value is mapped to the HTTP - // response body. When omitted, the entire response message will be used - // as the HTTP response body. - // - // NOTE: The referred field must be present at the top-level of the response - // message type. - string response_body = 12; - - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - repeated HttpRule additional_bindings = 11; -} - -// A custom pattern is used for defining custom HTTP verb. -message CustomHttpPattern { - // The name of this custom HTTP verb. - string kind = 1; - - // The path matched by this custom verb. - string path = 2; -} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/any.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/any.proto deleted file mode 100644 index 016ee66d..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/any.proto +++ /dev/null @@ -1,158 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/anypb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "AnyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// `Any` contains an arbitrary serialized protocol buffer message along with a -// URL that describes the type of the serialized message. -// -// Protobuf library provides support to pack/unpack Any values in the form -// of utility functions or additional generated methods of the Any type. -// -// Example 1: Pack and unpack a message in C++. -// -// Foo foo = ...; -// Any any; -// any.PackFrom(foo); -// ... -// if (any.UnpackTo(&foo)) { -// ... -// } -// -// Example 2: Pack and unpack a message in Java. -// -// Foo foo = ...; -// Any any = Any.pack(foo); -// ... -// if (any.is(Foo.class)) { -// foo = any.unpack(Foo.class); -// } -// -// Example 3: Pack and unpack a message in Python. -// -// foo = Foo(...) -// any = Any() -// any.Pack(foo) -// ... -// if any.Is(Foo.DESCRIPTOR): -// any.Unpack(foo) -// ... -// -// Example 4: Pack and unpack a message in Go -// -// foo := &pb.Foo{...} -// any, err := anypb.New(foo) -// if err != nil { -// ... -// } -// ... -// foo := &pb.Foo{} -// if err := any.UnmarshalTo(foo); err != nil { -// ... -// } -// -// The pack methods provided by protobuf library will by default use -// 'type.googleapis.com/full.type.name' as the type URL and the unpack -// methods only use the fully qualified type name after the last '/' -// in the type URL, for example "foo.bar.com/x/y.z" will yield type -// name "y.z". -// -// -// JSON -// -// The JSON representation of an `Any` value uses the regular -// representation of the deserialized, embedded message, with an -// additional field `@type` which contains the type URL. Example: -// -// package google.profile; -// message Person { -// string first_name = 1; -// string last_name = 2; -// } -// -// { -// "@type": "type.googleapis.com/google.profile.Person", -// "firstName": , -// "lastName": -// } -// -// If the embedded message type is well-known and has a custom JSON -// representation, that representation will be embedded adding a field -// `value` which holds the custom JSON in addition to the `@type` -// field. Example (for message [google.protobuf.Duration][]): -// -// { -// "@type": "type.googleapis.com/google.protobuf.Duration", -// "value": "1.212s" -// } -// -message Any { - // A URL/resource name that uniquely identifies the type of the serialized - // protocol buffer message. This string must contain at least - // one "/" character. The last segment of the URL's path must represent - // the fully qualified name of the type (as in - // `path/google.protobuf.Duration`). The name should be in a canonical form - // (e.g., leading "." is not accepted). - // - // In practice, teams usually precompile into the binary all types that they - // expect it to use in the context of Any. However, for URLs which use the - // scheme `http`, `https`, or no scheme, one can optionally set up a type - // server that maps type URLs to message definitions as follows: - // - // * If no scheme is provided, `https` is assumed. - // * An HTTP GET on the URL must yield a [google.protobuf.Type][] - // value in binary format, or produce an error. - // * Applications are allowed to cache lookup results based on the - // URL, or have them precompiled into a binary to avoid any - // lookup. Therefore, binary compatibility needs to be preserved - // on changes to types. (Use versioned type names to manage - // breaking changes.) - // - // Note: this functionality is not currently available in the official - // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. - // - // Schemes other than `http`, `https` (or the empty scheme) might be - // used with implementation specific semantics. - // - string type_url = 1; - - // Must be a valid serialized protocol buffer of the above specified type. - bytes value = 2; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/api.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/api.proto deleted file mode 100644 index 13d287ca..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/api.proto +++ /dev/null @@ -1,207 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -import "google/protobuf/source_context.proto"; -import "google/protobuf/type.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "ApiProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/apipb"; - -// Api is a light-weight descriptor for an API Interface. -// -// Interfaces are also described as "protocol buffer services" in some contexts, -// such as by the "service" keyword in a .proto file, but they are different -// from API Services, which represent a concrete implementation of an interface -// as opposed to simply a description of methods and bindings. They are also -// sometimes simply referred to as "APIs" in other contexts, such as the name of -// this message itself. See https://cloud.google.com/apis/design/glossary for -// detailed terminology. -message Api { - // The fully qualified name of this interface, including package name - // followed by the interface's simple name. - string name = 1; - - // The methods of this interface, in unspecified order. - repeated Method methods = 2; - - // Any metadata attached to the interface. - repeated Option options = 3; - - // A version string for this interface. If specified, must have the form - // `major-version.minor-version`, as in `1.10`. If the minor version is - // omitted, it defaults to zero. If the entire version field is empty, the - // major version is derived from the package name, as outlined below. If the - // field is not empty, the version in the package name will be verified to be - // consistent with what is provided here. - // - // The versioning schema uses [semantic - // versioning](http://semver.org) where the major version number - // indicates a breaking change and the minor version an additive, - // non-breaking change. Both version numbers are signals to users - // what to expect from different versions, and should be carefully - // chosen based on the product plan. - // - // The major version is also reflected in the package name of the - // interface, which must end in `v`, as in - // `google.feature.v1`. For major versions 0 and 1, the suffix can - // be omitted. Zero major versions must only be used for - // experimental, non-GA interfaces. - // - string version = 4; - - // Source context for the protocol buffer service represented by this - // message. - SourceContext source_context = 5; - - // Included interfaces. See [Mixin][]. - repeated Mixin mixins = 6; - - // The source syntax of the service. - Syntax syntax = 7; -} - -// Method represents a method of an API interface. -message Method { - // The simple name of this method. - string name = 1; - - // A URL of the input message type. - string request_type_url = 2; - - // If true, the request is streamed. - bool request_streaming = 3; - - // The URL of the output message type. - string response_type_url = 4; - - // If true, the response is streamed. - bool response_streaming = 5; - - // Any metadata attached to the method. - repeated Option options = 6; - - // The source syntax of this method. - Syntax syntax = 7; -} - -// Declares an API Interface to be included in this interface. The including -// interface must redeclare all the methods from the included interface, but -// documentation and options are inherited as follows: -// -// - If after comment and whitespace stripping, the documentation -// string of the redeclared method is empty, it will be inherited -// from the original method. -// -// - Each annotation belonging to the service config (http, -// visibility) which is not set in the redeclared method will be -// inherited. -// -// - If an http annotation is inherited, the path pattern will be -// modified as follows. Any version prefix will be replaced by the -// version of the including interface plus the [root][] path if -// specified. -// -// Example of a simple mixin: -// -// package google.acl.v1; -// service AccessControl { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v1/{resource=**}:getAcl"; -// } -// } -// -// package google.storage.v2; -// service Storage { -// rpc GetAcl(GetAclRequest) returns (Acl); -// -// // Get a data record. -// rpc GetData(GetDataRequest) returns (Data) { -// option (google.api.http).get = "/v2/{resource=**}"; -// } -// } -// -// Example of a mixin configuration: -// -// apis: -// - name: google.storage.v2.Storage -// mixins: -// - name: google.acl.v1.AccessControl -// -// The mixin construct implies that all methods in `AccessControl` are -// also declared with same name and request/response types in -// `Storage`. A documentation generator or annotation processor will -// see the effective `Storage.GetAcl` method after inherting -// documentation and annotations as follows: -// -// service Storage { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v2/{resource=**}:getAcl"; -// } -// ... -// } -// -// Note how the version in the path pattern changed from `v1` to `v2`. -// -// If the `root` field in the mixin is specified, it should be a -// relative path under which inherited HTTP paths are placed. Example: -// -// apis: -// - name: google.storage.v2.Storage -// mixins: -// - name: google.acl.v1.AccessControl -// root: acls -// -// This implies the following inherited HTTP annotation: -// -// service Storage { -// // Get the underlying ACL object. -// rpc GetAcl(GetAclRequest) returns (Acl) { -// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; -// } -// ... -// } -message Mixin { - // The fully qualified name of the interface which is included. - string name = 1; - - // If non-empty specifies a path under which inherited HTTP paths - // are rooted. - string root = 2; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/descriptor.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/descriptor.proto deleted file mode 100644 index 6805b9b4..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/descriptor.proto +++ /dev/null @@ -1,1223 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - -syntax = "proto2"; - -package google.protobuf; - -option go_package = "google.golang.org/protobuf/types/descriptorpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; -option csharp_namespace = "Google.Protobuf.Reflection"; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// The full set of known editions. -enum Edition { - // A placeholder for an unknown edition value. - EDITION_UNKNOWN = 0; - - // Legacy syntax "editions". These pre-date editions, but behave much like - // distinct editions. These can't be used to specify the edition of proto - // files, but feature definitions must supply proto2/proto3 defaults for - // backwards compatibility. - EDITION_PROTO2 = 998; - EDITION_PROTO3 = 999; - - // Editions that have been released. The specific values are arbitrary and - // should not be depended on, but they will always be time-ordered for easy - // comparison. - EDITION_2023 = 1000; - EDITION_2024 = 1001; - - // Placeholder editions for testing feature resolution. These should not be - // used or relyed on outside of tests. - EDITION_1_TEST_ONLY = 1; - EDITION_2_TEST_ONLY = 2; - EDITION_99997_TEST_ONLY = 99997; - EDITION_99998_TEST_ONLY = 99998; - EDITION_99999_TEST_ONLY = 99999; - - // Placeholder for specifying unbounded edition support. This should only - // ever be used by plugins that can expect to never require any changes to - // support a new edition. - EDITION_MAX = 0x7FFFFFFF; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; - - // The syntax of the proto file. - // The supported values are "proto2", "proto3", and "editions". - // - // If `edition` is present, this value must be "editions". - optional string syntax = 12; - - // The edition of the proto file. - optional Edition edition = 14; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - - optional ExtensionRangeOptions options = 3; - } - repeated ExtensionRange extension_range = 5; - - repeated OneofDescriptorProto oneof_decl = 8; - - optional MessageOptions options = 7; - - // Range of reserved tag numbers. Reserved tag numbers may not be used by - // fields or extension ranges in the same message. Reserved ranges may - // not overlap. - message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - } - repeated ReservedRange reserved_range = 9; - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - repeated string reserved_name = 10; -} - -message ExtensionRangeOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - message Declaration { - // The extension number declared within the extension range. - optional int32 number = 1; - - // The fully-qualified name of the extension field. There must be a leading - // dot in front of the full name. - optional string full_name = 2; - - // The fully-qualified type name of the extension field. Unlike - // Metadata.type, Declaration.type must have a leading dot for messages - // and enums. - optional string type = 3; - - // If true, indicates that the number is reserved in the extension range, - // and any extension field with the number will fail to compile. Set this - // when a declared extension field is deleted. - optional bool reserved = 5; - - // If true, indicates that the extension must be defined as repeated. - // Otherwise the extension must be defined as optional. - optional bool repeated = 6; - - reserved 4; // removed is_repeated - } - - // For external users: DO NOT USE. We are in the process of open sourcing - // extension declaration and executing internal cleanups before it can be - // used externally. - repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; - - // Any features defined in the specific edition. - optional FeatureSet features = 50; - - // The verification state of the extension range. - enum VerificationState { - // All the extensions of the range must be declared. - DECLARATION = 0; - UNVERIFIED = 1; - } - - // The verification state of the range. - // TODO: flip the default to DECLARATION once all empty ranges - // are marked as UNVERIFIED. - optional VerificationState verification = 3 - [default = UNVERIFIED, retention = RETENTION_SOURCE]; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - // Tag-delimited aggregate. - // Group type is deprecated and not supported after google.protobuf. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. In Editions, the group wire format - // can be enabled via the `message_encoding` feature. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - } - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REPEATED = 3; - // The required label is only allowed in google.protobuf. In proto3 and Editions - // it's explicitly prohibited. In Editions, the `field_presence` feature - // can be used to get this behavior. - LABEL_REQUIRED = 2; - } - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - optional string default_value = 7; - - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - optional int32 oneof_index = 9; - - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - optional string json_name = 10; - - optional FieldOptions options = 8; - - // If true, this is a proto3 "optional". When a proto3 field is optional, it - // tracks presence regardless of field type. - // - // When proto3_optional is true, this field must belong to a oneof to signal - // to old proto3 clients that presence is tracked for this field. This oneof - // is known as a "synthetic" oneof, and this field must be its sole member - // (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs - // exist in the descriptor only, and do not generate any API. Synthetic oneofs - // must be ordered after all "real" oneofs. - // - // For message fields, proto3_optional doesn't create any semantic change, - // since non-repeated message fields always track presence. However it still - // indicates the semantic detail of whether the user wrote "optional" or not. - // This can be useful for round-tripping the .proto file. For consistency we - // give message fields a synthetic oneof also, even though it is not required - // to track presence. This is especially important because the parser can't - // tell if a field is a message or an enum, so it must always create a - // synthetic oneof. - // - // Proto2 optional fields do not set this flag, because they already indicate - // optional with `LABEL_OPTIONAL`. - optional bool proto3_optional = 17; -} - -// Describes a oneof. -message OneofDescriptorProto { - optional string name = 1; - optional OneofOptions options = 2; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; - - // Range of reserved numeric values. Reserved values may not be used by - // entries in the same enum. Reserved ranges may not overlap. - // - // Note that this is distinct from DescriptorProto.ReservedRange in that it - // is inclusive such that it can appropriately represent the entire int32 - // domain. - message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. - } - - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - repeated EnumReservedRange reserved_range = 4; - - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - repeated string reserved_name = 5; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; - - // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default = false]; - // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default = false]; -} - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Objective-C plugin) and your project website (if available) -- there's no -// need to explain how you intend to use them. Usually you only need one -// extension number. You can declare multiple options with only one extension -// number by putting them in a sub-message. See the Custom Options section of -// the docs for examples: -// https://developers.google.com/protocol-buffers/docs/proto#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - // Controls the name of the wrapper Java class generated for the .proto file. - // That class will always contain the .proto file's getDescriptor() method as - // well as any top-level extensions defined in the .proto file. - // If java_multiple_files is disabled, then all the other classes from the - // .proto file will be nested inside the single wrapper outer class. - optional string java_outer_classname = 8; - - // If enabled, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the wrapper class - // named by java_outer_classname. However, the wrapper class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default = false]; - - // This option does nothing. - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - - // A proto2 file can set this to true to opt in to UTF-8 checking for Java, - // which will throw an exception if invalid UTF-8 is parsed from the wire or - // assigned to a string field. - // - // TODO: clarify exactly what kinds of field types this option - // applies to, and update these docs accordingly. - // - // Proto3 files already perform these checks. Setting the option explicitly to - // false has no effect: it cannot be used to opt proto3 files out of UTF-8 - // checks. - optional bool java_string_check_utf8 = 27 [default = false]; - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default = SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - optional string go_package = 11; - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default = false]; - optional bool java_generic_services = 17 [default = false]; - optional bool py_generic_services = 18 [default = false]; - reserved 42; // removed php_generic_services - - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default = false]; - - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default = true]; - - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - optional string objc_class_prefix = 36; - - // Namespace for generated classes; defaults to the package. - optional string csharp_namespace = 37; - - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - optional string swift_prefix = 39; - - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - optional string php_class_prefix = 40; - - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - optional string php_namespace = 41; - - // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be - // used for determining the namespace. - optional string php_metadata_namespace = 44; - - // Use this option to change the package of ruby generated classes. Default - // is empty. When this option is not set, the package name will be used for - // determining the ruby package. - optional string ruby_package = 45; - - // Any features defined in the specific edition. - optional FeatureSet features = 50; - - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. - // See the documentation for the "Options" section above. - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default = false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default = false]; - - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default = false]; - - reserved 4, 5, 6; - - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementations still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - optional bool map_entry = 7; - - reserved 8; // javalite_serializable - reserved 9; // javanano_as_lite - - // Enable the legacy handling of JSON field name conflicts. This lowercases - // and strips underscored from the fields before comparison in proto3 only. - // The new behavior takes `json_name` into account and applies to proto2 as - // well. - // - // This should only be used as a temporary measure against broken builds due - // to the change in behavior for JSON field name conflicts. - // - // TODO This is legacy behavior we plan to remove once downstream - // teams have had time to migrate. - optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; - - // Any features defined in the specific edition. - optional FeatureSet features = 12; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is only implemented to support use of - // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of - // type "bytes" in the open source release -- sorry, we'll try to include - // other types in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - // The option [ctype=CORD] may be applied to a non-repeated field of type - // "bytes". It indicates that in C++, the data should be stored in a Cord - // instead of a string. For very large strings, this may reduce memory - // fragmentation. It may also allow better performance when parsing from a - // Cord, or when parsing with aliasing enabled, as the parsed Cord may then - // alias the original buffer. - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. This option is prohibited in - // Editions, but the `repeated_field_encoding` feature can be used to control - // the behavior. - optional bool packed = 2; - - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - optional JSType jstype = 6 [default = JS_NORMAL]; - enum JSType { - // Use the default type. - JS_NORMAL = 0; - - // Use JavaScript strings. - JS_STRING = 1; - - // Use JavaScript numbers. - JS_NUMBER = 2; - } - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // Note that lazy message fields are still eagerly verified to check - // ill-formed wireformat or missing required fields. Calling IsInitialized() - // on the outer message would fail if the inner message has missing required - // fields. Failed verification would result in parsing failure (except when - // uninitialized messages are acceptable). - optional bool lazy = 5 [default = false]; - - // unverified_lazy does no correctness checks on the byte stream. This should - // only be used where lazy with verification is prohibitive for performance - // reasons. - optional bool unverified_lazy = 15 [default = false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default = false]; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default = false]; - - // Indicate that the field value should not be printed out when using debug - // formats, e.g. when the field contains sensitive credentials. - optional bool debug_redact = 16 [default = false]; - - // If set to RETENTION_SOURCE, the option will be omitted from the binary. - // Note: as of January 2023, support for this is in progress and does not yet - // have an effect (b/264593489). - enum OptionRetention { - RETENTION_UNKNOWN = 0; - RETENTION_RUNTIME = 1; - RETENTION_SOURCE = 2; - } - - optional OptionRetention retention = 17; - - // This indicates the types of entities that the field may apply to when used - // as an option. If it is unset, then the field may be freely used as an - // option on any kind of entity. Note: as of January 2023, support for this is - // in progress and does not yet have an effect (b/264593489). - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0; - TARGET_TYPE_FILE = 1; - TARGET_TYPE_EXTENSION_RANGE = 2; - TARGET_TYPE_MESSAGE = 3; - TARGET_TYPE_FIELD = 4; - TARGET_TYPE_ONEOF = 5; - TARGET_TYPE_ENUM = 6; - TARGET_TYPE_ENUM_ENTRY = 7; - TARGET_TYPE_SERVICE = 8; - TARGET_TYPE_METHOD = 9; - } - - repeated OptionTargetType targets = 19; - - message EditionDefault { - optional Edition edition = 3; - optional string value = 2; // Textproto value. - } - repeated EditionDefault edition_defaults = 20; - - // Any features defined in the specific edition. - optional FeatureSet features = 21; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; - - reserved 4; // removed jtype - reserved 18; // reserve target, target_obsolete_do_not_use -} - -message OneofOptions { - // Any features defined in the specific edition. - optional FeatureSet features = 1; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to true to allow mapping different tag names to the same - // value. - optional bool allow_alias = 2; - - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - optional bool deprecated = 3 [default = false]; - - reserved 5; // javanano_as_lite - - // Enable the legacy handling of JSON field name conflicts. This lowercases - // and strips underscored from the fields before comparison in proto3 only. - // The new behavior takes `json_name` into account and applies to proto2 as - // well. - // TODO Remove this legacy behavior once downstream teams have - // had time to migrate. - optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; - - // Any features defined in the specific edition. - optional FeatureSet features = 7; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default = false]; - - // Any features defined in the specific edition. - optional FeatureSet features = 2; - - // Indicate that fields annotated with this enum value should not be printed - // out when using debug formats, e.g. when the field contains sensitive - // credentials. - optional bool debug_redact = 3 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Any features defined in the specific edition. - optional FeatureSet features = 34; - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - optional bool deprecated = 33 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default = false]; - - // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - // or neither? HTTP based RPC implementation may choose GET verb for safe - // methods, and PUT verb for idempotent methods instead of the default POST. - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects - } - optional IdempotencyLevel idempotency_level = 34 - [default = IDEMPOTENCY_UNKNOWN]; - - // Any features defined in the specific edition. - optional FeatureSet features = 35; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - // "foo.(bar.baz).moo". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Features - -// TODO Enums in C++ gencode (and potentially other languages) are -// not well scoped. This means that each of the feature enums below can clash -// with each other. The short names we've chosen maximize call-site -// readability, but leave us very open to this scenario. A future feature will -// be designed and implemented to handle this, hopefully before we ever hit a -// conflict here. -message FeatureSet { - enum FieldPresence { - FIELD_PRESENCE_UNKNOWN = 0; - EXPLICIT = 1; - IMPLICIT = 2; - LEGACY_REQUIRED = 3; - } - optional FieldPresence field_presence = 1 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" }, - edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, - edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } - ]; - - enum EnumType { - ENUM_TYPE_UNKNOWN = 0; - OPEN = 1; - CLOSED = 2; - } - optional EnumType enum_type = 2 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_ENUM, - targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" }, - edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" } - ]; - - enum RepeatedFieldEncoding { - REPEATED_FIELD_ENCODING_UNKNOWN = 0; - PACKED = 1; - EXPANDED = 2; - } - optional RepeatedFieldEncoding repeated_field_encoding = 3 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" }, - edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" } - ]; - - enum Utf8Validation { - UTF8_VALIDATION_UNKNOWN = 0; - VERIFY = 2; - NONE = 3; - } - optional Utf8Validation utf8_validation = 4 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "NONE" }, - edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" } - ]; - - enum MessageEncoding { - MESSAGE_ENCODING_UNKNOWN = 0; - LENGTH_PREFIXED = 1; - DELIMITED = 2; - } - optional MessageEncoding message_encoding = 5 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_FIELD, - targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" } - ]; - - enum JsonFormat { - JSON_FORMAT_UNKNOWN = 0; - ALLOW = 1; - LEGACY_BEST_EFFORT = 2; - } - optional JsonFormat json_format = 6 [ - retention = RETENTION_RUNTIME, - targets = TARGET_TYPE_MESSAGE, - targets = TARGET_TYPE_ENUM, - targets = TARGET_TYPE_FILE, - edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" }, - edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" } - ]; - - reserved 999; - - extensions 1000; // for Protobuf C++ - extensions 1001; // for Protobuf Java - extensions 1002; // for Protobuf Go - - extensions 9995 to 9999; // For internal testing - extensions 10000; // for https://github.com/bufbuild/protobuf-es -} - -// A compiled specification for the defaults of a set of features. These -// messages are generated from FeatureSet extensions and can be used to seed -// feature resolution. The resolution with this object becomes a simple search -// for the closest matching edition, followed by proto merges. -message FeatureSetDefaults { - // A map from every known edition with a unique set of defaults to its - // defaults. Not all editions may be contained here. For a given edition, - // the defaults at the closest matching edition ordered at or before it should - // be used. This field must be in strict ascending order by edition. - message FeatureSetEditionDefault { - optional Edition edition = 3; - optional FeatureSet features = 2; - } - repeated FeatureSetEditionDefault defaults = 1; - - // The minimum supported edition (inclusive) when this was constructed. - // Editions before this will not have defaults. - optional Edition minimum_edition = 4; - - // The maximum known edition (inclusive) when this was constructed. Editions - // after this will not have reliable defaults. - optional Edition maximum_edition = 5; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendant. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition appears. - // For example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed = true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed = true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to moo. - // // - // // Another line attached to moo. - // optional double moo = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to moo or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -message GeneratedCodeInfo { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - repeated Annotation annotation = 1; - message Annotation { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed = true]; - - // Identifies the filesystem path to the original source .proto. - optional string source_file = 2; - - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - optional int32 begin = 3; - - // Identifies the ending offset in bytes in the generated code that - // relates to the identified object. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - optional int32 end = 4; - - // Represents the identified object's effect on the element in the original - // .proto file. - enum Semantic { - // There is no effect or the effect is indescribable. - NONE = 0; - // The element is set or otherwise mutated. - SET = 1; - // An alias to the element is returned. - ALIAS = 2; - } - optional Semantic semantic = 5; - } -} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/duration.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/duration.proto deleted file mode 100644 index a0d91df0..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/duration.proto +++ /dev/null @@ -1,115 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; -option go_package = "google.golang.org/protobuf/types/known/durationpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DurationProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// A Duration represents a signed, fixed-length span of time represented -// as a count of seconds and fractions of seconds at nanosecond -// resolution. It is independent of any calendar and concepts like "day" -// or "month". It is related to Timestamp in that the difference between -// two Timestamp values is a Duration and it can be added or subtracted -// from a Timestamp. Range is approximately +-10,000 years. -// -// # Examples -// -// Example 1: Compute Duration from two Timestamps in pseudo code. -// -// Timestamp start = ...; -// Timestamp end = ...; -// Duration duration = ...; -// -// duration.seconds = end.seconds - start.seconds; -// duration.nanos = end.nanos - start.nanos; -// -// if (duration.seconds < 0 && duration.nanos > 0) { -// duration.seconds += 1; -// duration.nanos -= 1000000000; -// } else if (duration.seconds > 0 && duration.nanos < 0) { -// duration.seconds -= 1; -// duration.nanos += 1000000000; -// } -// -// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. -// -// Timestamp start = ...; -// Duration duration = ...; -// Timestamp end = ...; -// -// end.seconds = start.seconds + duration.seconds; -// end.nanos = start.nanos + duration.nanos; -// -// if (end.nanos < 0) { -// end.seconds -= 1; -// end.nanos += 1000000000; -// } else if (end.nanos >= 1000000000) { -// end.seconds += 1; -// end.nanos -= 1000000000; -// } -// -// Example 3: Compute Duration from datetime.timedelta in Python. -// -// td = datetime.timedelta(days=3, minutes=10) -// duration = Duration() -// duration.FromTimedelta(td) -// -// # JSON Mapping -// -// In JSON format, the Duration type is encoded as a string rather than an -// object, where the string ends in the suffix "s" (indicating seconds) and -// is preceded by the number of seconds, with nanoseconds expressed as -// fractional seconds. For example, 3 seconds with 0 nanoseconds should be -// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should -// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 -// microsecond should be expressed in JSON format as "3.000001s". -// -message Duration { - // Signed seconds of the span of time. Must be from -315,576,000,000 - // to +315,576,000,000 inclusive. Note: these bounds are computed from: - // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - int64 seconds = 1; - - // Signed fractions of a second at nanosecond resolution of the span - // of time. Durations less than one second are represented with a 0 - // `seconds` field and a positive or negative `nanos` field. For durations - // of one second or more, a non-zero value for the `nanos` field must be - // of the same sign as the `seconds` field. Must be from -999,999,999 - // to +999,999,999 inclusive. - int32 nanos = 2; -} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/empty.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/empty.proto deleted file mode 100644 index 22274621..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/empty.proto +++ /dev/null @@ -1,51 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/emptypb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "EmptyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -message Empty {} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/field_mask.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/field_mask.proto deleted file mode 100644 index fbdda56e..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/field_mask.proto +++ /dev/null @@ -1,245 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "FieldMaskProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; -option cc_enable_arenas = true; - -// `FieldMask` represents a set of symbolic field paths, for example: -// -// paths: "f.a" -// paths: "f.b.d" -// -// Here `f` represents a field in some root message, `a` and `b` -// fields in the message found in `f`, and `d` a field found in the -// message in `f.b`. -// -// Field masks are used to specify a subset of fields that should be -// returned by a get operation or modified by an update operation. -// Field masks also have a custom JSON encoding (see below). -// -// # Field Masks in Projections -// -// When used in the context of a projection, a response message or -// sub-message is filtered by the API to only contain those fields as -// specified in the mask. For example, if the mask in the previous -// example is applied to a response message as follows: -// -// f { -// a : 22 -// b { -// d : 1 -// x : 2 -// } -// y : 13 -// } -// z: 8 -// -// The result will not contain specific values for fields x,y and z -// (their value will be set to the default, and omitted in proto text -// output): -// -// -// f { -// a : 22 -// b { -// d : 1 -// } -// } -// -// A repeated field is not allowed except at the last position of a -// paths string. -// -// If a FieldMask object is not present in a get operation, the -// operation applies to all fields (as if a FieldMask of all fields -// had been specified). -// -// Note that a field mask does not necessarily apply to the -// top-level response message. In case of a REST get operation, the -// field mask applies directly to the response, but in case of a REST -// list operation, the mask instead applies to each individual message -// in the returned resource list. In case of a REST custom method, -// other definitions may be used. Where the mask applies will be -// clearly documented together with its declaration in the API. In -// any case, the effect on the returned resource/resources is required -// behavior for APIs. -// -// # Field Masks in Update Operations -// -// A field mask in update operations specifies which fields of the -// targeted resource are going to be updated. The API is required -// to only change the values of the fields as specified in the mask -// and leave the others untouched. If a resource is passed in to -// describe the updated values, the API ignores the values of all -// fields not covered by the mask. -// -// If a repeated field is specified for an update operation, new values will -// be appended to the existing repeated field in the target resource. Note that -// a repeated field is only allowed in the last position of a `paths` string. -// -// If a sub-message is specified in the last position of the field mask for an -// update operation, then new value will be merged into the existing sub-message -// in the target resource. -// -// For example, given the target message: -// -// f { -// b { -// d: 1 -// x: 2 -// } -// c: [1] -// } -// -// And an update message: -// -// f { -// b { -// d: 10 -// } -// c: [2] -// } -// -// then if the field mask is: -// -// paths: ["f.b", "f.c"] -// -// then the result will be: -// -// f { -// b { -// d: 10 -// x: 2 -// } -// c: [1, 2] -// } -// -// An implementation may provide options to override this default behavior for -// repeated and message fields. -// -// In order to reset a field's value to the default, the field must -// be in the mask and set to the default value in the provided resource. -// Hence, in order to reset all fields of a resource, provide a default -// instance of the resource and set all fields in the mask, or do -// not provide a mask as described below. -// -// If a field mask is not present on update, the operation applies to -// all fields (as if a field mask of all fields has been specified). -// Note that in the presence of schema evolution, this may mean that -// fields the client does not know and has therefore not filled into -// the request will be reset to their default. If this is unwanted -// behavior, a specific service may require a client to always specify -// a field mask, producing an error if not. -// -// As with get operations, the location of the resource which -// describes the updated values in the request message depends on the -// operation kind. In any case, the effect of the field mask is -// required to be honored by the API. -// -// ## Considerations for HTTP REST -// -// The HTTP kind of an update operation which uses a field mask must -// be set to PATCH instead of PUT in order to satisfy HTTP semantics -// (PUT must only be used for full updates). -// -// # JSON Encoding of Field Masks -// -// In JSON, a field mask is encoded as a single string where paths are -// separated by a comma. Fields name in each path are converted -// to/from lower-camel naming conventions. -// -// As an example, consider the following message declarations: -// -// message Profile { -// User user = 1; -// Photo photo = 2; -// } -// message User { -// string display_name = 1; -// string address = 2; -// } -// -// In proto a field mask for `Profile` may look as such: -// -// mask { -// paths: "user.display_name" -// paths: "photo" -// } -// -// In JSON, the same mask is represented as below: -// -// { -// mask: "user.displayName,photo" -// } -// -// # Field Masks and Oneof Fields -// -// Field masks treat fields in oneofs just as regular fields. Consider the -// following message: -// -// message SampleMessage { -// oneof test_oneof { -// string name = 4; -// SubMessage sub_message = 9; -// } -// } -// -// The field mask can be: -// -// mask { -// paths: "name" -// } -// -// Or: -// -// mask { -// paths: "sub_message" -// } -// -// Note that oneof type names ("test_oneof" in this case) cannot be used in -// paths. -// -// ## Field Mask Verification -// -// The implementation of any API method which has a FieldMask type field in the -// request should verify the included field paths, and return an -// `INVALID_ARGUMENT` error if any path is unmappable. -message FieldMask { - // The set of field mask paths. - repeated string paths = 1; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/source_context.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/source_context.proto deleted file mode 100644 index fe5415a4..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/source_context.proto +++ /dev/null @@ -1,48 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "SourceContextProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; - -// `SourceContext` represents information about the source of a -// protobuf element, like the file in which it is defined. -message SourceContext { - // The path-qualified name of the .proto file that contained the associated - // protobuf element. For example: `"google/protobuf/source_context.proto"`. - string file_name = 1; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/struct.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/struct.proto deleted file mode 100644 index e07e3435..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/struct.proto +++ /dev/null @@ -1,95 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/protobuf/types/known/structpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "StructProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; - -// `Struct` represents a structured data value, consisting of fields -// which map to dynamically typed values. In some languages, `Struct` -// might be supported by a native representation. For example, in -// scripting languages like JS a struct is represented as an -// object. The details of that representation are described together -// with the proto support for the language. -// -// The JSON representation for `Struct` is JSON object. -message Struct { - // Unordered map of dynamically typed values. - map fields = 1; -} - -// `Value` represents a dynamically typed value which can be either -// null, a number, a string, a boolean, a recursive struct value, or a -// list of values. A producer of value is expected to set one of these -// variants. Absence of any variant indicates an error. -// -// The JSON representation for `Value` is JSON value. -message Value { - // The kind of value. - oneof kind { - // Represents a null value. - NullValue null_value = 1; - // Represents a double value. - double number_value = 2; - // Represents a string value. - string string_value = 3; - // Represents a boolean value. - bool bool_value = 4; - // Represents a structured value. - Struct struct_value = 5; - // Represents a repeated `Value`. - ListValue list_value = 6; - } -} - -// `NullValue` is a singleton enumeration to represent the null value for the -// `Value` type union. -// -// The JSON representation for `NullValue` is JSON `null`. -enum NullValue { - // Null value. - NULL_VALUE = 0; -} - -// `ListValue` is a wrapper around a repeated field of values. -// -// The JSON representation for `ListValue` is JSON array. -message ListValue { - // Repeated field of dynamically typed values. - repeated Value values = 1; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/timestamp.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/timestamp.proto deleted file mode 100644 index 184a18f8..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/timestamp.proto +++ /dev/null @@ -1,144 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; -option go_package = "google.golang.org/protobuf/types/known/timestamppb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "TimestampProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// A Timestamp represents a point in time independent of any time zone or local -// calendar, encoded as a count of seconds and fractions of seconds at -// nanosecond resolution. The count is relative to an epoch at UTC midnight on -// January 1, 1970, in the proleptic Gregorian calendar which extends the -// Gregorian calendar backwards to year one. -// -// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap -// second table is needed for interpretation, using a [24-hour linear -// smear](https://developers.google.com/time/smear). -// -// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By -// restricting to that range, we ensure that we can convert to and from [RFC -// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. -// -// # Examples -// -// Example 1: Compute Timestamp from POSIX `time()`. -// -// Timestamp timestamp; -// timestamp.set_seconds(time(NULL)); -// timestamp.set_nanos(0); -// -// Example 2: Compute Timestamp from POSIX `gettimeofday()`. -// -// struct timeval tv; -// gettimeofday(&tv, NULL); -// -// Timestamp timestamp; -// timestamp.set_seconds(tv.tv_sec); -// timestamp.set_nanos(tv.tv_usec * 1000); -// -// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. -// -// FILETIME ft; -// GetSystemTimeAsFileTime(&ft); -// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; -// -// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z -// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. -// Timestamp timestamp; -// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); -// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); -// -// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. -// -// long millis = System.currentTimeMillis(); -// -// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) -// .setNanos((int) ((millis % 1000) * 1000000)).build(); -// -// Example 5: Compute Timestamp from Java `Instant.now()`. -// -// Instant now = Instant.now(); -// -// Timestamp timestamp = -// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) -// .setNanos(now.getNano()).build(); -// -// Example 6: Compute Timestamp from current time in Python. -// -// timestamp = Timestamp() -// timestamp.GetCurrentTime() -// -// # JSON Mapping -// -// In JSON format, the Timestamp type is encoded as a string in the -// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the -// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" -// where {year} is always expressed using four digits while {month}, {day}, -// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional -// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), -// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone -// is required. A proto3 JSON serializer should always use UTC (as indicated by -// "Z") when printing the Timestamp type and a proto3 JSON parser should be -// able to accept both UTC and other timezones (as indicated by an offset). -// -// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past -// 01:30 UTC on January 15, 2017. -// -// In JavaScript, one can convert a Date object to this format using the -// standard -// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) -// method. In Python, a standard `datetime.datetime` object can be converted -// to this format using -// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with -// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use -// the Joda Time's [`ISODateTimeFormat.dateTime()`]( -// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D -// ) to obtain a formatter capable of generating timestamps in this format. -// -message Timestamp { - // Represents seconds of UTC time since Unix epoch - // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to - // 9999-12-31T23:59:59Z inclusive. - int64 seconds = 1; - - // Non-negative fractions of a second at nanosecond resolution. Negative - // second values with fractions must still have non-negative nanos values - // that count forward in time. Must be from 0 to 999,999,999 - // inclusive. - int32 nanos = 2; -} diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/type.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/type.proto deleted file mode 100644 index ae720d48..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/type.proto +++ /dev/null @@ -1,193 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -import "google/protobuf/any.proto"; -import "google/protobuf/source_context.proto"; - -option cc_enable_arenas = true; -option java_package = "com.google.protobuf"; -option java_outer_classname = "TypeProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "google.golang.org/protobuf/types/known/typepb"; - -// A protocol buffer message type. -message Type { - // The fully qualified message name. - string name = 1; - // The list of fields. - repeated Field fields = 2; - // The list of types appearing in `oneof` definitions in this type. - repeated string oneofs = 3; - // The protocol buffer options. - repeated Option options = 4; - // The source context. - SourceContext source_context = 5; - // The source syntax. - Syntax syntax = 6; - // The source edition string, only valid when syntax is SYNTAX_EDITIONS. - string edition = 7; -} - -// A single field of a message type. -message Field { - // Basic field types. - enum Kind { - // Field type unknown. - TYPE_UNKNOWN = 0; - // Field type double. - TYPE_DOUBLE = 1; - // Field type float. - TYPE_FLOAT = 2; - // Field type int64. - TYPE_INT64 = 3; - // Field type uint64. - TYPE_UINT64 = 4; - // Field type int32. - TYPE_INT32 = 5; - // Field type fixed64. - TYPE_FIXED64 = 6; - // Field type fixed32. - TYPE_FIXED32 = 7; - // Field type bool. - TYPE_BOOL = 8; - // Field type string. - TYPE_STRING = 9; - // Field type group. Proto2 syntax only, and deprecated. - TYPE_GROUP = 10; - // Field type message. - TYPE_MESSAGE = 11; - // Field type bytes. - TYPE_BYTES = 12; - // Field type uint32. - TYPE_UINT32 = 13; - // Field type enum. - TYPE_ENUM = 14; - // Field type sfixed32. - TYPE_SFIXED32 = 15; - // Field type sfixed64. - TYPE_SFIXED64 = 16; - // Field type sint32. - TYPE_SINT32 = 17; - // Field type sint64. - TYPE_SINT64 = 18; - } - - // Whether a field is optional, required, or repeated. - enum Cardinality { - // For fields with unknown cardinality. - CARDINALITY_UNKNOWN = 0; - // For optional fields. - CARDINALITY_OPTIONAL = 1; - // For required fields. Proto2 syntax only. - CARDINALITY_REQUIRED = 2; - // For repeated fields. - CARDINALITY_REPEATED = 3; - } - - // The field type. - Kind kind = 1; - // The field cardinality. - Cardinality cardinality = 2; - // The field number. - int32 number = 3; - // The field name. - string name = 4; - // The field type URL, without the scheme, for message or enumeration - // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. - string type_url = 6; - // The index of the field type in `Type.oneofs`, for message or enumeration - // types. The first type has index 1; zero means the type is not in the list. - int32 oneof_index = 7; - // Whether to use alternative packed wire representation. - bool packed = 8; - // The protocol buffer options. - repeated Option options = 9; - // The field JSON name. - string json_name = 10; - // The string value of the default value of this field. Proto2 syntax only. - string default_value = 11; -} - -// Enum type definition. -message Enum { - // Enum type name. - string name = 1; - // Enum value definitions. - repeated EnumValue enumvalue = 2; - // Protocol buffer options. - repeated Option options = 3; - // The source context. - SourceContext source_context = 4; - // The source syntax. - Syntax syntax = 5; - // The source edition string, only valid when syntax is SYNTAX_EDITIONS. - string edition = 6; -} - -// Enum value definition. -message EnumValue { - // Enum value name. - string name = 1; - // Enum value number. - int32 number = 2; - // Protocol buffer options. - repeated Option options = 3; -} - -// A protocol buffer option, which can be attached to a message, field, -// enumeration, etc. -message Option { - // The option's name. For protobuf built-in options (options defined in - // descriptor.proto), this is the short name. For example, `"map_entry"`. - // For custom options, it should be the fully-qualified name. For example, - // `"google.api.http"`. - string name = 1; - // The option's value packed in an Any message. If the value is a primitive, - // the corresponding wrapper type defined in google/protobuf/wrappers.proto - // should be used. If the value is an enum, it should be stored as an int32 - // value using the google.protobuf.Int32Value type. - Any value = 2; -} - -// The syntax in which a protocol buffer element is defined. -enum Syntax { - // Syntax `proto2`. - SYNTAX_PROTO2 = 0; - // Syntax `proto3`. - SYNTAX_PROTO3 = 1; - // Syntax `editions`. - SYNTAX_EDITIONS = 2; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/google/protobuf/wrappers.proto b/spawn_proxy/proxy/priv/protos/google/protobuf/wrappers.proto deleted file mode 100644 index 6c4b5ac6..00000000 --- a/spawn_proxy/proxy/priv/protos/google/protobuf/wrappers.proto +++ /dev/null @@ -1,123 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Wrappers for primitive (non-message) types. These types are useful -// for embedding primitives in the `google.protobuf.Any` type and for places -// where we need to distinguish between the absence of a primitive -// typed field and its default value. -// -// These wrappers have no meaningful use within repeated fields as they lack -// the ability to detect presence on individual elements. -// These wrappers have no meaningful use within a map or a oneof since -// individual entries of a map or fields of a oneof can already detect presence. - -syntax = "proto3"; - -package google.protobuf; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "WrappersProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; - -// Wrapper message for `double`. -// -// The JSON representation for `DoubleValue` is JSON number. -message DoubleValue { - // The double value. - double value = 1; -} - -// Wrapper message for `float`. -// -// The JSON representation for `FloatValue` is JSON number. -message FloatValue { - // The float value. - float value = 1; -} - -// Wrapper message for `int64`. -// -// The JSON representation for `Int64Value` is JSON string. -message Int64Value { - // The int64 value. - int64 value = 1; -} - -// Wrapper message for `uint64`. -// -// The JSON representation for `UInt64Value` is JSON string. -message UInt64Value { - // The uint64 value. - uint64 value = 1; -} - -// Wrapper message for `int32`. -// -// The JSON representation for `Int32Value` is JSON number. -message Int32Value { - // The int32 value. - int32 value = 1; -} - -// Wrapper message for `uint32`. -// -// The JSON representation for `UInt32Value` is JSON number. -message UInt32Value { - // The uint32 value. - uint32 value = 1; -} - -// Wrapper message for `bool`. -// -// The JSON representation for `BoolValue` is JSON `true` and `false`. -message BoolValue { - // The bool value. - bool value = 1; -} - -// Wrapper message for `string`. -// -// The JSON representation for `StringValue` is JSON string. -message StringValue { - // The string value. - string value = 1; -} - -// Wrapper message for `bytes`. -// -// The JSON representation for `BytesValue` is JSON string. -message BytesValue { - // The bytes value. - bytes value = 1; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/grpc/reflection/v1alpha/reflection.proto b/spawn_proxy/proxy/priv/protos/grpc/reflection/v1alpha/reflection.proto deleted file mode 100644 index 462e85a2..00000000 --- a/spawn_proxy/proxy/priv/protos/grpc/reflection/v1alpha/reflection.proto +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright 2016 gRPC authors. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// Service exported by server reflection - -syntax = "proto3"; - -package grpc.reflection.v1alpha; - -service ServerReflection { - // The reflection service is structured as a bidirectional stream, ensuring - // all related requests go to a single server. - rpc ServerReflectionInfo(stream ServerReflectionRequest) - returns (stream ServerReflectionResponse); -} - -// The message sent by the client when calling ServerReflectionInfo method. -message ServerReflectionRequest { - string host = 1; - // To use reflection service, the client should set one of the following - // fields in message_request. The server distinguishes requests by their - // defined field and then handles them using corresponding methods. - oneof message_request { - // Find a proto file by the file name. - string file_by_filename = 3; - - // Find the proto file that declares the given fully-qualified symbol name. - // This field should be a fully-qualified symbol name - // (e.g. .[.] or .). - string file_containing_symbol = 4; - - // Find the proto file which defines an extension extending the given - // message type with the given field number. - ExtensionRequest file_containing_extension = 5; - - // Finds the tag numbers used by all known extensions of the given message - // type, and appends them to ExtensionNumberResponse in an undefined order. - // Its corresponding method is best-effort: it's not guaranteed that the - // reflection service will implement this method, and it's not guaranteed - // that this method will provide all extensions. Returns - // StatusCode::UNIMPLEMENTED if it's not implemented. - // This field should be a fully-qualified type name. The format is - // . - string all_extension_numbers_of_type = 6; - - // List the full names of registered services. The content will not be - // checked. - string list_services = 7; - } -} - -// The type name and extension number sent by the client when requesting -// file_containing_extension. -message ExtensionRequest { - // Fully-qualified type name. The format should be . - string containing_type = 1; - int32 extension_number = 2; -} - -// The message sent by the server to answer ServerReflectionInfo method. -message ServerReflectionResponse { - string valid_host = 1; - ServerReflectionRequest original_request = 2; - // The server set one of the following fields accroding to the message_request - // in the request. - oneof message_response { - // This message is used to answer file_by_filename, file_containing_symbol, - // file_containing_extension requests with transitive dependencies. As - // the repeated label is not allowed in oneof fields, we use a - // FileDescriptorResponse message to encapsulate the repeated fields. - // The reflection service is allowed to avoid sending FileDescriptorProtos - // that were previously sent in response to earlier requests in the stream. - FileDescriptorResponse file_descriptor_response = 4; - - // This message is used to answer all_extension_numbers_of_type requst. - ExtensionNumberResponse all_extension_numbers_response = 5; - - // This message is used to answer list_services request. - ListServiceResponse list_services_response = 6; - - // This message is used when an error occurs. - ErrorResponse error_response = 7; - } -} - -// Serialized FileDescriptorProto messages sent by the server answering -// a file_by_filename, file_containing_symbol, or file_containing_extension -// request. -message FileDescriptorResponse { - // Serialized FileDescriptorProto messages. We avoid taking a dependency on - // descriptor.proto, which uses proto2 only features, by making them opaque - // bytes instead. - repeated bytes file_descriptor_proto = 1; -} - -// A list of extension numbers sent by the server answering -// all_extension_numbers_of_type request. -message ExtensionNumberResponse { - // Full name of the base type, including the package name. The format - // is . - string base_type_name = 1; - repeated int32 extension_number = 2; -} - -// A list of ServiceResponse sent by the server answering list_services request. -message ListServiceResponse { - // The information of each service may be expanded in the future, so we use - // ServiceResponse message to encapsulate it. - repeated ServiceResponse service = 1; -} - -// The information of a single service used by ListServiceResponse to answer -// list_services request. -message ServiceResponse { - // Full name of a registered service, including its package name. The format - // is . - string name = 1; -} - -// The error code and error message sent by the server when an error occurs. -message ErrorResponse { - // This field uses the error codes defined in grpc::StatusCode. - int32 error_code = 1; - string error_message = 2; -} \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/helloworld.proto b/spawn_proxy/proxy/priv/protos/helloworld.proto deleted file mode 100644 index 47aa9793..00000000 --- a/spawn_proxy/proxy/priv/protos/helloworld.proto +++ /dev/null @@ -1,47 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "io.grpc.examples.helloworld"; -option java_outer_classname = "HelloWorldProto"; -option objc_class_prefix = "HLW"; - -import "google/api/annotations.proto"; -import "google/protobuf/timestamp.proto"; - -package helloworld; - -// The greeting service definition. -service GreeterService { - // Sends a greeting - rpc SayHello (HelloRequest) returns (HelloReply) { - option (google.api.http) = { - get: "/v1/greeter/{name}" - }; - } - - rpc SayHelloFrom (HelloRequestFrom) returns (HelloReply) { - option (google.api.http) = { - post: "/v1/greeter" - body: "*" - }; - } -} - -// The request message containing the user's name. -message HelloRequest { - string name = 1; -} - -// HelloRequestFrom! -message HelloRequestFrom { - // Name! - string name = 1; - // From! - string from = 2; -} - -// The response message containing the greetings -message HelloReply { - string message = 1; - google.protobuf.Timestamp today = 2; -} diff --git a/spawn_proxy/proxy/priv/protos/io/cloudevents/v1/spec.proto b/spawn_proxy/proxy/priv/protos/io/cloudevents/v1/spec.proto deleted file mode 100644 index 230a8ef9..00000000 --- a/spawn_proxy/proxy/priv/protos/io/cloudevents/v1/spec.proto +++ /dev/null @@ -1,59 +0,0 @@ -/** - * CloudEvent Protobuf Format - * - * - Required context attributes are explicitly represented. - * - Optional and Extension context attributes are carried in a map structure. - * - Data may be represented as binary, text, or protobuf messages. - */ - - syntax = "proto3"; - - package io.cloudevents.v1; - - import "google/protobuf/any.proto"; - import "google/protobuf/timestamp.proto"; - - option go_package = "cloudevents.io/genproto/v1"; - option java_package = "io.cloudevents.v1.proto"; - option java_multiple_files = true; - option php_namespace = "Io\\CloudEvents\\V1\\Proto"; - option ruby_package = "Io::CloudEvents::V1::Proto"; - - message CloudEvent { - - // -- CloudEvent Context Attributes - - // Required Attributes - string id = 1; - string source = 2; // URI-reference - string spec_version = 3; - string type = 4; - - // Optional & Extension Attributes - map attributes = 5; - - // -- CloudEvent Data (Bytes, Text, or Proto) - oneof data { - bytes binary_data = 6; - string text_data = 7; - google.protobuf.Any proto_data = 8; - } - - /** - * The CloudEvent specification defines - * seven attribute value types... - */ - - message CloudEventAttributeValue { - - oneof attr { - bool ce_boolean = 1; - int32 ce_integer = 2; - string ce_string = 3; - bytes ce_bytes = 4; - string ce_uri = 5; - string ce_uri_ref = 6; - google.protobuf.Timestamp ce_timestamp = 7; - } - } - } \ No newline at end of file diff --git a/spawn_proxy/proxy/priv/protos/modules/helloworld.pb.ex b/spawn_proxy/proxy/priv/protos/modules/helloworld.pb.ex deleted file mode 100644 index e9633918..00000000 --- a/spawn_proxy/proxy/priv/protos/modules/helloworld.pb.ex +++ /dev/null @@ -1,848 +0,0 @@ -defmodule Helloworld.HelloRequest do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - name: "HelloRequest", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "name", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "name", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - end - - field :name, 1, type: :string -end - -defmodule Helloworld.HelloRequestFrom do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - name: "HelloRequestFrom", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "name", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "name", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "from", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "from", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - end - - field :name, 1, type: :string - field :from, 2, type: :string -end - -defmodule Helloworld.HelloReply do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - name: "HelloReply", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "message", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "message", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "today", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp", - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "today", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - end - - field :message, 1, type: :string - field :today, 2, type: Google.Protobuf.Timestamp -end - -defmodule Helloworld.GreeterService.Service do - @moduledoc false - use GRPC.Service, name: "helloworld.GreeterService", protoc_gen_elixir_version: "0.12.0" - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.FileDescriptorProto{ - name: "helloworld.proto", - package: "helloworld", - dependency: ["google/api/annotations.proto", "google/protobuf/timestamp.proto"], - message_type: [ - %Google.Protobuf.DescriptorProto{ - name: "HelloRequest", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "name", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "name", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - }, - %Google.Protobuf.DescriptorProto{ - name: "HelloRequestFrom", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "name", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "name", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "from", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "from", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - }, - %Google.Protobuf.DescriptorProto{ - name: "HelloReply", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "message", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "message", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "today", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp", - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "today", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - ], - enum_type: [], - service: [ - %Google.Protobuf.ServiceDescriptorProto{ - name: "GreeterService", - method: [ - %Google.Protobuf.MethodDescriptorProto{ - name: "SayHello", - input_type: ".helloworld.HelloRequest", - output_type: ".helloworld.HelloReply", - options: %Google.Protobuf.MethodOptions{ - deprecated: false, - idempotency_level: :IDEMPOTENCY_UNKNOWN, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [ - {72_295_728, 2, - <<18, 18, 47, 118, 49, 47, 103, 114, 101, 101, 116, 101, 114, 47, 123, 110, 97, - 109, 101, 125>>} - ] - }, - client_streaming: false, - server_streaming: false, - __unknown_fields__: [] - }, - %Google.Protobuf.MethodDescriptorProto{ - name: "SayHelloFrom", - input_type: ".helloworld.HelloRequestFrom", - output_type: ".helloworld.HelloReply", - options: %Google.Protobuf.MethodOptions{ - deprecated: false, - idempotency_level: :IDEMPOTENCY_UNKNOWN, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [ - {72_295_728, 2, - <<34, 11, 47, 118, 49, 47, 103, 114, 101, 101, 116, 101, 114, 58, 1, 42>>} - ] - }, - client_streaming: false, - server_streaming: false, - __unknown_fields__: [] - } - ], - options: nil, - __unknown_fields__: [] - } - ], - extension: [], - options: %Google.Protobuf.FileOptions{ - java_package: "io.grpc.examples.helloworld", - java_outer_classname: "HelloWorldProto", - optimize_for: :SPEED, - java_multiple_files: true, - go_package: nil, - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - java_generate_equals_and_hash: nil, - deprecated: false, - java_string_check_utf8: false, - cc_enable_arenas: true, - objc_class_prefix: "HLW", - csharp_namespace: nil, - swift_prefix: nil, - php_class_prefix: nil, - php_namespace: nil, - php_generic_services: false, - php_metadata_namespace: nil, - ruby_package: nil, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] - }, - source_code_info: %Google.Protobuf.SourceCodeInfo{ - location: [ - %Google.Protobuf.SourceCodeInfo.Location{ - path: [], - span: [0, 0, 46, 1], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\f", - span: [0, 0, 18], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b", - span: [2, 0, 34], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b\n", - span: [2, 0, 34], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b", - span: [3, 0, 52], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [8, 1], - span: [3, 0, 52], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b", - span: [4, 0, 48], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b\b", - span: [4, 0, 48], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b", - span: [5, 0, 33], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b$", - span: [5, 0, 33], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 0], - span: [7, 0, 38], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 1], - span: [8, 0, 41], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [2], - span: [10, 0, 19], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0], - span: [13, 0, 27, 1], - leading_comments: " The greeting service definition.\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 1], - span: [13, 8, 22], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0], - span: [15, 2, 19, 3], - leading_comments: " Sends a greeting\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 1], - span: [15, 6, 14], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 2], - span: [15, 16, 28], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 3], - span: [15, 39, 49], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 4], - span: [16, 4, 18, 6], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 4, 72_295_728], - span: [16, 4, 18, 6], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1], - span: [21, 2, 26, 3], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 1], - span: [21, 6, 18], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 2], - span: [21, 20, 36], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 3], - span: [21, 47, 57], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 4], - span: [22, 4, 25, 6], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 4, 72_295_728], - span: [22, 4, 25, 6], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0], - span: [30, 0, 32, 1], - leading_comments: " The request message containing the user's name.\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 1], - span: [30, 8, 20], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0], - span: [31, 2, 18], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 5], - span: [31, 2, 8], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 1], - span: [31, 9, 13], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 3], - span: [31, 16, 17], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1], - span: [35, 0, 40, 1], - leading_comments: " HelloRequestFrom!\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 1], - span: [35, 8, 24], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0], - span: [37, 2, 18], - leading_comments: " Name!\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 5], - span: [37, 2, 8], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 1], - span: ~c"%\t\r", - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 3], - span: [37, 16, 17], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1], - span: [39, 2, 18], - leading_comments: " From!\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 5], - span: [39, 2, 8], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 1], - span: ~c"'\t\r", - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 3], - span: [39, 16, 17], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2], - span: [43, 0, 46, 1], - leading_comments: " The response message containing the greetings\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 1], - span: [43, 8, 18], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0], - span: [44, 2, 21], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 5], - span: [44, 2, 8], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 1], - span: [44, 9, 16], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 3], - span: [44, 19, 20], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1], - span: [45, 2, 38], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 6], - span: [45, 2, 27], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 1], - span: [45, 28, 33], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 3], - span: ~c"-$%", - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - } - ], - __unknown_fields__: [] - }, - public_dependency: [], - weak_dependency: [], - syntax: "proto3", - edition: nil, - __unknown_fields__: [] - } - end - - rpc :SayHello, Helloworld.HelloRequest, Helloworld.HelloReply - - rpc :SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply -end - -defmodule Helloworld.GreeterService.ActorDispatcher do - @moduledoc since: "1.2.1" - use GRPC.Server, service: Helloworld.GreeterService - - alias Sidecar.GRPC.Dispatcher -end - -defmodule Sidecar.GRPC.ProxyEndpoint do - @moduledoc false - use GRPC.Endpoint - - intercept(GRPC.Server.Interceptors.Logger) - - services = [ - Helloworld.GreeterService.Service - ] - - run(services) -end - -defmodule Sidecar.GRPC.ServiceResolver do - @moduledoc since: "1.2.1" - - @actors [ - { - "GreeterService", - %{ - service_name: "Helloworld.GreeterService", - service_module: Helloworld.GreeterService.Service - } - } - ] - - def has_actor?(actor_name) do - Enum.any?(@actors, fn {name, _} -> actor_name == name end) - end - - def get_descriptor(actor_name) do - actor_attributes = - Enum.filter(@actors, fn {name, _} -> actor_name == name end) - |> Enum.map(fn {_name, attributes} -> attributes end) - |> List.first() - - mod = Map.get(actor_attributes, :service_module) - - mod.descriptor() - |> Map.get(:service) - |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> - actor_name == name - end) - |> List.first() - end -end - -defmodule Sidecar.GRPC.Reflection.Server do - @moduledoc since: "1.2.1" - use GrpcReflection.Server, - version: :v1, - services: [ - Helloworld.GreeterService.Service - ] -end \ No newline at end of file From 679e7ca206ccbb7f8152dd4aa41fdbc3a66e8040 Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Thu, 30 May 2024 14:20:00 -0300 Subject: [PATCH 25/48] hello world proto with extensions --- priv/protos/helloworld.proto | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/priv/protos/helloworld.proto b/priv/protos/helloworld.proto index 47aa9793..cf94c447 100644 --- a/priv/protos/helloworld.proto +++ b/priv/protos/helloworld.proto @@ -7,6 +7,7 @@ option objc_class_prefix = "HLW"; import "google/api/annotations.proto"; import "google/protobuf/timestamp.proto"; +import "eigr/functions/protocol/actors/extensions.proto"; package helloworld; @@ -29,13 +30,13 @@ service GreeterService { // The request message containing the user's name. message HelloRequest { - string name = 1; + string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; } // HelloRequestFrom! message HelloRequestFrom { // Name! - string name = 1; + string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; // From! string from = 2; } From 4b7506667542b53b0eaa460f81a3a50ce73f60e0 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Fri, 31 May 2024 08:33:37 -0300 Subject: [PATCH 26/48] Merge lock --- mix.lock | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/mix.lock b/mix.lock index 1ba65341..a5718bec 100644 --- a/mix.lock +++ b/mix.lock @@ -4,7 +4,7 @@ "bandit": {:hex, :bandit, "1.5.2", "ed0a41c43a9e529c670d0fd48371db4027e7b80d43b1942893e17deb8bed0540", [:mix], [{:hpax, "~> 0.1.1", [hex: :hpax, repo: "hexpm", optional: false]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:thousand_island, "~> 1.0", [hex: :thousand_island, repo: "hexpm", optional: false]}, {:websock, "~> 0.5", [hex: :websock, repo: "hexpm", optional: false]}], "hexpm", "35ddbdce7e8a2a3c6b5093f7299d70832a43ed2f4a1852885a61d334cab1b4ad"}, "bunt": {:hex, :bunt, "1.0.0", "081c2c665f086849e6d57900292b3a161727ab40431219529f13c4ddcf3e7a44", [:mix], [], "hexpm", "dc5f86aa08a5f6fa6b8096f0735c4e76d54ae5c9fa2c143e5a1fc7c1cd9bb6b5"}, "castore": {:hex, :castore, "1.0.7", "b651241514e5f6956028147fe6637f7ac13802537e895a724f90bf3e36ddd1dd", [:mix], [], "hexpm", "da7785a4b0d2a021cd1292a60875a784b6caef71e76bf4917bdee1f390455cf5"}, - "cc_precompiler": {:hex, :cc_precompiler, "0.1.10", "47c9c08d8869cf09b41da36538f62bc1abd3e19e41701c2cea2675b53c704258", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "f6e046254e53cd6b41c6bacd70ae728011aa82b2742a80d6e2214855c6e06b22"}, + "cc_precompiler": {:hex, :cc_precompiler, "0.1.9", "e8d3364f310da6ce6463c3dd20cf90ae7bbecbf6c5203b98bf9b48035592649b", [:mix], [{:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}], "hexpm", "9dcab3d0f3038621f1601f13539e7a9ee99843862e66ad62827b0c42b2f58a54"}, "chatterbox": {:hex, :ts_chatterbox, "0.15.1", "5cac4d15dd7ad61fc3c4415ce4826fc563d4643dee897a558ec4ea0b1c835c9c", [:rebar3], [{:hpack, "~> 0.3.0", [hex: :hpack_erl, repo: "hexpm", optional: false]}], "hexpm", "4f75b91451338bc0da5f52f3480fa6ef6e3a2aeecfc33686d6b3d0a0948f31aa"}, "cloak": {:hex, :cloak, "1.1.4", "aba387b22ea4d80d92d38ab1890cc528b06e0e7ef2a4581d71c3fdad59e997e7", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "92b20527b9aba3d939fab0dd32ce592ff86361547cfdc87d74edce6f980eb3d7"}, "cloak_ecto": {:hex, :cloak_ecto, "1.3.0", "0de127c857d7452ba3c3367f53fb814b0410ff9c680a8d20fbe8b9a3c57a1118", [:mix], [{:cloak, "~> 1.1.1", [hex: :cloak, repo: "hexpm", optional: false]}, {:ecto, "~> 3.0", [hex: :ecto, repo: "hexpm", optional: false]}], "hexpm", "314beb0c123b8a800418ca1d51065b27ba3b15f085977e65c0f7b2adab2de1cc"}, @@ -16,24 +16,23 @@ "db_connection": {:hex, :db_connection, "2.6.0", "77d835c472b5b67fc4f29556dee74bf511bbafecdcaf98c27d27fa5918152086", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c2f992d15725e721ec7fbc1189d4ecdb8afef76648c746a8e1cad35e3b8a35f3"}, "decimal": {:hex, :decimal, "2.1.1", "5611dca5d4b2c3dd497dec8f68751f1f1a54755e8ed2a966c2633cf885973ad6", [:mix], [], "hexpm", "53cfe5f497ed0e7771ae1a475575603d77425099ba5faef9394932b35020ffcc"}, "decorator": {:hex, :decorator, "1.4.0", "a57ac32c823ea7e4e67f5af56412d12b33274661bb7640ec7fc882f8d23ac419", [:mix], [], "hexpm", "0a07cedd9083da875c7418dea95b78361197cf2bf3211d743f6f7ce39656597f"}, - "delta_crdt": {:hex, :delta_crdt, "0.6.5", "c7bb8c2c7e60f59e46557ab4e0224f67ba22f04c02826e273738f3dcc4767adc", [:mix], [{:merkle_map, "~> 0.2.0", [hex: :merkle_map, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c6ae23a525d30f96494186dd11bf19ed9ae21d9fe2c1f1b217d492a7cc7294ae"}, + "delta_crdt": {:hex, :delta_crdt, "0.6.4", "79d235eef82a58bb0cb668bc5b9558d2e65325ccb46b74045f20b36fd41671da", [:mix], [{:merkle_map, "~> 0.2.0", [hex: :merkle_map, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "4a81f579c06aeeb625db54c6c109859a38aa00d837e3e7f8ac27b40cea34885a"}, "earmark_parser": {:hex, :earmark_parser, "1.4.39", "424642f8335b05bb9eb611aa1564c148a8ee35c9c8a8bba6e129d51a3e3c6769", [:mix], [], "hexpm", "06553a88d1f1846da9ef066b87b57c6f605552cfbe40d20bd8d59cc6bde41944"}, "ecto": {:hex, :ecto, "3.11.2", "e1d26be989db350a633667c5cda9c3d115ae779b66da567c68c80cfb26a8c9ee", [:mix], [{:decimal, "~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "3c38bca2c6f8d8023f2145326cc8a80100c3ffe4dcbd9842ff867f7fc6156c65"}, "ecto_sql": {:hex, :ecto_sql, "3.11.2", "c7cc7f812af571e50b80294dc2e535821b3b795ce8008d07aa5f336591a185a8", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11.0", [hex: :ecto, repo: "hexpm", optional: false]}, {:myxql, "~> 0.6.0", [hex: :myxql, repo: "hexpm", optional: true]}, {:postgrex, "~> 0.16 or ~> 1.0", [hex: :postgrex, repo: "hexpm", optional: true]}, {:tds, "~> 2.1.1 or ~> 2.2", [hex: :tds, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "73c07f995ac17dbf89d3cfaaf688fcefabcd18b7b004ac63b0dc4ef39499ed6b"}, "ecto_sqlite3": {:hex, :ecto_sqlite3, "0.13.0", "0c3dc8ff24f378ef108619fd5c18bbbea43cb86dc8733c1c596bd7e0a5bb9e28", [:mix], [{:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:ecto, "~> 3.11", [hex: :ecto, repo: "hexpm", optional: false]}, {:ecto_sql, "~> 3.11", [hex: :ecto_sql, repo: "hexpm", optional: false]}, {:exqlite, "~> 0.9", [hex: :exqlite, repo: "hexpm", optional: false]}], "hexpm", "8ab7d8bf6663b811b80c9fa8730780f7077106c40a3fdbae384fe8f82315b257"}, "ed25519": {:hex, :ed25519, "1.4.1", "479fb83c3e31987c9cad780e6aeb8f2015fb5a482618cdf2a825c9aff809afc4", [:mix], [], "hexpm", "0dacb84f3faa3d8148e81019ca35f9d8dcee13232c32c9db5c2fb8ff48c80ec7"}, - "elixir_make": {:hex, :elixir_make, "0.8.3", "d38d7ee1578d722d89b4d452a3e36bcfdc644c618f0d063b874661876e708683", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "5c99a18571a756d4af7a4d89ca75c28ac899e6103af6f223982f09ce44942cc9"}, + "elixir_make": {:hex, :elixir_make, "0.7.8", "505026f266552ee5aabca0b9f9c229cbb496c689537c9f922f3eb5431157efc7", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:certifi, "~> 2.0", [hex: :certifi, repo: "hexpm", optional: true]}], "hexpm", "7a71945b913d37ea89b06966e1342c85cfe549b15e6d6d081e8081c493062c07"}, "ex_doc": {:hex, :ex_doc, "0.33.0", "690562b153153c7e4d455dc21dab86e445f66ceba718defe64b0ef6f0bd83ba0", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "3f69adc28274cb51be37d09b03e4565232862a4b10288a3894587b0131412124"}, - "exqlite": {:hex, :exqlite, "0.23.0", "6e851c937a033299d0784994c66da24845415072adbc455a337e20087bce9033", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.8", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "404341cceec5e6466aaed160cf0b58be2019b60af82588c215e1224ebd3ec831"}, + "exqlite": {:hex, :exqlite, "0.19.0", "0f3ee29e35bed38552dd0ed59600aa81c78f867f5b5ff0e17d330148e0465483", [:make, :mix], [{:cc_precompiler, "~> 0.1", [hex: :cc_precompiler, repo: "hexpm", optional: false]}, {:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:elixir_make, "~> 0.7", [hex: :elixir_make, repo: "hexpm", optional: false]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "55a8fbb0443f03d4a256e3458bd1203eff5037a6624b76460eaaa9080f462b06"}, "file_system": {:hex, :file_system, "1.0.0", "b689cc7dcee665f774de94b5a832e578bd7963c8e637ef940cd44327db7de2cd", [:mix], [], "hexpm", "6752092d66aec5a10e662aefeed8ddb9531d79db0bc145bb8c40325ca1d8536d"}, "finch": {:hex, :finch, "0.18.0", "944ac7d34d0bd2ac8998f79f7a811b21d87d911e77a786bc5810adb75632ada4", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:mint, "~> 1.3", [hex: :mint, repo: "hexpm", optional: false]}, {:nimble_options, "~> 0.4 or ~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_pool, "~> 0.2.6 or ~> 1.0", [hex: :nimble_pool, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "69f5045b042e531e53edc2574f15e25e735b522c37e2ddb766e15b979e03aa65"}, "flow": {:hex, :flow, "1.2.4", "1dd58918287eb286656008777cb32714b5123d3855956f29aa141ebae456922d", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}], "hexpm", "874adde96368e71870f3510b91e35bc31652291858c86c0e75359cbdd35eb211"}, "gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"}, "gnat": {:hex, :gnat, "1.8.3", "ee12f84b46617d4cef4c0e1ac586ec8bf80b422878866e128e2f37b7cb20a21a", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:nkeys, "~> 0.2", [hex: :nkeys, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ae88816038ccd3dfc9cfcf5b79a5a4dc52623a25062f1e9c9e7641751bf42ceb"}, - "google_protos": {:hex, :google_protos, "0.4.0", "93e1be2c1a07517ffed761f69047776caf35e4acd385aac4f5ce4fedd07f3660", [:mix], [{:protobuf, "~> 0.10", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "4c54983d78761a3643e2198adf0f5d40a5a8b08162f3fc91c50faa257f3fa19f"}, "gproc": {:hex, :gproc, "0.9.1", "f1df0364423539cf0b80e8201c8b1839e229e5f9b3ccb944c5834626998f5b8c", [:rebar3], [], "hexpm", "905088e32e72127ed9466f0bac0d8e65704ca5e73ee5a62cb073c3117916d507"}, "grpc": {:hex, :grpc, "0.8.1", "a8a5884a0d41fc30679c269d0332571cebb43cbfd6eb3d4819169778e866343e", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1cccd9fd83547a562f315cc0e1ee1879546f0a44193b5c8eb8d68dae0bb2065b"}, - "grpc_reflection": {:hex, :grpc_reflection, "0.1.3", "17bead7b3c653d65622e2984c057b781b1fc470114c010d1b68f16f8143b9183", [:mix], [{:google_protos, "~> 0.4.0", [hex: :google_protos, repo: "hexpm", optional: false]}, {:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "3c80644a6a8631de3d2c862013988f4986b0f3a987ce57d06f6176a50bb90fe2"}, + "grpc_reflection": {:hex, :grpc_reflection, "0.1.0", "0c835a933c3dd3ff55527a8d491da249b76b762ae56aa43909c87a4f9f1a13ef", [:mix], [{:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "5031b94b115d8e6f66bd71ef1572aca9f2212aa765920c3285a7de382ec5d03e"}, "grpcbox": {:hex, :grpcbox, "0.17.1", "6e040ab3ef16fe699ffb513b0ef8e2e896da7b18931a1ef817143037c454bcce", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.15.1", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.9.1", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "4a3b5d7111daabc569dc9cbd9b202a3237d81c80bf97212fbc676832cb0ceb17"}, "gun": {:hex, :gun, "2.1.0", "b4e4cbbf3026d21981c447e9e7ca856766046eff693720ba43114d7f5de36e87", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "52fc7fc246bfc3b00e01aea1c2854c70a366348574ab50c57dfe796d24a0101d"}, "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, @@ -56,10 +55,11 @@ "mnesiac": {:hex, :mnesiac, "0.3.14", "5ea3f1f3e615073629d0822bcf2297be73149beee2d1f7e482c1943894f59b53", [:mix], [{:libcluster, "~> 3.3", [hex: :libcluster, repo: "hexpm", optional: true]}], "hexpm", "e51b38bf983b9320aba56d5dce79dbf50cbff07f7495e70b89eb45461b8d32fa"}, "myxql": {:hex, :myxql, "0.6.4", "1502ea37ee23c31b79725b95d4cc3553693c2bda7421b1febc50722fd988c918", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a3307f4671f3009d3708283649adf205bfe280f7e036fc8ef7f16dbf821ab8e9"}, "nebulex": {:hex, :nebulex, "2.6.1", "58c1924fa9f4e844c3470c20e6351b311a556652de29ed3b05fd2e5d817c6fef", [:mix], [{:decorator, "~> 1.4", [hex: :decorator, repo: "hexpm", optional: true]}, {:shards, "~> 1.1", [hex: :shards, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "177949fef2dc34a0055d7140b6bc94f6904225e2b5bbed6266ea9679522d23c6"}, - "nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"}, + "nimble_options": {:hex, :nimble_options, "1.1.0", "3b31a57ede9cb1502071fade751ab0c7b8dbe75a9a4c2b5bbb0943a690b63172", [:mix], [], "hexpm", "8bbbb3941af3ca9acc7835f5655ea062111c9c27bcac53e004460dfd19008a99"}, "nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"}, - "nimble_pool": {:hex, :nimble_pool, "1.1.0", "bf9c29fbdcba3564a8b800d1eeb5a3c58f36e1e11d7b7fb2e084a643f645f06b", [:mix], [], "hexpm", "af2e4e6b34197db81f7aad230c1118eac993acc0dae6bc83bac0126d4ae0813a"}, + "nimble_pool": {:hex, :nimble_pool, "1.0.0", "5eb82705d138f4dd4423f69ceb19ac667b3b492ae570c9f5c900bb3d2f50a847", [:mix], [], "hexpm", "80be3b882d2d351882256087078e1b1952a28bf98d0a287be87e4a24a710b67a"}, "nkeys": {:hex, :nkeys, "0.2.2", "b1ab3324ed4f3a2c9658d7e80feeef86b4d15fbfd12ca5c8cf068289f582fcfa", [:mix], [{:ed25519, "~> 1.3", [hex: :ed25519, repo: "hexpm", optional: false]}], "hexpm", "3578802427b8d1d11ea6dd785c2ab774f527e2c3e449e67bd34612ab71ca471d"}, + "observer_cli": {:hex, :observer_cli, "1.7.4", "3c1bfb6d91bf68f6a3d15f46ae20da0f7740d363ee5bc041191ce8722a6c4fae", [:mix, :rebar3], [{:recon, "~> 2.5.1", [hex: :recon, repo: "hexpm", optional: false]}], "hexpm", "50de6d95d814f447458bd5d72666a74624eddb0ef98bdcee61a0153aae0865ff"}, "opentelemetry": {:hex, :opentelemetry, "1.4.0", "f928923ed80adb5eb7894bac22e9a198478e6a8f04020ae1d6f289fdcad0b498", [:rebar3], [{:opentelemetry_api, "~> 1.3.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "50b32ce127413e5d87b092b4d210a3449ea80cd8224090fe68d73d576a3faa15"}, "opentelemetry_api": {:hex, :opentelemetry_api, "1.3.0", "03e2177f28dd8d11aaa88e8522c81c2f6a788170fe52f7a65262340961e663f9", [:mix, :rebar3], [{:opentelemetry_semantic_conventions, "~> 0.2", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: false]}], "hexpm", "b9e5ff775fd064fa098dba3c398490b77649a352b40b0b730a6b7dc0bdd68858"}, "opentelemetry_exporter": {:hex, :opentelemetry_exporter, "1.7.0", "dec4e90c0667cf11a3642f7fe71982dbc0c6bfbb8725a0b13766830718cf0d98", [:rebar3], [{:grpcbox, ">= 0.0.0", [hex: :grpcbox, repo: "hexpm", optional: false]}, {:opentelemetry, "~> 1.4.0", [hex: :opentelemetry, repo: "hexpm", optional: false]}, {:opentelemetry_api, "~> 1.3.0", [hex: :opentelemetry_api, repo: "hexpm", optional: false]}, {:tls_certificate_check, "~> 1.18", [hex: :tls_certificate_check, repo: "hexpm", optional: false]}], "hexpm", "d0f25f6439ec43f2561537c3fabbe177b38547cddaa3a692cbb8f4770dbefc1e"}, @@ -70,12 +70,14 @@ "plug_crypto": {:hex, :plug_crypto, "2.1.0", "f44309c2b06d249c27c8d3f65cfe08158ade08418cf540fd4f72d4d6863abb7b", [:mix], [], "hexpm", "131216a4b030b8f8ce0f26038bc4421ae60e4bb95c5cf5395e1421437824c4fa"}, "pluggable": {:hex, :pluggable, "1.1.0", "7eba3bc70c0caf4d9056c63c882df8862f7534f0145da7ab3a47ca73e4adb1e4", [:mix], [], "hexpm", "d12eb00ea47b21e92cd2700d6fbe3737f04b64e71b63aad1c0accde87c751637"}, "poolboy": {:hex, :poolboy, "1.5.2", "392b007a1693a64540cead79830443abf5762f5d30cf50bc95cb2c1aaafa006b", [:rebar3], [], "hexpm", "dad79704ce5440f3d5a3681c8590b9dc25d1a561e8f5a9c995281012860901e3"}, - "postgrex": {:hex, :postgrex, "0.18.0", "f34664101eaca11ff24481ed4c378492fed2ff416cd9b06c399e90f321867d7e", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a042989ba1bc1cca7383ebb9e461398e3f89f868c92ce6671feb7ef132a252d1"}, + "postgrex": {:hex, :postgrex, "0.17.4", "5777781f80f53b7c431a001c8dad83ee167bcebcf3a793e3906efff680ab62b3", [:mix], [{:db_connection, "~> 2.1", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "6458f7d5b70652bc81c3ea759f91736c16a31be000f306d3c64bcdfe9a18b3cc"}, "protobuf": {:hex, :protobuf, "0.12.0", "58c0dfea5f929b96b5aa54ec02b7130688f09d2de5ddc521d696eec2a015b223", [:mix], [{:jason, "~> 1.2", [hex: :jason, repo: "hexpm", optional: true]}], "hexpm", "75fa6cbf262062073dd51be44dd0ab940500e18386a6c4e87d5819a58964dc45"}, - "protobuf_generate": {:hex, :protobuf_generate, "0.1.2", "45b9a9ae8606333cdea993ceaaecd799d206cdfe23348d37c06207eac76cbee6", [:mix], [{:protobuf, "~> 0.12", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "55b0ff8385703317ca90e1bd30a2ece99e80ae0c73e6ebcfb374e84e57870d61"}, + "protobuf_generate": {:hex, :protobuf_generate, "0.1.1", "f6098b85161dcfd48a4f6f1abee4ee5e057981dfc50aafb1aa4bd5b0529aa89b", [:mix], [{:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "93a38c8e2aba2a17e293e9ef1359122741f717103984aa6d1ebdca0efb17ab9d"}, "ranch": {:hex, :ranch, "1.8.0", "8c7a100a139fd57f17327b6413e4167ac559fbc04ca7448e9be9057311597a1d", [:make, :rebar3], [], "hexpm", "49fbcfd3682fab1f5d109351b61257676da1a2fdbe295904176d5e521a2ddfe5"}, + "recon": {:hex, :recon, "2.5.4", "05dd52a119ee4059fa9daa1ab7ce81bc7a8161a2f12e9d42e9d551ffd2ba901c", [:mix, :rebar3], [], "hexpm", "e9ab01ac7fc8572e41eb59385efeb3fb0ff5bf02103816535bacaedf327d0263"}, "retry": {:hex, :retry, "0.18.0", "dc58ebe22c95aa00bc2459f9e0c5400e6005541cf8539925af0aa027dc860543", [:mix], [], "hexpm", "9483959cc7bf69c9e576d9dfb2b678b71c045d3e6f39ab7c9aa1489df4492d73"}, "shards": {:hex, :shards, "1.1.1", "8b42323457d185b26b15d05187784ce6c5d1e181b35c46fca36c45f661defe02", [:make, :rebar3], [], "hexpm", "169a045dae6668cda15fbf86d31bf433d0dbbaec42c8c23ca4f8f2d405ea8eda"}, + "sobelow": {:hex, :sobelow, "0.13.0", "218afe9075904793f5c64b8837cc356e493d88fddde126a463839351870b8d1e", [:mix], [{:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cd6e9026b85fc35d7529da14f95e85a078d9dd1907a9097b3ba6ac7ebbe34a0d"}, "ssl_verify_fun": {:hex, :ssl_verify_fun, "1.1.7", "354c321cf377240c7b8716899e182ce4890c5938111a1296add3ec74cf1715df", [:make, :mix, :rebar3], [], "hexpm", "fe4c190e8f37401d30167c8c405eda19469f34577987c76dde613e838bbc67f8"}, "tds": {:hex, :tds, "2.3.5", "fedfb96d53206f01eac62ead859e47e1541a62e1553e9eb7a8801c7dca59eae8", [:mix], [{:db_connection, "~> 2.0", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.9 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "52e350f5dd5584bbcff9859e331be144d290b41bd4c749b936014a17660662f2"}, "telemetry": {:hex, :telemetry, "1.2.1", "68fdfe8d8f05a8428483a97d7aab2f268aaff24b49e0f599faa091f1d4e7f61c", [:rebar3], [], "hexpm", "dad9ce9d8effc621708f99eac538ef1cbe05d6a874dd741de2e689c47feafed5"}, @@ -84,6 +86,7 @@ "telemetry_poller": {:hex, :telemetry_poller, "1.1.0", "58fa7c216257291caaf8d05678c8d01bd45f4bdbc1286838a28c4bb62ef32999", [:rebar3], [{:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "9eb9d9cbfd81cbd7cdd24682f8711b6e2b691289a0de6826e58452f28c103c8f"}, "thousand_island": {:hex, :thousand_island, "1.3.5", "6022b6338f1635b3d32406ff98d68b843ba73b3aa95cfc27154223244f3a6ca5", [:mix], [{:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "2be6954916fdfe4756af3239fb6b6d75d0b8063b5df03ba76fd8a4c87849e180"}, "tls_certificate_check": {:hex, :tls_certificate_check, "1.22.1", "0f450cc1568a67a65ce5e15df53c53f9a098c3da081c5f126199a72505858dc1", [:rebar3], [{:ssl_verify_fun, "~> 1.1", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "3092be0babdc0e14c2e900542351e066c0fa5a9cf4b3597559ad1e67f07938c0"}, + "websock": {:hex, :websock, "0.5.3", "2f69a6ebe810328555b6fe5c831a851f485e303a7c8ce6c5f675abeb20ebdadc", [:mix], [], "hexpm", "6105453d7fac22c712ad66fab1d45abdf049868f253cf719b625151460b8b453"}, "x509": {:hex, :x509, "0.8.8", "aaf5e58b19a36a8e2c5c5cff0ad30f64eef5d9225f0fd98fb07912ee23f7aba3", [:mix], [], "hexpm", "ccc3bff61406e5bb6a63f06d549f3dba3a1bbb456d84517efaaa210d8a33750f"}, "yamerl": {:hex, :yamerl, "0.10.0", "4ff81fee2f1f6a46f1700c0d880b24d193ddb74bd14ef42cb0bcf46e81ef2f8e", [:rebar3], [], "hexpm", "346adb2963f1051dc837a2364e4acf6eb7d80097c0f53cbdc3046ec8ec4b4e6e"}, "yaml_elixir": {:hex, :yaml_elixir, "2.9.0", "9a256da867b37b8d2c1ffd5d9de373a4fda77a32a45b452f1708508ba7bbcb53", [:mix], [{:yamerl, "~> 0.10", [hex: :yamerl, repo: "hexpm", optional: false]}], "hexpm", "0cb0e7d4c56f5e99a6253ed1a670ed0e39c13fc45a6da054033928607ac08dfc"}, From d9904bd374b1066a1051b32eb9506c0869b4ee66 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Fri, 31 May 2024 08:34:33 -0300 Subject: [PATCH 27/48] Merge doc --- docs/modeling_with_actors.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/docs/modeling_with_actors.md b/docs/modeling_with_actors.md index 3167bb9e..d979aee1 100644 --- a/docs/modeling_with_actors.md +++ b/docs/modeling_with_actors.md @@ -1,7 +1,5 @@ # Modeling Systems with Actors -### Modeling with the Actor Model in Software Architecture - The Actor Model, introduced by Carl Hewitt in 1973, is a conceptual framework for dealing with concurrent computation. Unlike traditional models that rely on shared state and locks, the Actor Model provides a highly modular and scalable approach to designing systems, making it particularly well-suited for distributed and concurrent applications. At its core, the Actor Model revolves around the concept of "actors"—independent entities that encapsulate state and behavior. Each actor can: @@ -30,6 +28,8 @@ In the realm of business applications, the Actor Model can be employed to create 3. **Financial Systems**: In banking applications, transactions can be modeled as actors. This allows for secure, concurrent processing of transactions, ensuring that the system can handle multiple operations simultaneously without risking data corruption. +4. **Game Applications**: In multiplayer online games, actors can represent various entities such as players, non-player characters (NPCs), items, and game rooms. Each actor encapsulates its state and behavior, interacting through messages to create a dynamic and responsive game world. + ### Architectural Decisions Influenced by Actor Model Constraints Implementing the Actor Model in business applications necessitates careful architectural planning due to its unique constraints and capabilities: @@ -83,6 +83,9 @@ In business applications, actors can be modeled as business entities to better a 3. **Order Actors**: For e-commerce platforms, orders can be represented as actors. Each order actor manages the stages of the order lifecycle, such as validation, payment processing, inventory update, and shipping. - **Example**: An order actor can interact with inventory actors to check stock availability and with payment actors to process transactions. +4. **Game Entities**: In a game application, actors can represent various game entities such as players, NPCs, items, and game rooms. Each game entity actor manages its state and behavior, interacting through messages to create a dynamic and interactive game environment. + - **Example**: In a multiplayer online game, player actors manage individual player states, NPC actors handle non-player character behavior, and item actors represent in-game objects like weapons and power-ups. + ### Actor Model and Architectural Patterns Actors can be used to implement various architectural patterns, enhancing the robustness and scalability of business applications: @@ -97,8 +100,14 @@ Actors can be used to implement various architectural patterns, enhancing the ro - **Implementation**: Command actors handle operations that modify the state, while query actors provide read-only views of the state. This separation can enhance performance by allowing the system to scale read and write operations independently. 4. **State Machines**: Actors can represent state machines, where each state of the actor corresponds to a different behavior. This is particularly useful in scenarios where an entity has a well-defined lifecycle with distinct states. - - **Implementation**: Consider a user registration process. The user actor can have states like "New," "EmailSent," "Verified," and "Active." Each state defines how the actor responds to messages, enabling clear and maintainable transitions. + - **Implementation**: Consider a user registration process. The user actor can have states like "New," "Email + +Sent," "Verified," and "Active." Each state defines how the actor responds to messages, enabling clear and maintainable transitions. ### Conclusion -The Actor Model offers a robust paradigm for building scalable, resilient, and maintainable software systems. By embracing message-passing and encapsulating state within actors, developers can address the complexities of concurrency and distribution effectively. In business applications, this model can streamline processes such as order handling, customer interactions, and financial transactions. The granularity of actors significantly impacts system performance and maintainability, requiring careful management through profiling, dynamic actor creation, state partitioning, and batch processing. Additionally, actors can be modeled as business entities, aligning system design with real-world processes. By implementing architectural patterns like Sagas \ No newline at end of file +The Actor Model offers a robust paradigm for building scalable, resilient, and maintainable software systems. By embracing message-passing and encapsulating state within actors, developers can address the complexities of concurrency and distribution effectively. In business applications, this model can streamline processes such as order handling, customer interactions, financial transactions, and game interactions. The granularity of actors significantly impacts system performance and maintainability, requiring careful management through profiling, dynamic actor creation, state partitioning, and batch processing. Additionally, actors can be modeled as business entities, aligning system design with real-world processes. By implementing architectural patterns like Sagas, Event Sourcing, CQRS, and State Machines, the Actor Model can enhance the robustness and scalability of a wide range of applications. + +[Next: Index](index.md) + +[Previous: History](history.md) \ No newline at end of file From b0861a0550e89d62bff3cb0aac638c6743c2a2b7 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Fri, 31 May 2024 08:40:56 -0300 Subject: [PATCH 28/48] Fix. Protoc compiler --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1d559204..803a42de 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -32,6 +32,9 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install Protoc + uses: arduino/setup-protoc@v3 + - name: Set up Elixir uses: erlef/setup-beam@v1 with: From 70ed1be8a2ca38dd5b5ccce1fd1f19b98f84c4da Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 3 Jun 2024 16:21:21 -0300 Subject: [PATCH 29/48] Fix start grpc server --- .../generators/reflection_server_generator.ex | 20 +- .../grpc/generators/service_generator.ex | 8 +- lib/sidecar/grpc/supervisor.ex | 1 + priv/protos/modules/helloworld.pb.ex | 223 +++++++++++++----- 4 files changed, 191 insertions(+), 61 deletions(-) diff --git a/lib/sidecar/grpc/generators/reflection_server_generator.ex b/lib/sidecar/grpc/generators/reflection_server_generator.ex index b4ee80de..3888af49 100644 --- a/lib/sidecar/grpc/generators/reflection_server_generator.ex +++ b/lib/sidecar/grpc/generators/reflection_server_generator.ex @@ -15,12 +15,22 @@ defmodule Sidecar.Grpc.Generators.ReflectionServerGenerator do """ defmodule Sidecar.GRPC.Reflection.Server do @moduledoc since: "1.2.1" - use GrpcReflection.Server, version: :v1, services: [ - <%= for service_name <- @services do %> - <%= service_name %>.Service, - <% end %> - ] + defmodule V1 do + use GrpcReflection.Server, version: :v1, services: [ + <%= for service_name <- @services do %> + <%= service_name %>.Service, + <% end %> + ] + end + + defmodule V1Alpha do + use GrpcReflection.Server, version: :v1alpha, services: [ + <%= for service_name <- @services do %> + <%= service_name %>.Service, + <% end %> + ] + end end """ end diff --git a/lib/sidecar/grpc/generators/service_generator.ex b/lib/sidecar/grpc/generators/service_generator.ex index 55063b0b..ab5093c2 100644 --- a/lib/sidecar/grpc/generators/service_generator.ex +++ b/lib/sidecar/grpc/generators/service_generator.ex @@ -21,10 +21,16 @@ defmodule Sidecar.GRPC.Generators.ServiceGenerator do services = [ <%= for service_name <- @services do %> - <%= service_name %>.Service, + <%= service_name %>.ActorDispatcher, <% end %> ] + services = + [ + Sidecar.GRPC.Reflection.Server.V1, + Sidecar.GRPC.Reflection.Server.V1Alpha + ] ++ services + run(services) end """ diff --git a/lib/sidecar/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex index b95f9884..fe7841f1 100644 --- a/lib/sidecar/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -40,6 +40,7 @@ defmodule Sidecar.GRPC.Supervisor do defp maybe_start_reflection(children, false), do: children defp maybe_start_reflection(children, true) do + Logger.info("Starting gRPC Reflection...") (children ++ [{GrpcReflection, []}]) |> List.flatten() end diff --git a/priv/protos/modules/helloworld.pb.ex b/priv/protos/modules/helloworld.pb.ex index 235ac566..e9bf5bb0 100644 --- a/priv/protos/modules/helloworld.pb.ex +++ b/priv/protos/modules/helloworld.pb.ex @@ -15,7 +15,19 @@ defmodule Helloworld.HelloRequest do type: :TYPE_STRING, type_name: nil, default_value: nil, - options: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + uninterpreted_option: [], + __pb_extensions__: %{{Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true}, + __unknown_fields__: [] + }, oneof_index: nil, json_name: "name", proto3_optional: nil, @@ -34,7 +46,7 @@ defmodule Helloworld.HelloRequest do } end - field :name, 1, type: :string + field :name, 1, type: :string, deprecated: false end defmodule Helloworld.HelloRequestFrom do @@ -54,7 +66,19 @@ defmodule Helloworld.HelloRequestFrom do type: :TYPE_STRING, type_name: nil, default_value: nil, - options: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + uninterpreted_option: [], + __pb_extensions__: %{{Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true}, + __unknown_fields__: [] + }, oneof_index: nil, json_name: "name", proto3_optional: nil, @@ -87,7 +111,7 @@ defmodule Helloworld.HelloRequestFrom do } end - field :name, 1, type: :string + field :name, 1, type: :string, deprecated: false field :from, 2, type: :string end @@ -154,7 +178,11 @@ defmodule Helloworld.GreeterService.Service do %Google.Protobuf.FileDescriptorProto{ name: "helloworld.proto", package: "helloworld", - dependency: ["google/api/annotations.proto", "google/protobuf/timestamp.proto"], + dependency: [ + "google/api/annotations.proto", + "google/protobuf/timestamp.proto", + "eigr/functions/protocol/actors/extensions.proto" + ], message_type: [ %Google.Protobuf.DescriptorProto{ name: "HelloRequest", @@ -167,7 +195,21 @@ defmodule Helloworld.GreeterService.Service do type: :TYPE_STRING, type_name: nil, default_value: nil, - options: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + uninterpreted_option: [], + __pb_extensions__: %{ + {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true + }, + __unknown_fields__: [] + }, oneof_index: nil, json_name: "name", proto3_optional: nil, @@ -195,7 +237,21 @@ defmodule Helloworld.GreeterService.Service do type: :TYPE_STRING, type_name: nil, default_value: nil, - options: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + uninterpreted_option: [], + __pb_extensions__: %{ + {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true + }, + __unknown_fields__: [] + }, oneof_index: nil, json_name: "name", proto3_optional: nil, @@ -357,7 +413,7 @@ defmodule Helloworld.GreeterService.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 46, 1], + span: [0, 0, 47, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -451,9 +507,17 @@ defmodule Helloworld.GreeterService.Service do leading_detached_comments: [], __unknown_fields__: [] }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 2], + span: [9, 0, 57], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, %Google.Protobuf.SourceCodeInfo.Location{ path: [2], - span: [10, 0, 19], + span: [11, 0, 19], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -461,7 +525,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0], - span: [13, 0, 27, 1], + span: [14, 0, 28, 1], leading_comments: " The greeting service definition.\n", trailing_comments: nil, leading_detached_comments: [], @@ -469,7 +533,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 1], - span: [13, 8, 22], + span: [14, 8, 22], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -477,7 +541,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0], - span: [15, 2, 19, 3], + span: [16, 2, 20, 3], leading_comments: " Sends a greeting\n", trailing_comments: nil, leading_detached_comments: [], @@ -485,7 +549,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 1], - span: [15, 6, 14], + span: [16, 6, 14], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -493,7 +557,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 2], - span: [15, 16, 28], + span: [16, 16, 28], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -501,7 +565,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 3], - span: [15, 39, 49], + span: [16, 39, 49], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -509,7 +573,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4], - span: [16, 4, 18, 6], + span: [17, 4, 19, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -517,7 +581,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4, 72_295_728], - span: [16, 4, 18, 6], + span: [17, 4, 19, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -525,7 +589,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1], - span: [21, 2, 26, 3], + span: [22, 2, 27, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -533,7 +597,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 1], - span: [21, 6, 18], + span: [22, 6, 18], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -541,7 +605,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 2], - span: [21, 20, 36], + span: [22, 20, 36], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -549,7 +613,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 3], - span: [21, 47, 57], + span: [22, 47, 57], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -557,7 +621,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4], - span: [22, 4, 25, 6], + span: [23, 4, 26, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -565,7 +629,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4, 72_295_728], - span: [22, 4, 25, 6], + span: [23, 4, 26, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -573,7 +637,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0], - span: [30, 0, 32, 1], + span: [31, 0, 33, 1], leading_comments: " The request message containing the user's name.\n", trailing_comments: nil, leading_detached_comments: [], @@ -581,7 +645,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 1], - span: [30, 8, 20], + span: [31, 8, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -589,7 +653,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0], - span: [31, 2, 18], + span: [32, 2, 70], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -597,7 +661,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 5], - span: [31, 2, 8], + span: [32, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -605,7 +669,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 1], - span: [31, 9, 13], + span: ~c" \t\r", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -613,7 +677,23 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 3], - span: [31, 16, 17], + span: [32, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 8], + span: [32, 18, 69], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 8, 9999], + span: [32, 19, 68], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -621,7 +701,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1], - span: [35, 0, 40, 1], + span: [36, 0, 41, 1], leading_comments: " HelloRequestFrom!\n", trailing_comments: nil, leading_detached_comments: [], @@ -629,7 +709,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 1], - span: [35, 8, 24], + span: [36, 8, 24], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -637,7 +717,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0], - span: [37, 2, 18], + span: [38, 2, 70], leading_comments: " Name!\n", trailing_comments: nil, leading_detached_comments: [], @@ -645,7 +725,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 5], - span: [37, 2, 8], + span: [38, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -653,7 +733,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 1], - span: ~c"%\t\r", + span: ~c"&\t\r", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -661,7 +741,23 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 3], - span: [37, 16, 17], + span: [38, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 8], + span: [38, 18, 69], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 8, 9999], + span: [38, 19, 68], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -669,7 +765,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1], - span: [39, 2, 18], + span: [40, 2, 18], leading_comments: " From!\n", trailing_comments: nil, leading_detached_comments: [], @@ -677,7 +773,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1, 5], - span: [39, 2, 8], + span: [40, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -685,7 +781,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1, 1], - span: ~c"'\t\r", + span: ~c"(\t\r", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -693,7 +789,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 1, 3], - span: [39, 16, 17], + span: [40, 16, 17], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -701,7 +797,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2], - span: [43, 0, 46, 1], + span: [44, 0, 47, 1], leading_comments: " The response message containing the greetings\n", trailing_comments: nil, leading_detached_comments: [], @@ -709,7 +805,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 1], - span: [43, 8, 18], + span: [44, 8, 18], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -717,7 +813,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 0], - span: [44, 2, 21], + span: [45, 2, 21], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -725,7 +821,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 0, 5], - span: [44, 2, 8], + span: [45, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -733,7 +829,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 0, 1], - span: [44, 9, 16], + span: [45, 9, 16], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -741,7 +837,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 0, 3], - span: [44, 19, 20], + span: [45, 19, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -749,7 +845,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1], - span: [45, 2, 38], + span: [46, 2, 38], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -757,7 +853,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1, 6], - span: [45, 2, 27], + span: [46, 2, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -765,7 +861,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1, 1], - span: [45, 28, 33], + span: [46, 28, 33], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -773,7 +869,7 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 2, 2, 1, 3], - span: ~c"-$%", + span: ~c".$%", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -863,9 +959,15 @@ defmodule Sidecar.GRPC.ProxyEndpoint do intercept(GRPC.Server.Interceptors.Logger) services = [ - Helloworld.GreeterService.Service + Helloworld.GreeterService.ActorDispatcher ] + services = + [ + Sidecar.GRPC.Reflection.Server.V1, + Sidecar.GRPC.Reflection.Server.V1Alpha + ] ++ services + run(services) end @@ -905,9 +1007,20 @@ end defmodule Sidecar.GRPC.Reflection.Server do @moduledoc since: "1.2.1" - use GrpcReflection.Server, - version: :v1, - services: [ - Helloworld.GreeterService.Service - ] + + defmodule V1 do + use GrpcReflection.Server, + version: :v1, + services: [ + Helloworld.GreeterService.Service + ] + end + + defmodule V1Alpha do + use GrpcReflection.Server, + version: :v1alpha, + services: [ + Helloworld.GreeterService.Service + ] + end end \ No newline at end of file From d07faeab36889d05903e4ffaaf71dc949d95bf3c Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 3 Jun 2024 18:32:57 -0300 Subject: [PATCH 30/48] Create new ping-pong test contract --- lib/sidecar/grpc/dispatcher.ex | 2 +- priv/protos/helloworld.proto | 48 - .../{helloworld.pb.ex => pinger.pb.ex} | 484 ++++--- priv/protos/pinger.proto | 46 + .../priv/protos/example.proto | 24 +- .../priv/protos/google/api/annotations.proto | 31 + .../priv/protos/google/api/http.proto | 375 +++++ .../priv/protos/google/protobuf/any.proto | 158 +++ .../priv/protos/google/protobuf/api.proto | 207 +++ .../protos/google/protobuf/descriptor.proto | 1223 +++++++++++++++++ .../protos/google/protobuf/duration.proto | 115 ++ .../priv/protos/google/protobuf/empty.proto | 51 + .../protos/google/protobuf/field_mask.proto | 245 ++++ .../google/protobuf/source_context.proto | 48 + .../priv/protos/google/protobuf/struct.proto | 95 ++ .../protos/google/protobuf/timestamp.proto | 144 ++ .../priv/protos/google/protobuf/type.proto | 193 +++ .../protos/google/protobuf/wrappers.proto | 123 ++ 18 files changed, 3305 insertions(+), 307 deletions(-) delete mode 100644 priv/protos/helloworld.proto rename priv/protos/modules/{helloworld.pb.ex => pinger.pb.ex} (79%) create mode 100644 priv/protos/pinger.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/api/annotations.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/api/http.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/any.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/api.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/descriptor.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/duration.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/empty.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/field_mask.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/source_context.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/struct.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/timestamp.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/type.proto create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/wrappers.proto diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 9f24908b..9c2b3714 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -81,7 +81,7 @@ defmodule Sidecar.GRPC.Dispatcher do descriptor: _descriptor } = request ) do - Logger.debug( + Logger.info( "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" ) diff --git a/priv/protos/helloworld.proto b/priv/protos/helloworld.proto deleted file mode 100644 index cf94c447..00000000 --- a/priv/protos/helloworld.proto +++ /dev/null @@ -1,48 +0,0 @@ -syntax = "proto3"; - -option java_multiple_files = true; -option java_package = "io.grpc.examples.helloworld"; -option java_outer_classname = "HelloWorldProto"; -option objc_class_prefix = "HLW"; - -import "google/api/annotations.proto"; -import "google/protobuf/timestamp.proto"; -import "eigr/functions/protocol/actors/extensions.proto"; - -package helloworld; - -// The greeting service definition. -service GreeterService { - // Sends a greeting - rpc SayHello (HelloRequest) returns (HelloReply) { - option (google.api.http) = { - get: "/v1/greeter/{name}" - }; - } - - rpc SayHelloFrom (HelloRequestFrom) returns (HelloReply) { - option (google.api.http) = { - post: "/v1/greeter" - body: "*" - }; - } -} - -// The request message containing the user's name. -message HelloRequest { - string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; -} - -// HelloRequestFrom! -message HelloRequestFrom { - // Name! - string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; - // From! - string from = 2; -} - -// The response message containing the greetings -message HelloReply { - string message = 1; - google.protobuf.Timestamp today = 2; -} diff --git a/priv/protos/modules/helloworld.pb.ex b/priv/protos/modules/pinger.pb.ex similarity index 79% rename from priv/protos/modules/helloworld.pb.ex rename to priv/protos/modules/pinger.pb.ex index e9bf5bb0..edeae250 100644 --- a/priv/protos/modules/helloworld.pb.ex +++ b/priv/protos/modules/pinger.pb.ex @@ -1,35 +1,51 @@ -defmodule Helloworld.HelloRequest do +defmodule Pinger.PingPongState do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "HelloRequest", + name: "PingPongState", field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "name", + name: "actual_name", extendee: nil, number: 1, label: :LABEL_OPTIONAL, type: :TYPE_STRING, type_name: nil, default_value: nil, - options: %Google.Protobuf.FieldOptions{ - ctype: :STRING, - packed: nil, - deprecated: false, - lazy: false, - jstype: :JS_NORMAL, - weak: false, - unverified_lazy: false, - debug_redact: false, - uninterpreted_option: [], - __pb_extensions__: %{{Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true}, - __unknown_fields__: [] - }, + options: nil, oneof_index: nil, - json_name: "name", + json_name: "actualName", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "previous_name", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "previousName", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "updated_at", + extendee: nil, + number: 3, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "updatedAt", proto3_optional: nil, __unknown_fields__: [] } @@ -46,17 +62,19 @@ defmodule Helloworld.HelloRequest do } end - field :name, 1, type: :string, deprecated: false + field :actual_name, 1, type: :string, json_name: "actualName" + field :previous_name, 2, type: :string, json_name: "previousName" + field :updated_at, 3, type: Google.Protobuf.Timestamp, json_name: "updatedAt" end -defmodule Helloworld.HelloRequestFrom do +defmodule Pinger.PingRequest do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "HelloRequestFrom", + name: "PingRequest", field: [ %Google.Protobuf.FieldDescriptorProto{ name: "name", @@ -83,20 +101,6 @@ defmodule Helloworld.HelloRequestFrom do json_name: "name", proto3_optional: nil, __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "from", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "from", - proto3_optional: nil, - __unknown_fields__: [] } ], nested_type: [], @@ -112,17 +116,16 @@ defmodule Helloworld.HelloRequestFrom do end field :name, 1, type: :string, deprecated: false - field :from, 2, type: :string end -defmodule Helloworld.HelloReply do +defmodule Pinger.PongReply do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "HelloReply", + name: "PongReply", field: [ %Google.Protobuf.FieldDescriptorProto{ name: "message", @@ -169,49 +172,64 @@ defmodule Helloworld.HelloReply do field :today, 2, type: Google.Protobuf.Timestamp end -defmodule Helloworld.GreeterService.Service do +defmodule Pinger.PingPongActor.Service do @moduledoc false - use GRPC.Service, name: "helloworld.GreeterService", protoc_gen_elixir_version: "0.12.0" + use GRPC.Service, name: "pinger.PingPongActor", protoc_gen_elixir_version: "0.12.0" def descriptor do # credo:disable-for-next-line %Google.Protobuf.FileDescriptorProto{ - name: "helloworld.proto", - package: "helloworld", + name: "pinger.proto", + package: "pinger", dependency: [ "google/api/annotations.proto", + "google/protobuf/empty.proto", "google/protobuf/timestamp.proto", "eigr/functions/protocol/actors/extensions.proto" ], message_type: [ %Google.Protobuf.DescriptorProto{ - name: "HelloRequest", + name: "PingPongState", field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "name", + name: "actual_name", extendee: nil, number: 1, label: :LABEL_OPTIONAL, type: :TYPE_STRING, type_name: nil, default_value: nil, - options: %Google.Protobuf.FieldOptions{ - ctype: :STRING, - packed: nil, - deprecated: false, - lazy: false, - jstype: :JS_NORMAL, - weak: false, - unverified_lazy: false, - debug_redact: false, - uninterpreted_option: [], - __pb_extensions__: %{ - {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true - }, - __unknown_fields__: [] - }, + options: nil, oneof_index: nil, - json_name: "name", + json_name: "actualName", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "previous_name", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "previousName", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "updated_at", + extendee: nil, + number: 3, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "updatedAt", proto3_optional: nil, __unknown_fields__: [] } @@ -227,7 +245,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.DescriptorProto{ - name: "HelloRequestFrom", + name: "PingRequest", field: [ %Google.Protobuf.FieldDescriptorProto{ name: "name", @@ -256,20 +274,6 @@ defmodule Helloworld.GreeterService.Service do json_name: "name", proto3_optional: nil, __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "from", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "from", - proto3_optional: nil, - __unknown_fields__: [] } ], nested_type: [], @@ -283,7 +287,7 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.DescriptorProto{ - name: "HelloReply", + name: "PongReply", field: [ %Google.Protobuf.FieldDescriptorProto{ name: "message", @@ -328,12 +332,12 @@ defmodule Helloworld.GreeterService.Service do enum_type: [], service: [ %Google.Protobuf.ServiceDescriptorProto{ - name: "GreeterService", + name: "PingPongActor", method: [ %Google.Protobuf.MethodDescriptorProto{ - name: "SayHello", - input_type: ".helloworld.HelloRequest", - output_type: ".helloworld.HelloReply", + name: "Ping", + input_type: ".pinger.PingRequest", + output_type: ".pinger.PongReply", options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, @@ -341,10 +345,10 @@ defmodule Helloworld.GreeterService.Service do __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ selector: "", - body: "", + body: "*", additional_bindings: [], response_body: "", - pattern: {:get, "/v1/greeter/{name}"}, + pattern: {:post, "/v1/ping/{name}"}, __unknown_fields__: [] } }, @@ -355,9 +359,9 @@ defmodule Helloworld.GreeterService.Service do __unknown_fields__: [] }, %Google.Protobuf.MethodDescriptorProto{ - name: "SayHelloFrom", - input_type: ".helloworld.HelloRequestFrom", - output_type: ".helloworld.HelloReply", + name: "Pong", + input_type: ".google.protobuf.Empty", + output_type: ".pinger.PingPongState", options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, @@ -365,10 +369,10 @@ defmodule Helloworld.GreeterService.Service do __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ selector: "", - body: "*", + body: "", additional_bindings: [], response_body: "", - pattern: {:post, "/v1/greeter"}, + pattern: {:get, "/v1/pong/{name}"}, __unknown_fields__: [] } }, @@ -385,10 +389,10 @@ defmodule Helloworld.GreeterService.Service do ], extension: [], options: %Google.Protobuf.FileOptions{ - java_package: "io.grpc.examples.helloworld", - java_outer_classname: "HelloWorldProto", + java_package: nil, + java_outer_classname: nil, optimize_for: :SPEED, - java_multiple_files: true, + java_multiple_files: false, go_package: nil, cc_generic_services: false, java_generic_services: false, @@ -413,7 +417,7 @@ defmodule Helloworld.GreeterService.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 47, 1], + span: [0, 0, 45, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -429,447 +433,423 @@ defmodule Helloworld.GreeterService.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: ~c"\b", - span: [2, 0, 34], + span: [2, 0, 33], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b\n", - span: [2, 0, 34], + path: ~c"\b$", + span: [2, 0, 33], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b", - span: [3, 0, 52], + path: [3, 0], + span: [4, 0, 38], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [8, 1], - span: [3, 0, 52], + path: [3, 1], + span: [5, 0, 37], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b", - span: [4, 0, 48], + path: [3, 2], + span: [6, 0, 41], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b\b", - span: [4, 0, 48], + path: [3, 3], + span: [7, 0, 57], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b", - span: [5, 0, 33], + path: [2], + span: [9, 0, 15], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b$", - span: [5, 0, 33], - leading_comments: nil, + path: [4, 0], + span: [12, 0, 16, 1], + leading_comments: " The ping-pong state of PingPongActor\n", trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 0], - span: [7, 0, 38], + path: [4, 0, 1], + span: [12, 8, 21], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 1], - span: [8, 0, 41], + path: [4, 0, 2, 0], + span: [13, 2, 25], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 2], - span: [9, 0, 57], + path: [4, 0, 2, 0, 5], + span: [13, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [2], - span: [11, 0, 19], + path: [4, 0, 2, 0, 1], + span: [13, 9, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0], - span: [14, 0, 28, 1], - leading_comments: " The greeting service definition.\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 1], - span: [14, 8, 22], + path: [4, 0, 2, 0, 3], + span: [13, 23, 24], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0], - span: [16, 2, 20, 3], - leading_comments: " Sends a greeting\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 1], - span: [16, 6, 14], + path: [4, 0, 2, 1], + span: [14, 2, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 2], - span: [16, 16, 28], + path: [4, 0, 2, 1, 5], + span: [14, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 3], - span: [16, 39, 49], + path: [4, 0, 2, 1, 1], + span: [14, 9, 22], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 4], - span: [17, 4, 19, 6], + path: [4, 0, 2, 1, 3], + span: [14, 25, 26], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 4, 72_295_728], - span: [17, 4, 19, 6], + path: [4, 0, 2, 2], + span: [15, 2, 43], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1], - span: [22, 2, 27, 3], + path: [4, 0, 2, 2, 6], + span: [15, 2, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 1], - span: [22, 6, 18], + path: [4, 0, 2, 2, 1], + span: [15, 28, 38], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 2], - span: [22, 20, 36], + path: [4, 0, 2, 2, 3], + span: [15, 41, 42], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 3], - span: [22, 47, 57], - leading_comments: nil, + path: [4, 1], + span: [19, 0, 21, 1], + leading_comments: " The request message containing the actor name.\n", trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 4], - span: [23, 4, 26, 6], + path: [4, 1, 1], + span: [19, 8, 19], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 4, 72_295_728], - span: [23, 4, 26, 6], + path: [4, 1, 2, 0], + span: [20, 2, 72], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0], - span: [31, 0, 33, 1], - leading_comments: " The request message containing the user's name.\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 1], - span: [31, 8, 20], + path: [4, 1, 2, 0, 5], + span: [20, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0], - span: [32, 2, 70], + path: [4, 1, 2, 0, 1], + span: [20, 9, 13], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 5], - span: [32, 2, 8], + path: [4, 1, 2, 0, 3], + span: [20, 16, 17], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 1], - span: ~c" \t\r", + path: [4, 1, 2, 0, 8], + span: [20, 18, 71], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 3], - span: [32, 16, 17], + path: [4, 1, 2, 0, 8, 9999], + span: [20, 20, 69], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 8], - span: [32, 18, 69], - leading_comments: nil, + path: [4, 2], + span: [24, 0, 27, 1], + leading_comments: " The response message containing the pong\n", trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 8, 9999], - span: [32, 19, 68], + path: [4, 2, 1], + span: [24, 8, 17], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1], - span: [36, 0, 41, 1], - leading_comments: " HelloRequestFrom!\n", + path: [4, 2, 2, 0], + span: [25, 2, 21], + leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 1], - span: [36, 8, 24], + path: [4, 2, 2, 0, 5], + span: [25, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0], - span: [38, 2, 70], - leading_comments: " Name!\n", + path: [4, 2, 2, 0, 1], + span: [25, 9, 16], + leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 5], - span: [38, 2, 8], + path: [4, 2, 2, 0, 3], + span: [25, 19, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 1], - span: ~c"&\t\r", + path: [4, 2, 2, 1], + span: [26, 2, 38], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 3], - span: [38, 16, 17], + path: [4, 2, 2, 1, 6], + span: [26, 2, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 8], - span: [38, 18, 69], + path: [4, 2, 2, 1, 1], + span: [26, 28, 33], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 8, 9999], - span: [38, 19, 68], + path: [4, 2, 2, 1, 3], + span: [26, 36, 37], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1], - span: [40, 2, 18], - leading_comments: " From!\n", + path: [6, 0], + span: [30, 0, 45, 1], + leading_comments: " The PingPong actor service definition.\n", trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 5], - span: [40, 2, 8], + path: [6, 0, 1], + span: [30, 8, 21], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 1], - span: ~c"(\t\r", + path: [6, 0, 2, 0], + span: [32, 2, 37, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 3], - span: [40, 16, 17], + path: [6, 0, 2, 0, 1], + span: [32, 6, 10], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2], - span: [44, 0, 47, 1], - leading_comments: " The response message containing the greetings\n", + path: [6, 0, 2, 0, 2], + span: [32, 11, 22], + leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 1], - span: [44, 8, 18], + path: [6, 0, 2, 0, 3], + span: ~c" !*", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0], - span: [45, 2, 21], + path: [6, 0, 2, 0, 4], + span: [33, 4, 36, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 5], - span: [45, 2, 8], + path: [6, 0, 2, 0, 4, 72_295_728], + span: [33, 4, 36, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 1], - span: [45, 9, 16], - leading_comments: nil, + path: [6, 0, 2, 1], + span: [40, 2, 44, 3], + leading_comments: " Get Pong Message\n", trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 3], - span: [45, 19, 20], + path: [6, 0, 2, 1, 1], + span: [40, 6, 10], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1], - span: [46, 2, 38], + path: [6, 0, 2, 1, 2], + span: ~c"(\v ", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 6], - span: [46, 2, 27], + path: [6, 0, 2, 1, 3], + span: ~c"(+8", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 1], - span: [46, 28, 33], + path: [6, 0, 2, 1, 4], + span: [41, 4, 43, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 3], - span: ~c".$%", + path: [6, 0, 2, 1, 4, 72_295_728], + span: [41, 4, 43, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -886,66 +866,64 @@ defmodule Helloworld.GreeterService.Service do } end - rpc(:SayHello, Helloworld.HelloRequest, Helloworld.HelloReply, %{ + rpc(:Ping, Pinger.PingRequest, Pinger.PongReply, %{ http: %{ type: Google.Api.PbExtension, value: %Google.Api.HttpRule{ selector: "", - body: "", + body: "*", additional_bindings: [], response_body: "", - pattern: {:get, "/v1/greeter/{name}"}, + pattern: {:post, "/v1/ping/{name}"}, __unknown_fields__: [] } } }) - rpc(:SayHelloFrom, Helloworld.HelloRequestFrom, Helloworld.HelloReply, %{ + rpc(:Pong, Google.Protobuf.Empty, Pinger.PingPongState, %{ http: %{ type: Google.Api.PbExtension, value: %Google.Api.HttpRule{ selector: "", - body: "*", + body: "", additional_bindings: [], response_body: "", - pattern: {:post, "/v1/greeter"}, + pattern: {:get, "/v1/pong/{name}"}, __unknown_fields__: [] } } }) end -defmodule Helloworld.GreeterService.ActorDispatcher do +defmodule Pinger.PingPongActor.ActorDispatcher do @moduledoc since: "1.2.1" - use GRPC.Server, service: Helloworld.GreeterService.Service, http_transcode: true + use GRPC.Server, service: Pinger.PingPongActor.Service, http_transcode: true alias Sidecar.GRPC.Dispatcher - @spec say_hello(Helloworld.HelloRequest.t(), GRPC.Server.Stream.t()) :: - Helloworld.HelloReply.t() - def say_hello(message, stream) do + @spec ping(Pinger.PingRequest.t(), GRPC.Server.Stream.t()) :: Pinger.PongReply.t() + def ping(message, stream) do request = %{ system: "spawn-system", - actor_name: "GreeterService", - action_name: "SayHello", + actor_name: "PingPongActor", + action_name: "Ping", input: message, stream: stream, - descriptor: Helloworld.GreeterService.Service.descriptor() + descriptor: Pinger.PingPongActor.Service.descriptor() } Dispatcher.dispatch(request) end - @spec say_hello_from(Helloworld.HelloRequestFrom.t(), GRPC.Server.Stream.t()) :: - Helloworld.HelloReply.t() - def say_hello_from(message, stream) do + @spec pong(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: Pinger.PingPongState.t() + def pong(message, stream) do request = %{ system: "spawn-system", - actor_name: "GreeterService", - action_name: "SayHelloFrom", + actor_name: "PingPongActor", + action_name: "Pong", input: message, stream: stream, - descriptor: Helloworld.GreeterService.Service.descriptor() + descriptor: Pinger.PingPongActor.Service.descriptor() } Dispatcher.dispatch(request) @@ -959,7 +937,7 @@ defmodule Sidecar.GRPC.ProxyEndpoint do intercept(GRPC.Server.Interceptors.Logger) services = [ - Helloworld.GreeterService.ActorDispatcher + Pinger.PingPongActor.ActorDispatcher ] services = @@ -976,10 +954,10 @@ defmodule Sidecar.GRPC.ServiceResolver do @actors [ { - "GreeterService", + "PingPongActor", %{ - service_name: "Helloworld.GreeterService", - service_module: Helloworld.GreeterService.Service + service_name: "Pinger.PingPongActor", + service_module: Pinger.PingPongActor.Service } } ] @@ -1012,7 +990,7 @@ defmodule Sidecar.GRPC.Reflection.Server do use GrpcReflection.Server, version: :v1, services: [ - Helloworld.GreeterService.Service + Pinger.PingPongActor.Service ] end @@ -1020,7 +998,7 @@ defmodule Sidecar.GRPC.Reflection.Server do use GrpcReflection.Server, version: :v1alpha, services: [ - Helloworld.GreeterService.Service + Pinger.PingPongActor.Service ] end end \ No newline at end of file diff --git a/priv/protos/pinger.proto b/priv/protos/pinger.proto new file mode 100644 index 00000000..6678cf44 --- /dev/null +++ b/priv/protos/pinger.proto @@ -0,0 +1,46 @@ +syntax = "proto3"; + +option objc_class_prefix = "HLW"; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "eigr/functions/protocol/actors/extensions.proto"; + +package pinger; + +// The ping-pong state of PingPongActor +message PingPongState { + string actual_name = 1; + string previous_name = 2; + google.protobuf.Timestamp updated_at = 3; +} + +// The request message containing the actor name. +message PingRequest { + string name = 1 [ (.eigr.functions.protocol.actors.actor_id) = true ]; +} + +// The response message containing the pong +message PongReply { + string message = 1; + google.protobuf.Timestamp today = 2; +} + +// The PingPong actor service definition. +service PingPongActor { + + rpc Ping(PingRequest) returns (PongReply) { + option (google.api.http) = { + post : "/v1/ping/{name}" + body : "*" + }; + } + + // Get Pong Message + rpc Pong(google.protobuf.Empty) returns (PingPongState) { + option (google.api.http) = { + get : "/v1/pong/{name}" + }; + } +} diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto index 9b29fbb5..27d06af5 100644 --- a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto +++ b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto @@ -6,10 +6,24 @@ option java_multiple_files = true; option java_package = "io.eigr.spawn.example"; option java_outer_classname = "ExampleProtos"; -message MyState { - int32 value = 1; -} +import "google/api/annotations.proto"; -message MyBusinessMessage { - int32 value = 1; +message MyState { int32 value = 1; } + +message MyBusinessMessage { int32 value = 1; } + +service PingPongService { + // Sends a greeting + rpc Ping(MyBusinessMessage) returns (MyBusinessMessage) { + option (google.api.http) = { + get : "/v1/ping/{name}" + }; + } + + rpc Sum(MyBusinessMessage) returns (MyBusinessMessage) { + option (google.api.http) = { + post : "/v1/sum/{name}" + body : "*" + }; + } } \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/api/annotations.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/api/annotations.proto new file mode 100644 index 00000000..efdab3db --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/api/annotations.proto @@ -0,0 +1,31 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +import "google/api/http.proto"; +import "google/protobuf/descriptor.proto"; + +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "AnnotationsProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +extend google.protobuf.MethodOptions { + // See `HttpRule`. + HttpRule http = 72295728; +} diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/api/http.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/api/http.proto new file mode 100644 index 00000000..113fa936 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/api/http.proto @@ -0,0 +1,375 @@ +// Copyright 2015 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.api; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; +option java_multiple_files = true; +option java_outer_classname = "HttpProto"; +option java_package = "com.google.api"; +option objc_class_prefix = "GAPI"; + +// Defines the HTTP configuration for an API service. It contains a list of +// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method +// to one or more HTTP REST API methods. +message Http { + // A list of HTTP configuration rules that apply to individual API methods. + // + // **NOTE:** All service configuration rules follow "last one wins" order. + repeated HttpRule rules = 1; + + // When set to true, URL path parameters will be fully URI-decoded except in + // cases of single segment matches in reserved expansion, where "%2F" will be + // left encoded. + // + // The default behavior is to not decode RFC 6570 reserved characters in multi + // segment matches. + bool fully_decode_reserved_expansion = 2; +} + +// # gRPC Transcoding +// +// gRPC Transcoding is a feature for mapping between a gRPC method and one or +// more HTTP REST endpoints. It allows developers to build a single API service +// that supports both gRPC APIs and REST APIs. Many systems, including [Google +// APIs](https://github.com/googleapis/googleapis), +// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC +// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), +// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature +// and use it for large scale production services. +// +// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies +// how different portions of the gRPC request message are mapped to the URL +// path, URL query parameters, and HTTP request body. It also controls how the +// gRPC response message is mapped to the HTTP response body. `HttpRule` is +// typically specified as an `google.api.http` annotation on the gRPC method. +// +// Each mapping specifies a URL path template and an HTTP method. The path +// template may refer to one or more fields in the gRPC request message, as long +// as each field is a non-repeated field with a primitive (non-message) type. +// The path template controls how fields of the request message are mapped to +// the URL path. +// +// Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/{name=messages/*}" +// }; +// } +// } +// message GetMessageRequest { +// string name = 1; // Mapped to URL path. +// } +// message Message { +// string text = 1; // The resource content. +// } +// +// This enables an HTTP REST to gRPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +// +// Any fields in the request message which are not bound by the path template +// automatically become HTTP query parameters if there is no HTTP request body. +// For example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get:"/v1/messages/{message_id}" +// }; +// } +// } +// message GetMessageRequest { +// message SubMessage { +// string subfield = 1; +// } +// string message_id = 1; // Mapped to URL path. +// int64 revision = 2; // Mapped to URL query parameter `revision`. +// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. +// } +// +// This enables a HTTP JSON to RPC mapping as below: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | +// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: +// "foo"))` +// +// Note that fields which are mapped to URL query parameters must have a +// primitive type or a repeated primitive type or a non-repeated message type. +// In the case of a repeated type, the parameter can be repeated in the URL +// as `...?param=A¶m=B`. In the case of a message type, each field of the +// message is mapped to a separate parameter, such as +// `...?foo.a=A&foo.b=B&foo.c=C`. +// +// For HTTP methods that allow a request body, the `body` field +// specifies the mapping. Consider a REST update method on the +// message resource collection: +// +// service Messaging { +// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "message" +// }; +// } +// } +// message UpdateMessageRequest { +// string message_id = 1; // mapped to the URL +// Message message = 2; // mapped to the body +// } +// +// The following HTTP JSON to RPC mapping is enabled, where the +// representation of the JSON in the request body is determined by +// protos JSON encoding: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" message { text: "Hi!" })` +// +// The special name `*` can be used in the body mapping to define that +// every field not bound by the path template should be mapped to the +// request body. This enables the following alternative definition of +// the update method: +// +// service Messaging { +// rpc UpdateMessage(Message) returns (Message) { +// option (google.api.http) = { +// patch: "/v1/messages/{message_id}" +// body: "*" +// }; +// } +// } +// message Message { +// string message_id = 1; +// string text = 2; +// } +// +// +// The following HTTP JSON to RPC mapping is enabled: +// +// HTTP | gRPC +// -----|----- +// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: +// "123456" text: "Hi!")` +// +// Note that when using `*` in the body mapping, it is not possible to +// have HTTP parameters, as all fields not bound by the path end in +// the body. This makes this option more rarely used in practice when +// defining REST APIs. The common usage of `*` is in custom methods +// which don't use the URL at all for transferring data. +// +// It is possible to define multiple HTTP methods for one RPC by using +// the `additional_bindings` option. Example: +// +// service Messaging { +// rpc GetMessage(GetMessageRequest) returns (Message) { +// option (google.api.http) = { +// get: "/v1/messages/{message_id}" +// additional_bindings { +// get: "/v1/users/{user_id}/messages/{message_id}" +// } +// }; +// } +// } +// message GetMessageRequest { +// string message_id = 1; +// string user_id = 2; +// } +// +// This enables the following two alternative HTTP JSON to RPC mappings: +// +// HTTP | gRPC +// -----|----- +// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` +// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: +// "123456")` +// +// ## Rules for HTTP mapping +// +// 1. Leaf request fields (recursive expansion nested messages in the request +// message) are classified into three categories: +// - Fields referred by the path template. They are passed via the URL path. +// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP +// request body. +// - All other fields are passed via the URL query parameters, and the +// parameter name is the field path in the request message. A repeated +// field can be represented as multiple query parameters under the same +// name. +// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields +// are passed via URL path and HTTP request body. +// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all +// fields are passed via URL path and URL query parameters. +// +// ### Path template syntax +// +// Template = "/" Segments [ Verb ] ; +// Segments = Segment { "/" Segment } ; +// Segment = "*" | "**" | LITERAL | Variable ; +// Variable = "{" FieldPath [ "=" Segments ] "}" ; +// FieldPath = IDENT { "." IDENT } ; +// Verb = ":" LITERAL ; +// +// The syntax `*` matches a single URL path segment. The syntax `**` matches +// zero or more URL path segments, which must be the last part of the URL path +// except the `Verb`. +// +// The syntax `Variable` matches part of the URL path as specified by its +// template. A variable template must not contain other variables. If a variable +// matches a single path segment, its template may be omitted, e.g. `{var}` +// is equivalent to `{var=*}`. +// +// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` +// contains any reserved character, such characters should be percent-encoded +// before the matching. +// +// If a variable contains exactly one path segment, such as `"{var}"` or +// `"{var=*}"`, when such a variable is expanded into a URL path on the client +// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The +// server side does the reverse decoding. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{var}`. +// +// If a variable contains multiple path segments, such as `"{var=foo/*}"` +// or `"{var=**}"`, when such a variable is expanded into a URL path on the +// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. +// The server side does the reverse decoding, except "%2F" and "%2f" are left +// unchanged. Such variables show up in the +// [Discovery +// Document](https://developers.google.com/discovery/v1/reference/apis) as +// `{+var}`. +// +// ## Using gRPC API Service Configuration +// +// gRPC API Service Configuration (service config) is a configuration language +// for configuring a gRPC service to become a user-facing product. The +// service config is simply the YAML representation of the `google.api.Service` +// proto message. +// +// As an alternative to annotating your proto file, you can configure gRPC +// transcoding in your service config YAML files. You do this by specifying a +// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same +// effect as the proto annotation. This can be particularly useful if you +// have a proto that is reused in multiple services. Note that any transcoding +// specified in the service config will override any matching transcoding +// configuration in the proto. +// +// Example: +// +// http: +// rules: +// # Selects a gRPC method and applies HttpRule to it. +// - selector: example.v1.Messaging.GetMessage +// get: /v1/messages/{message_id}/{sub.subfield} +// +// ## Special notes +// +// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the +// proto to JSON conversion must follow the [proto3 +// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). +// +// While the single segment variable follows the semantics of +// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String +// Expansion, the multi segment variable **does not** follow RFC 6570 Section +// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion +// does not expand special characters like `?` and `#`, which would lead +// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding +// for multi segment variables. +// +// The path variables **must not** refer to any repeated or mapped field, +// because client libraries are not capable of handling such variable expansion. +// +// The path variables **must not** capture the leading "/" character. The reason +// is that the most common use case "{var}" does not capture the leading "/" +// character. For consistency, all path variables must share the same behavior. +// +// Repeated message fields must not be mapped to URL query parameters, because +// no client library can support such complicated mapping. +// +// If an API needs to use a JSON array for request or response body, it can map +// the request or response body to a repeated field. However, some gRPC +// Transcoding implementations may not support this feature. +message HttpRule { + // Selects a method to which this rule applies. + // + // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. + string selector = 1; + + // Determines the URL pattern is matched by this rules. This pattern can be + // used with any of the {get|put|post|delete|patch} methods. A custom method + // can be defined using the 'custom' field. + oneof pattern { + // Maps to HTTP GET. Used for listing and getting information about + // resources. + string get = 2; + + // Maps to HTTP PUT. Used for replacing a resource. + string put = 3; + + // Maps to HTTP POST. Used for creating a resource or performing an action. + string post = 4; + + // Maps to HTTP DELETE. Used for deleting a resource. + string delete = 5; + + // Maps to HTTP PATCH. Used for updating a resource. + string patch = 6; + + // The custom pattern is used for specifying an HTTP method that is not + // included in the `pattern` field, such as HEAD, or "*" to leave the + // HTTP method unspecified for this rule. The wild-card rule is useful + // for services that provide content to Web (HTML) clients. + CustomHttpPattern custom = 8; + } + + // The name of the request field whose value is mapped to the HTTP request + // body, or `*` for mapping all request fields not captured by the path + // pattern to the HTTP body, or omitted for not having any HTTP request body. + // + // NOTE: the referred field must be present at the top-level of the request + // message type. + string body = 7; + + // Optional. The name of the response field whose value is mapped to the HTTP + // response body. When omitted, the entire response message will be used + // as the HTTP response body. + // + // NOTE: The referred field must be present at the top-level of the response + // message type. + string response_body = 12; + + // Additional HTTP bindings for the selector. Nested bindings must + // not contain an `additional_bindings` field themselves (that is, + // the nesting may only be one level deep). + repeated HttpRule additional_bindings = 11; +} + +// A custom pattern is used for defining custom HTTP verb. +message CustomHttpPattern { + // The name of this custom HTTP verb. + string kind = 1; + + // The path matched by this custom verb. + string path = 2; +} diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/any.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/any.proto new file mode 100644 index 00000000..016ee66d --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/any.proto @@ -0,0 +1,158 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/anypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "AnyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// `Any` contains an arbitrary serialized protocol buffer message along with a +// URL that describes the type of the serialized message. +// +// Protobuf library provides support to pack/unpack Any values in the form +// of utility functions or additional generated methods of the Any type. +// +// Example 1: Pack and unpack a message in C++. +// +// Foo foo = ...; +// Any any; +// any.PackFrom(foo); +// ... +// if (any.UnpackTo(&foo)) { +// ... +// } +// +// Example 2: Pack and unpack a message in Java. +// +// Foo foo = ...; +// Any any = Any.pack(foo); +// ... +// if (any.is(Foo.class)) { +// foo = any.unpack(Foo.class); +// } +// +// Example 3: Pack and unpack a message in Python. +// +// foo = Foo(...) +// any = Any() +// any.Pack(foo) +// ... +// if any.Is(Foo.DESCRIPTOR): +// any.Unpack(foo) +// ... +// +// Example 4: Pack and unpack a message in Go +// +// foo := &pb.Foo{...} +// any, err := anypb.New(foo) +// if err != nil { +// ... +// } +// ... +// foo := &pb.Foo{} +// if err := any.UnmarshalTo(foo); err != nil { +// ... +// } +// +// The pack methods provided by protobuf library will by default use +// 'type.googleapis.com/full.type.name' as the type URL and the unpack +// methods only use the fully qualified type name after the last '/' +// in the type URL, for example "foo.bar.com/x/y.z" will yield type +// name "y.z". +// +// +// JSON +// +// The JSON representation of an `Any` value uses the regular +// representation of the deserialized, embedded message, with an +// additional field `@type` which contains the type URL. Example: +// +// package google.profile; +// message Person { +// string first_name = 1; +// string last_name = 2; +// } +// +// { +// "@type": "type.googleapis.com/google.profile.Person", +// "firstName": , +// "lastName": +// } +// +// If the embedded message type is well-known and has a custom JSON +// representation, that representation will be embedded adding a field +// `value` which holds the custom JSON in addition to the `@type` +// field. Example (for message [google.protobuf.Duration][]): +// +// { +// "@type": "type.googleapis.com/google.protobuf.Duration", +// "value": "1.212s" +// } +// +message Any { + // A URL/resource name that uniquely identifies the type of the serialized + // protocol buffer message. This string must contain at least + // one "/" character. The last segment of the URL's path must represent + // the fully qualified name of the type (as in + // `path/google.protobuf.Duration`). The name should be in a canonical form + // (e.g., leading "." is not accepted). + // + // In practice, teams usually precompile into the binary all types that they + // expect it to use in the context of Any. However, for URLs which use the + // scheme `http`, `https`, or no scheme, one can optionally set up a type + // server that maps type URLs to message definitions as follows: + // + // * If no scheme is provided, `https` is assumed. + // * An HTTP GET on the URL must yield a [google.protobuf.Type][] + // value in binary format, or produce an error. + // * Applications are allowed to cache lookup results based on the + // URL, or have them precompiled into a binary to avoid any + // lookup. Therefore, binary compatibility needs to be preserved + // on changes to types. (Use versioned type names to manage + // breaking changes.) + // + // Note: this functionality is not currently available in the official + // protobuf release, and it is not used for type URLs beginning with + // type.googleapis.com. + // + // Schemes other than `http`, `https` (or the empty scheme) might be + // used with implementation specific semantics. + // + string type_url = 1; + + // Must be a valid serialized protocol buffer of the above specified type. + bytes value = 2; +} \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/api.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/api.proto new file mode 100644 index 00000000..13d287ca --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/api.proto @@ -0,0 +1,207 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/source_context.proto"; +import "google/protobuf/type.proto"; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "ApiProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/apipb"; + +// Api is a light-weight descriptor for an API Interface. +// +// Interfaces are also described as "protocol buffer services" in some contexts, +// such as by the "service" keyword in a .proto file, but they are different +// from API Services, which represent a concrete implementation of an interface +// as opposed to simply a description of methods and bindings. They are also +// sometimes simply referred to as "APIs" in other contexts, such as the name of +// this message itself. See https://cloud.google.com/apis/design/glossary for +// detailed terminology. +message Api { + // The fully qualified name of this interface, including package name + // followed by the interface's simple name. + string name = 1; + + // The methods of this interface, in unspecified order. + repeated Method methods = 2; + + // Any metadata attached to the interface. + repeated Option options = 3; + + // A version string for this interface. If specified, must have the form + // `major-version.minor-version`, as in `1.10`. If the minor version is + // omitted, it defaults to zero. If the entire version field is empty, the + // major version is derived from the package name, as outlined below. If the + // field is not empty, the version in the package name will be verified to be + // consistent with what is provided here. + // + // The versioning schema uses [semantic + // versioning](http://semver.org) where the major version number + // indicates a breaking change and the minor version an additive, + // non-breaking change. Both version numbers are signals to users + // what to expect from different versions, and should be carefully + // chosen based on the product plan. + // + // The major version is also reflected in the package name of the + // interface, which must end in `v`, as in + // `google.feature.v1`. For major versions 0 and 1, the suffix can + // be omitted. Zero major versions must only be used for + // experimental, non-GA interfaces. + // + string version = 4; + + // Source context for the protocol buffer service represented by this + // message. + SourceContext source_context = 5; + + // Included interfaces. See [Mixin][]. + repeated Mixin mixins = 6; + + // The source syntax of the service. + Syntax syntax = 7; +} + +// Method represents a method of an API interface. +message Method { + // The simple name of this method. + string name = 1; + + // A URL of the input message type. + string request_type_url = 2; + + // If true, the request is streamed. + bool request_streaming = 3; + + // The URL of the output message type. + string response_type_url = 4; + + // If true, the response is streamed. + bool response_streaming = 5; + + // Any metadata attached to the method. + repeated Option options = 6; + + // The source syntax of this method. + Syntax syntax = 7; +} + +// Declares an API Interface to be included in this interface. The including +// interface must redeclare all the methods from the included interface, but +// documentation and options are inherited as follows: +// +// - If after comment and whitespace stripping, the documentation +// string of the redeclared method is empty, it will be inherited +// from the original method. +// +// - Each annotation belonging to the service config (http, +// visibility) which is not set in the redeclared method will be +// inherited. +// +// - If an http annotation is inherited, the path pattern will be +// modified as follows. Any version prefix will be replaced by the +// version of the including interface plus the [root][] path if +// specified. +// +// Example of a simple mixin: +// +// package google.acl.v1; +// service AccessControl { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v1/{resource=**}:getAcl"; +// } +// } +// +// package google.storage.v2; +// service Storage { +// rpc GetAcl(GetAclRequest) returns (Acl); +// +// // Get a data record. +// rpc GetData(GetDataRequest) returns (Data) { +// option (google.api.http).get = "/v2/{resource=**}"; +// } +// } +// +// Example of a mixin configuration: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// +// The mixin construct implies that all methods in `AccessControl` are +// also declared with same name and request/response types in +// `Storage`. A documentation generator or annotation processor will +// see the effective `Storage.GetAcl` method after inherting +// documentation and annotations as follows: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/{resource=**}:getAcl"; +// } +// ... +// } +// +// Note how the version in the path pattern changed from `v1` to `v2`. +// +// If the `root` field in the mixin is specified, it should be a +// relative path under which inherited HTTP paths are placed. Example: +// +// apis: +// - name: google.storage.v2.Storage +// mixins: +// - name: google.acl.v1.AccessControl +// root: acls +// +// This implies the following inherited HTTP annotation: +// +// service Storage { +// // Get the underlying ACL object. +// rpc GetAcl(GetAclRequest) returns (Acl) { +// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; +// } +// ... +// } +message Mixin { + // The fully qualified name of the interface which is included. + string name = 1; + + // If non-empty specifies a path under which inherited HTTP paths + // are rooted. + string root = 2; +} \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/descriptor.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/descriptor.proto new file mode 100644 index 00000000..6805b9b4 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/descriptor.proto @@ -0,0 +1,1223 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Author: kenton@google.com (Kenton Varda) +// Based on original Protocol Buffers design by +// Sanjay Ghemawat, Jeff Dean, and others. +// +// The messages in this file describe the definitions found in .proto files. +// A valid .proto file can be translated directly to a FileDescriptorProto +// without any other information (e.g. without reading its imports). + +syntax = "proto2"; + +package google.protobuf; + +option go_package = "google.golang.org/protobuf/types/descriptorpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DescriptorProtos"; +option csharp_namespace = "Google.Protobuf.Reflection"; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// descriptor.proto must be optimized for speed because reflection-based +// algorithms don't work during bootstrapping. +option optimize_for = SPEED; + +// The protocol compiler can output a FileDescriptorSet containing the .proto +// files it parses. +message FileDescriptorSet { + repeated FileDescriptorProto file = 1; +} + +// The full set of known editions. +enum Edition { + // A placeholder for an unknown edition value. + EDITION_UNKNOWN = 0; + + // Legacy syntax "editions". These pre-date editions, but behave much like + // distinct editions. These can't be used to specify the edition of proto + // files, but feature definitions must supply proto2/proto3 defaults for + // backwards compatibility. + EDITION_PROTO2 = 998; + EDITION_PROTO3 = 999; + + // Editions that have been released. The specific values are arbitrary and + // should not be depended on, but they will always be time-ordered for easy + // comparison. + EDITION_2023 = 1000; + EDITION_2024 = 1001; + + // Placeholder editions for testing feature resolution. These should not be + // used or relyed on outside of tests. + EDITION_1_TEST_ONLY = 1; + EDITION_2_TEST_ONLY = 2; + EDITION_99997_TEST_ONLY = 99997; + EDITION_99998_TEST_ONLY = 99998; + EDITION_99999_TEST_ONLY = 99999; + + // Placeholder for specifying unbounded edition support. This should only + // ever be used by plugins that can expect to never require any changes to + // support a new edition. + EDITION_MAX = 0x7FFFFFFF; +} + +// Describes a complete .proto file. +message FileDescriptorProto { + optional string name = 1; // file name, relative to root of source tree + optional string package = 2; // e.g. "foo", "foo.bar", etc. + + // Names of files imported by this file. + repeated string dependency = 3; + // Indexes of the public imported files in the dependency list above. + repeated int32 public_dependency = 10; + // Indexes of the weak imported files in the dependency list. + // For Google-internal migration only. Do not use. + repeated int32 weak_dependency = 11; + + // All top-level definitions in this file. + repeated DescriptorProto message_type = 4; + repeated EnumDescriptorProto enum_type = 5; + repeated ServiceDescriptorProto service = 6; + repeated FieldDescriptorProto extension = 7; + + optional FileOptions options = 8; + + // This field contains optional information about the original source code. + // You may safely remove this entire field without harming runtime + // functionality of the descriptors -- the information is needed only by + // development tools. + optional SourceCodeInfo source_code_info = 9; + + // The syntax of the proto file. + // The supported values are "proto2", "proto3", and "editions". + // + // If `edition` is present, this value must be "editions". + optional string syntax = 12; + + // The edition of the proto file. + optional Edition edition = 14; +} + +// Describes a message type. +message DescriptorProto { + optional string name = 1; + + repeated FieldDescriptorProto field = 2; + repeated FieldDescriptorProto extension = 6; + + repeated DescriptorProto nested_type = 3; + repeated EnumDescriptorProto enum_type = 4; + + message ExtensionRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + + optional ExtensionRangeOptions options = 3; + } + repeated ExtensionRange extension_range = 5; + + repeated OneofDescriptorProto oneof_decl = 8; + + optional MessageOptions options = 7; + + // Range of reserved tag numbers. Reserved tag numbers may not be used by + // fields or extension ranges in the same message. Reserved ranges may + // not overlap. + message ReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Exclusive. + } + repeated ReservedRange reserved_range = 9; + // Reserved field names, which may not be used by fields in the same message. + // A given name may only be reserved once. + repeated string reserved_name = 10; +} + +message ExtensionRangeOptions { + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + message Declaration { + // The extension number declared within the extension range. + optional int32 number = 1; + + // The fully-qualified name of the extension field. There must be a leading + // dot in front of the full name. + optional string full_name = 2; + + // The fully-qualified type name of the extension field. Unlike + // Metadata.type, Declaration.type must have a leading dot for messages + // and enums. + optional string type = 3; + + // If true, indicates that the number is reserved in the extension range, + // and any extension field with the number will fail to compile. Set this + // when a declared extension field is deleted. + optional bool reserved = 5; + + // If true, indicates that the extension must be defined as repeated. + // Otherwise the extension must be defined as optional. + optional bool repeated = 6; + + reserved 4; // removed is_repeated + } + + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. + repeated Declaration declaration = 2 [retention = RETENTION_SOURCE]; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The verification state of the extension range. + enum VerificationState { + // All the extensions of the range must be declared. + DECLARATION = 0; + UNVERIFIED = 1; + } + + // The verification state of the range. + // TODO: flip the default to DECLARATION once all empty ranges + // are marked as UNVERIFIED. + optional VerificationState verification = 3 + [default = UNVERIFIED, retention = RETENTION_SOURCE]; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// Describes a field within a message. +message FieldDescriptorProto { + enum Type { + // 0 is reserved for errors. + // Order is weird for historical reasons. + TYPE_DOUBLE = 1; + TYPE_FLOAT = 2; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + // negative values are likely. + TYPE_INT64 = 3; + TYPE_UINT64 = 4; + // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + // negative values are likely. + TYPE_INT32 = 5; + TYPE_FIXED64 = 6; + TYPE_FIXED32 = 7; + TYPE_BOOL = 8; + TYPE_STRING = 9; + // Tag-delimited aggregate. + // Group type is deprecated and not supported after google.protobuf. However, Proto3 + // implementations should still be able to parse the group wire format and + // treat group fields as unknown fields. In Editions, the group wire format + // can be enabled via the `message_encoding` feature. + TYPE_GROUP = 10; + TYPE_MESSAGE = 11; // Length-delimited aggregate. + + // New in version 2. + TYPE_BYTES = 12; + TYPE_UINT32 = 13; + TYPE_ENUM = 14; + TYPE_SFIXED32 = 15; + TYPE_SFIXED64 = 16; + TYPE_SINT32 = 17; // Uses ZigZag encoding. + TYPE_SINT64 = 18; // Uses ZigZag encoding. + } + + enum Label { + // 0 is reserved for errors + LABEL_OPTIONAL = 1; + LABEL_REPEATED = 3; + // The required label is only allowed in google.protobuf. In proto3 and Editions + // it's explicitly prohibited. In Editions, the `field_presence` feature + // can be used to get this behavior. + LABEL_REQUIRED = 2; + } + + optional string name = 1; + optional int32 number = 3; + optional Label label = 4; + + // If type_name is set, this need not be set. If both this and type_name + // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + optional Type type = 5; + + // For message and enum types, this is the name of the type. If the name + // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + // rules are used to find the type (i.e. first the nested types within this + // message are searched, then within the parent, on up to the root + // namespace). + optional string type_name = 6; + + // For extensions, this is the name of the type being extended. It is + // resolved in the same manner as type_name. + optional string extendee = 2; + + // For numeric types, contains the original text representation of the value. + // For booleans, "true" or "false". + // For strings, contains the default text contents (not escaped in any way). + // For bytes, contains the C escaped value. All bytes >= 128 are escaped. + optional string default_value = 7; + + // If set, gives the index of a oneof in the containing type's oneof_decl + // list. This field is a member of that oneof. + optional int32 oneof_index = 9; + + // JSON name of this field. The value is set by protocol compiler. If the + // user has set a "json_name" option on this field, that option's value + // will be used. Otherwise, it's deduced from the field's name by converting + // it to camelCase. + optional string json_name = 10; + + optional FieldOptions options = 8; + + // If true, this is a proto3 "optional". When a proto3 field is optional, it + // tracks presence regardless of field type. + // + // When proto3_optional is true, this field must belong to a oneof to signal + // to old proto3 clients that presence is tracked for this field. This oneof + // is known as a "synthetic" oneof, and this field must be its sole member + // (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs + // exist in the descriptor only, and do not generate any API. Synthetic oneofs + // must be ordered after all "real" oneofs. + // + // For message fields, proto3_optional doesn't create any semantic change, + // since non-repeated message fields always track presence. However it still + // indicates the semantic detail of whether the user wrote "optional" or not. + // This can be useful for round-tripping the .proto file. For consistency we + // give message fields a synthetic oneof also, even though it is not required + // to track presence. This is especially important because the parser can't + // tell if a field is a message or an enum, so it must always create a + // synthetic oneof. + // + // Proto2 optional fields do not set this flag, because they already indicate + // optional with `LABEL_OPTIONAL`. + optional bool proto3_optional = 17; +} + +// Describes a oneof. +message OneofDescriptorProto { + optional string name = 1; + optional OneofOptions options = 2; +} + +// Describes an enum type. +message EnumDescriptorProto { + optional string name = 1; + + repeated EnumValueDescriptorProto value = 2; + + optional EnumOptions options = 3; + + // Range of reserved numeric values. Reserved values may not be used by + // entries in the same enum. Reserved ranges may not overlap. + // + // Note that this is distinct from DescriptorProto.ReservedRange in that it + // is inclusive such that it can appropriately represent the entire int32 + // domain. + message EnumReservedRange { + optional int32 start = 1; // Inclusive. + optional int32 end = 2; // Inclusive. + } + + // Range of reserved numeric values. Reserved numeric values may not be used + // by enum values in the same enum declaration. Reserved ranges may not + // overlap. + repeated EnumReservedRange reserved_range = 4; + + // Reserved enum value names, which may not be reused. A given name may only + // be reserved once. + repeated string reserved_name = 5; +} + +// Describes a value within an enum. +message EnumValueDescriptorProto { + optional string name = 1; + optional int32 number = 2; + + optional EnumValueOptions options = 3; +} + +// Describes a service. +message ServiceDescriptorProto { + optional string name = 1; + repeated MethodDescriptorProto method = 2; + + optional ServiceOptions options = 3; +} + +// Describes a method of a service. +message MethodDescriptorProto { + optional string name = 1; + + // Input and output type names. These are resolved in the same way as + // FieldDescriptorProto.type_name, but must refer to a message type. + optional string input_type = 2; + optional string output_type = 3; + + optional MethodOptions options = 4; + + // Identifies if client streams multiple client messages + optional bool client_streaming = 5 [default = false]; + // Identifies if server streams multiple server messages + optional bool server_streaming = 6 [default = false]; +} + +// =================================================================== +// Options + +// Each of the definitions above may have "options" attached. These are +// just annotations which may cause code to be generated slightly differently +// or may contain hints for code that manipulates protocol messages. +// +// Clients may define custom options as extensions of the *Options messages. +// These extensions may not yet be known at parsing time, so the parser cannot +// store the values in them. Instead it stores them in a field in the *Options +// message called uninterpreted_option. This field must have the same name +// across all *Options messages. We then use this field to populate the +// extensions when we build a descriptor, at which point all protos have been +// parsed and so all extensions are known. +// +// Extension numbers for custom options may be chosen as follows: +// * For options which will only be used within a single application or +// organization, or for experimental options, use field numbers 50000 +// through 99999. It is up to you to ensure that you do not use the +// same number for multiple options. +// * For options which will be published and used publicly by multiple +// independent entities, e-mail protobuf-global-extension-registry@google.com +// to reserve extension numbers. Simply provide your project name (e.g. +// Objective-C plugin) and your project website (if available) -- there's no +// need to explain how you intend to use them. Usually you only need one +// extension number. You can declare multiple options with only one extension +// number by putting them in a sub-message. See the Custom Options section of +// the docs for examples: +// https://developers.google.com/protocol-buffers/docs/proto#options +// If this turns out to be popular, a web service will be set up +// to automatically assign option numbers. + +message FileOptions { + + // Sets the Java package where classes generated from this .proto will be + // placed. By default, the proto package is used, but this is often + // inappropriate because proto packages do not normally start with backwards + // domain names. + optional string java_package = 1; + + // Controls the name of the wrapper Java class generated for the .proto file. + // That class will always contain the .proto file's getDescriptor() method as + // well as any top-level extensions defined in the .proto file. + // If java_multiple_files is disabled, then all the other classes from the + // .proto file will be nested inside the single wrapper outer class. + optional string java_outer_classname = 8; + + // If enabled, then the Java code generator will generate a separate .java + // file for each top-level message, enum, and service defined in the .proto + // file. Thus, these types will *not* be nested inside the wrapper class + // named by java_outer_classname. However, the wrapper class will still be + // generated to contain the file's getDescriptor() method as well as any + // top-level extensions defined in the file. + optional bool java_multiple_files = 10 [default = false]; + + // This option does nothing. + optional bool java_generate_equals_and_hash = 20 [deprecated=true]; + + // A proto2 file can set this to true to opt in to UTF-8 checking for Java, + // which will throw an exception if invalid UTF-8 is parsed from the wire or + // assigned to a string field. + // + // TODO: clarify exactly what kinds of field types this option + // applies to, and update these docs accordingly. + // + // Proto3 files already perform these checks. Setting the option explicitly to + // false has no effect: it cannot be used to opt proto3 files out of UTF-8 + // checks. + optional bool java_string_check_utf8 = 27 [default = false]; + + // Generated classes can be optimized for speed or code size. + enum OptimizeMode { + SPEED = 1; // Generate complete code for parsing, serialization, + // etc. + CODE_SIZE = 2; // Use ReflectionOps to implement these methods. + LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. + } + optional OptimizeMode optimize_for = 9 [default = SPEED]; + + // Sets the Go package where structs generated from this .proto will be + // placed. If omitted, the Go package will be derived from the following: + // - The basename of the package import path, if provided. + // - Otherwise, the package statement in the .proto file, if present. + // - Otherwise, the basename of the .proto file, without extension. + optional string go_package = 11; + + // Should generic services be generated in each language? "Generic" services + // are not specific to any particular RPC system. They are generated by the + // main code generators in each language (without additional plugins). + // Generic services were the only kind of service generation supported by + // early versions of google.protobuf. + // + // Generic services are now considered deprecated in favor of using plugins + // that generate code specific to your particular RPC system. Therefore, + // these default to false. Old code which depends on generic services should + // explicitly set them to true. + optional bool cc_generic_services = 16 [default = false]; + optional bool java_generic_services = 17 [default = false]; + optional bool py_generic_services = 18 [default = false]; + reserved 42; // removed php_generic_services + + // Is this file deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for everything in the file, or it will be completely ignored; in the very + // least, this is a formalization for deprecating files. + optional bool deprecated = 23 [default = false]; + + // Enables the use of arenas for the proto messages in this file. This applies + // only to generated classes for C++. + optional bool cc_enable_arenas = 31 [default = true]; + + // Sets the objective c class prefix which is prepended to all objective c + // generated classes from this .proto. There is no default. + optional string objc_class_prefix = 36; + + // Namespace for generated classes; defaults to the package. + optional string csharp_namespace = 37; + + // By default Swift generators will take the proto package and CamelCase it + // replacing '.' with underscore and use that to prefix the types/symbols + // defined. When this options is provided, they will use this value instead + // to prefix the types/symbols defined. + optional string swift_prefix = 39; + + // Sets the php class prefix which is prepended to all php generated classes + // from this .proto. Default is empty. + optional string php_class_prefix = 40; + + // Use this option to change the namespace of php generated classes. Default + // is empty. When this option is empty, the package name will be used for + // determining the namespace. + optional string php_namespace = 41; + + // Use this option to change the namespace of php generated metadata classes. + // Default is empty. When this option is empty, the proto file name will be + // used for determining the namespace. + optional string php_metadata_namespace = 44; + + // Use this option to change the package of ruby generated classes. Default + // is empty. When this option is not set, the package name will be used for + // determining the ruby package. + optional string ruby_package = 45; + + // Any features defined in the specific edition. + optional FeatureSet features = 50; + + // The parser stores options it doesn't recognize here. + // See the documentation for the "Options" section above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. + // See the documentation for the "Options" section above. + extensions 1000 to max; + + reserved 38; +} + +message MessageOptions { + // Set true to use the old proto1 MessageSet wire format for extensions. + // This is provided for backwards-compatibility with the MessageSet wire + // format. You should not use this for any other reason: It's less + // efficient, has fewer features, and is more complicated. + // + // The message must be defined exactly as follows: + // message Foo { + // option message_set_wire_format = true; + // extensions 4 to max; + // } + // Note that the message cannot have any defined fields; MessageSets only + // have extensions. + // + // All extensions of your type must be singular messages; e.g. they cannot + // be int32s, enums, or repeated messages. + // + // Because this is an option, the above two restrictions are not enforced by + // the protocol compiler. + optional bool message_set_wire_format = 1 [default = false]; + + // Disables the generation of the standard "descriptor()" accessor, which can + // conflict with a field of the same name. This is meant to make migration + // from proto1 easier; new code should avoid fields named "descriptor". + optional bool no_standard_descriptor_accessor = 2 [default = false]; + + // Is this message deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the message, or it will be completely ignored; in the very least, + // this is a formalization for deprecating messages. + optional bool deprecated = 3 [default = false]; + + reserved 4, 5, 6; + + // Whether the message is an automatically generated map entry type for the + // maps field. + // + // For maps fields: + // map map_field = 1; + // The parsed descriptor looks like: + // message MapFieldEntry { + // option map_entry = true; + // optional KeyType key = 1; + // optional ValueType value = 2; + // } + // repeated MapFieldEntry map_field = 1; + // + // Implementations may choose not to generate the map_entry=true message, but + // use a native map in the target language to hold the keys and values. + // The reflection APIs in such implementations still need to work as + // if the field is a repeated message field. + // + // NOTE: Do not set the option in .proto files. Always use the maps syntax + // instead. The option should only be implicitly set by the proto compiler + // parser. + optional bool map_entry = 7; + + reserved 8; // javalite_serializable + reserved 9; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // + // This should only be used as a temporary measure against broken builds due + // to the change in behavior for JSON field name conflicts. + // + // TODO This is legacy behavior we plan to remove once downstream + // teams have had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true]; + + // Any features defined in the specific edition. + optional FeatureSet features = 12; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message FieldOptions { + // The ctype option instructs the C++ code generator to use a different + // representation of the field than it normally would. See the specific + // options below. This option is only implemented to support use of + // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of + // type "bytes" in the open source release -- sorry, we'll try to include + // other types in a future version! + optional CType ctype = 1 [default = STRING]; + enum CType { + // Default mode. + STRING = 0; + + // The option [ctype=CORD] may be applied to a non-repeated field of type + // "bytes". It indicates that in C++, the data should be stored in a Cord + // instead of a string. For very large strings, this may reduce memory + // fragmentation. It may also allow better performance when parsing from a + // Cord, or when parsing with aliasing enabled, as the parsed Cord may then + // alias the original buffer. + CORD = 1; + + STRING_PIECE = 2; + } + // The packed option can be enabled for repeated primitive fields to enable + // a more efficient representation on the wire. Rather than repeatedly + // writing the tag and type for each element, the entire array is encoded as + // a single length-delimited blob. In proto3, only explicit setting it to + // false will avoid using packed encoding. This option is prohibited in + // Editions, but the `repeated_field_encoding` feature can be used to control + // the behavior. + optional bool packed = 2; + + // The jstype option determines the JavaScript type used for values of the + // field. The option is permitted only for 64 bit integral and fixed types + // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + // is represented as JavaScript string, which avoids loss of precision that + // can happen when a large value is converted to a floating point JavaScript. + // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + // use the JavaScript "number" type. The behavior of the default option + // JS_NORMAL is implementation dependent. + // + // This option is an enum to permit additional types to be added, e.g. + // goog.math.Integer. + optional JSType jstype = 6 [default = JS_NORMAL]; + enum JSType { + // Use the default type. + JS_NORMAL = 0; + + // Use JavaScript strings. + JS_STRING = 1; + + // Use JavaScript numbers. + JS_NUMBER = 2; + } + + // Should this field be parsed lazily? Lazy applies only to message-type + // fields. It means that when the outer message is initially parsed, the + // inner message's contents will not be parsed but instead stored in encoded + // form. The inner message will actually be parsed when it is first accessed. + // + // This is only a hint. Implementations are free to choose whether to use + // eager or lazy parsing regardless of the value of this option. However, + // setting this option true suggests that the protocol author believes that + // using lazy parsing on this field is worth the additional bookkeeping + // overhead typically needed to implement it. + // + // This option does not affect the public interface of any generated code; + // all method signatures remain the same. Furthermore, thread-safety of the + // interface is not affected by this option; const methods remain safe to + // call from multiple threads concurrently, while non-const methods continue + // to require exclusive access. + // + // Note that lazy message fields are still eagerly verified to check + // ill-formed wireformat or missing required fields. Calling IsInitialized() + // on the outer message would fail if the inner message has missing required + // fields. Failed verification would result in parsing failure (except when + // uninitialized messages are acceptable). + optional bool lazy = 5 [default = false]; + + // unverified_lazy does no correctness checks on the byte stream. This should + // only be used where lazy with verification is prohibitive for performance + // reasons. + optional bool unverified_lazy = 15 [default = false]; + + // Is this field deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for accessors, or it will be completely ignored; in the very least, this + // is a formalization for deprecating fields. + optional bool deprecated = 3 [default = false]; + + // For Google-internal migration only. Do not use. + optional bool weak = 10 [default = false]; + + // Indicate that the field value should not be printed out when using debug + // formats, e.g. when the field contains sensitive credentials. + optional bool debug_redact = 16 [default = false]; + + // If set to RETENTION_SOURCE, the option will be omitted from the binary. + // Note: as of January 2023, support for this is in progress and does not yet + // have an effect (b/264593489). + enum OptionRetention { + RETENTION_UNKNOWN = 0; + RETENTION_RUNTIME = 1; + RETENTION_SOURCE = 2; + } + + optional OptionRetention retention = 17; + + // This indicates the types of entities that the field may apply to when used + // as an option. If it is unset, then the field may be freely used as an + // option on any kind of entity. Note: as of January 2023, support for this is + // in progress and does not yet have an effect (b/264593489). + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0; + TARGET_TYPE_FILE = 1; + TARGET_TYPE_EXTENSION_RANGE = 2; + TARGET_TYPE_MESSAGE = 3; + TARGET_TYPE_FIELD = 4; + TARGET_TYPE_ONEOF = 5; + TARGET_TYPE_ENUM = 6; + TARGET_TYPE_ENUM_ENTRY = 7; + TARGET_TYPE_SERVICE = 8; + TARGET_TYPE_METHOD = 9; + } + + repeated OptionTargetType targets = 19; + + message EditionDefault { + optional Edition edition = 3; + optional string value = 2; // Textproto value. + } + repeated EditionDefault edition_defaults = 20; + + // Any features defined in the specific edition. + optional FeatureSet features = 21; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; + + reserved 4; // removed jtype + reserved 18; // reserve target, target_obsolete_do_not_use +} + +message OneofOptions { + // Any features defined in the specific edition. + optional FeatureSet features = 1; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumOptions { + + // Set this option to true to allow mapping different tag names to the same + // value. + optional bool allow_alias = 2; + + // Is this enum deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum, or it will be completely ignored; in the very least, this + // is a formalization for deprecating enums. + optional bool deprecated = 3 [default = false]; + + reserved 5; // javanano_as_lite + + // Enable the legacy handling of JSON field name conflicts. This lowercases + // and strips underscored from the fields before comparison in proto3 only. + // The new behavior takes `json_name` into account and applies to proto2 as + // well. + // TODO Remove this legacy behavior once downstream teams have + // had time to migrate. + optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true]; + + // Any features defined in the specific edition. + optional FeatureSet features = 7; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message EnumValueOptions { + // Is this enum value deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the enum value, or it will be completely ignored; in the very least, + // this is a formalization for deprecating enum values. + optional bool deprecated = 1 [default = false]; + + // Any features defined in the specific edition. + optional FeatureSet features = 2; + + // Indicate that fields annotated with this enum value should not be printed + // out when using debug formats, e.g. when the field contains sensitive + // credentials. + optional bool debug_redact = 3 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message ServiceOptions { + + // Any features defined in the specific edition. + optional FeatureSet features = 34; + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this service deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the service, or it will be completely ignored; in the very least, + // this is a formalization for deprecating services. + optional bool deprecated = 33 [default = false]; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +message MethodOptions { + + // Note: Field numbers 1 through 32 are reserved for Google's internal RPC + // framework. We apologize for hoarding these numbers to ourselves, but + // we were already using them long before we decided to release Protocol + // Buffers. + + // Is this method deprecated? + // Depending on the target platform, this can emit Deprecated annotations + // for the method, or it will be completely ignored; in the very least, + // this is a formalization for deprecating methods. + optional bool deprecated = 33 [default = false]; + + // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + // or neither? HTTP based RPC implementation may choose GET verb for safe + // methods, and PUT verb for idempotent methods instead of the default POST. + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0; + NO_SIDE_EFFECTS = 1; // implies idempotent + IDEMPOTENT = 2; // idempotent, but may have side effects + } + optional IdempotencyLevel idempotency_level = 34 + [default = IDEMPOTENCY_UNKNOWN]; + + // Any features defined in the specific edition. + optional FeatureSet features = 35; + + // The parser stores options it doesn't recognize here. See above. + repeated UninterpretedOption uninterpreted_option = 999; + + // Clients can define custom options in extensions of this message. See above. + extensions 1000 to max; +} + +// A message representing a option the parser does not recognize. This only +// appears in options protos created by the compiler::Parser class. +// DescriptorPool resolves these when building Descriptor objects. Therefore, +// options protos in descriptor objects (e.g. returned by Descriptor::options(), +// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions +// in them. +message UninterpretedOption { + // The name of the uninterpreted option. Each string represents a segment in + // a dot-separated name. is_extension is true iff a segment represents an + // extension (denoted with parentheses in options specs in .proto files). + // E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + // "foo.(bar.baz).moo". + message NamePart { + required string name_part = 1; + required bool is_extension = 2; + } + repeated NamePart name = 2; + + // The value of the uninterpreted option, in whatever type the tokenizer + // identified it as during parsing. Exactly one of these should be set. + optional string identifier_value = 3; + optional uint64 positive_int_value = 4; + optional int64 negative_int_value = 5; + optional double double_value = 6; + optional bytes string_value = 7; + optional string aggregate_value = 8; +} + +// =================================================================== +// Features + +// TODO Enums in C++ gencode (and potentially other languages) are +// not well scoped. This means that each of the feature enums below can clash +// with each other. The short names we've chosen maximize call-site +// readability, but leave us very open to this scenario. A future feature will +// be designed and implemented to handle this, hopefully before we ever hit a +// conflict here. +message FeatureSet { + enum FieldPresence { + FIELD_PRESENCE_UNKNOWN = 0; + EXPLICIT = 1; + IMPLICIT = 2; + LEGACY_REQUIRED = 3; + } + optional FieldPresence field_presence = 1 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "EXPLICIT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "IMPLICIT" }, + edition_defaults = { edition: EDITION_2023, value: "EXPLICIT" } + ]; + + enum EnumType { + ENUM_TYPE_UNKNOWN = 0; + OPEN = 1; + CLOSED = 2; + } + optional EnumType enum_type = 2 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "CLOSED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "OPEN" } + ]; + + enum RepeatedFieldEncoding { + REPEATED_FIELD_ENCODING_UNKNOWN = 0; + PACKED = 1; + EXPANDED = 2; + } + optional RepeatedFieldEncoding repeated_field_encoding = 3 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "EXPANDED" }, + edition_defaults = { edition: EDITION_PROTO3, value: "PACKED" } + ]; + + enum Utf8Validation { + UTF8_VALIDATION_UNKNOWN = 0; + VERIFY = 2; + NONE = 3; + } + optional Utf8Validation utf8_validation = 4 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "NONE" }, + edition_defaults = { edition: EDITION_PROTO3, value: "VERIFY" } + ]; + + enum MessageEncoding { + MESSAGE_ENCODING_UNKNOWN = 0; + LENGTH_PREFIXED = 1; + DELIMITED = 2; + } + optional MessageEncoding message_encoding = 5 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_FIELD, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "LENGTH_PREFIXED" } + ]; + + enum JsonFormat { + JSON_FORMAT_UNKNOWN = 0; + ALLOW = 1; + LEGACY_BEST_EFFORT = 2; + } + optional JsonFormat json_format = 6 [ + retention = RETENTION_RUNTIME, + targets = TARGET_TYPE_MESSAGE, + targets = TARGET_TYPE_ENUM, + targets = TARGET_TYPE_FILE, + edition_defaults = { edition: EDITION_PROTO2, value: "LEGACY_BEST_EFFORT" }, + edition_defaults = { edition: EDITION_PROTO3, value: "ALLOW" } + ]; + + reserved 999; + + extensions 1000; // for Protobuf C++ + extensions 1001; // for Protobuf Java + extensions 1002; // for Protobuf Go + + extensions 9995 to 9999; // For internal testing + extensions 10000; // for https://github.com/bufbuild/protobuf-es +} + +// A compiled specification for the defaults of a set of features. These +// messages are generated from FeatureSet extensions and can be used to seed +// feature resolution. The resolution with this object becomes a simple search +// for the closest matching edition, followed by proto merges. +message FeatureSetDefaults { + // A map from every known edition with a unique set of defaults to its + // defaults. Not all editions may be contained here. For a given edition, + // the defaults at the closest matching edition ordered at or before it should + // be used. This field must be in strict ascending order by edition. + message FeatureSetEditionDefault { + optional Edition edition = 3; + optional FeatureSet features = 2; + } + repeated FeatureSetEditionDefault defaults = 1; + + // The minimum supported edition (inclusive) when this was constructed. + // Editions before this will not have defaults. + optional Edition minimum_edition = 4; + + // The maximum known edition (inclusive) when this was constructed. Editions + // after this will not have reliable defaults. + optional Edition maximum_edition = 5; +} + +// =================================================================== +// Optional source code info + +// Encapsulates information about the original source file from which a +// FileDescriptorProto was generated. +message SourceCodeInfo { + // A Location identifies a piece of source code in a .proto file which + // corresponds to a particular definition. This information is intended + // to be useful to IDEs, code indexers, documentation generators, and similar + // tools. + // + // For example, say we have a file like: + // message Foo { + // optional string foo = 1; + // } + // Let's look at just the field definition: + // optional string foo = 1; + // ^ ^^ ^^ ^ ^^^ + // a bc de f ghi + // We have the following locations: + // span path represents + // [a,i) [ 4, 0, 2, 0 ] The whole field definition. + // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + // + // Notes: + // - A location may refer to a repeated field itself (i.e. not to any + // particular index within it). This is used whenever a set of elements are + // logically enclosed in a single code segment. For example, an entire + // extend block (possibly containing multiple extension definitions) will + // have an outer location whose path refers to the "extensions" repeated + // field without an index. + // - Multiple locations may have the same path. This happens when a single + // logical declaration is spread out across multiple places. The most + // obvious example is the "extend" block again -- there may be multiple + // extend blocks in the same scope, each of which will have the same path. + // - A location's span is not always a subset of its parent's span. For + // example, the "extendee" of an extension declaration appears at the + // beginning of the "extend" block and is shared by all extensions within + // the block. + // - Just because a location's span is a subset of some other location's span + // does not mean that it is a descendant. For example, a "group" defines + // both a type and a field in a single declaration. Thus, the locations + // corresponding to the type and field and their components will overlap. + // - Code which tries to interpret locations should probably be designed to + // ignore those that it doesn't understand, as more types of locations could + // be recorded in the future. + repeated Location location = 1; + message Location { + // Identifies which part of the FileDescriptorProto was defined at this + // location. + // + // Each element is a field number or an index. They form a path from + // the root FileDescriptorProto to the place where the definition appears. + // For example, this path: + // [ 4, 3, 2, 7, 1 ] + // refers to: + // file.message_type(3) // 4, 3 + // .field(7) // 2, 7 + // .name() // 1 + // This is because FileDescriptorProto.message_type has field number 4: + // repeated DescriptorProto message_type = 4; + // and DescriptorProto.field has field number 2: + // repeated FieldDescriptorProto field = 2; + // and FieldDescriptorProto.name has field number 1: + // optional string name = 1; + // + // Thus, the above path gives the location of a field name. If we removed + // the last element: + // [ 4, 3, 2, 7 ] + // this path refers to the whole field declaration (from the beginning + // of the label to the terminating semicolon). + repeated int32 path = 1 [packed = true]; + + // Always has exactly three or four elements: start line, start column, + // end line (optional, otherwise assumed same as start line), end column. + // These are packed into a single field for efficiency. Note that line + // and column numbers are zero-based -- typically you will want to add + // 1 to each before displaying to a user. + repeated int32 span = 2 [packed = true]; + + // If this SourceCodeInfo represents a complete declaration, these are any + // comments appearing before and after the declaration which appear to be + // attached to the declaration. + // + // A series of line comments appearing on consecutive lines, with no other + // tokens appearing on those lines, will be treated as a single comment. + // + // leading_detached_comments will keep paragraphs of comments that appear + // before (but not connected to) the current element. Each paragraph, + // separated by empty lines, will be one comment element in the repeated + // field. + // + // Only the comment content is provided; comment markers (e.g. //) are + // stripped out. For block comments, leading whitespace and an asterisk + // will be stripped from the beginning of each line other than the first. + // Newlines are included in the output. + // + // Examples: + // + // optional int32 foo = 1; // Comment attached to foo. + // // Comment attached to bar. + // optional int32 bar = 2; + // + // optional string baz = 3; + // // Comment attached to baz. + // // Another line attached to baz. + // + // // Comment attached to moo. + // // + // // Another line attached to moo. + // optional double moo = 4; + // + // // Detached comment for corge. This is not leading or trailing comments + // // to moo or corge because there are blank lines separating it from + // // both. + // + // // Detached comment for corge paragraph 2. + // + // optional string corge = 5; + // /* Block comment attached + // * to corge. Leading asterisks + // * will be removed. */ + // /* Block comment attached to + // * grault. */ + // optional int32 grault = 6; + // + // // ignored detached comments. + optional string leading_comments = 3; + optional string trailing_comments = 4; + repeated string leading_detached_comments = 6; + } +} + +// Describes the relationship between generated code and its original source +// file. A GeneratedCodeInfo message is associated with only one generated +// source file, but may contain references to different source .proto files. +message GeneratedCodeInfo { + // An Annotation connects some span of text in generated code to an element + // of its generating .proto file. + repeated Annotation annotation = 1; + message Annotation { + // Identifies the element in the original source .proto file. This field + // is formatted the same as SourceCodeInfo.Location.path. + repeated int32 path = 1 [packed = true]; + + // Identifies the filesystem path to the original source .proto. + optional string source_file = 2; + + // Identifies the starting offset in bytes in the generated code + // that relates to the identified object. + optional int32 begin = 3; + + // Identifies the ending offset in bytes in the generated code that + // relates to the identified object. The end offset should be one past + // the last relevant byte (so the length of the text = end - begin). + optional int32 end = 4; + + // Represents the identified object's effect on the element in the original + // .proto file. + enum Semantic { + // There is no effect or the effect is indescribable. + NONE = 0; + // The element is set or otherwise mutated. + SET = 1; + // An alias to the element is returned. + ALIAS = 2; + } + optional Semantic semantic = 5; + } +} diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/duration.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/duration.proto new file mode 100644 index 00000000..a0d91df0 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/duration.proto @@ -0,0 +1,115 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/durationpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "DurationProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Duration represents a signed, fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". It is related to Timestamp in that the difference between +// two Timestamp values is a Duration and it can be added or subtracted +// from a Timestamp. Range is approximately +-10,000 years. +// +// # Examples +// +// Example 1: Compute Duration from two Timestamps in pseudo code. +// +// Timestamp start = ...; +// Timestamp end = ...; +// Duration duration = ...; +// +// duration.seconds = end.seconds - start.seconds; +// duration.nanos = end.nanos - start.nanos; +// +// if (duration.seconds < 0 && duration.nanos > 0) { +// duration.seconds += 1; +// duration.nanos -= 1000000000; +// } else if (duration.seconds > 0 && duration.nanos < 0) { +// duration.seconds -= 1; +// duration.nanos += 1000000000; +// } +// +// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. +// +// Timestamp start = ...; +// Duration duration = ...; +// Timestamp end = ...; +// +// end.seconds = start.seconds + duration.seconds; +// end.nanos = start.nanos + duration.nanos; +// +// if (end.nanos < 0) { +// end.seconds -= 1; +// end.nanos += 1000000000; +// } else if (end.nanos >= 1000000000) { +// end.seconds += 1; +// end.nanos -= 1000000000; +// } +// +// Example 3: Compute Duration from datetime.timedelta in Python. +// +// td = datetime.timedelta(days=3, minutes=10) +// duration = Duration() +// duration.FromTimedelta(td) +// +// # JSON Mapping +// +// In JSON format, the Duration type is encoded as a string rather than an +// object, where the string ends in the suffix "s" (indicating seconds) and +// is preceded by the number of seconds, with nanoseconds expressed as +// fractional seconds. For example, 3 seconds with 0 nanoseconds should be +// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should +// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 +// microsecond should be expressed in JSON format as "3.000001s". +// +message Duration { + // Signed seconds of the span of time. Must be from -315,576,000,000 + // to +315,576,000,000 inclusive. Note: these bounds are computed from: + // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years + int64 seconds = 1; + + // Signed fractions of a second at nanosecond resolution of the span + // of time. Durations less than one second are represented with a 0 + // `seconds` field and a positive or negative `nanos` field. For durations + // of one second or more, a non-zero value for the `nanos` field must be + // of the same sign as the `seconds` field. Must be from -999,999,999 + // to +999,999,999 inclusive. + int32 nanos = 2; +} diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/empty.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/empty.proto new file mode 100644 index 00000000..22274621 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/empty.proto @@ -0,0 +1,51 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/emptypb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "EmptyProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option cc_enable_arenas = true; + +// A generic empty message that you can re-use to avoid defining duplicated +// empty messages in your APIs. A typical example is to use it as the request +// or the response type of an API method. For instance: +// +// service Foo { +// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); +// } +// +message Empty {} diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/field_mask.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/field_mask.proto new file mode 100644 index 00000000..fbdda56e --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/field_mask.proto @@ -0,0 +1,245 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "FieldMaskProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/fieldmaskpb"; +option cc_enable_arenas = true; + +// `FieldMask` represents a set of symbolic field paths, for example: +// +// paths: "f.a" +// paths: "f.b.d" +// +// Here `f` represents a field in some root message, `a` and `b` +// fields in the message found in `f`, and `d` a field found in the +// message in `f.b`. +// +// Field masks are used to specify a subset of fields that should be +// returned by a get operation or modified by an update operation. +// Field masks also have a custom JSON encoding (see below). +// +// # Field Masks in Projections +// +// When used in the context of a projection, a response message or +// sub-message is filtered by the API to only contain those fields as +// specified in the mask. For example, if the mask in the previous +// example is applied to a response message as follows: +// +// f { +// a : 22 +// b { +// d : 1 +// x : 2 +// } +// y : 13 +// } +// z: 8 +// +// The result will not contain specific values for fields x,y and z +// (their value will be set to the default, and omitted in proto text +// output): +// +// +// f { +// a : 22 +// b { +// d : 1 +// } +// } +// +// A repeated field is not allowed except at the last position of a +// paths string. +// +// If a FieldMask object is not present in a get operation, the +// operation applies to all fields (as if a FieldMask of all fields +// had been specified). +// +// Note that a field mask does not necessarily apply to the +// top-level response message. In case of a REST get operation, the +// field mask applies directly to the response, but in case of a REST +// list operation, the mask instead applies to each individual message +// in the returned resource list. In case of a REST custom method, +// other definitions may be used. Where the mask applies will be +// clearly documented together with its declaration in the API. In +// any case, the effect on the returned resource/resources is required +// behavior for APIs. +// +// # Field Masks in Update Operations +// +// A field mask in update operations specifies which fields of the +// targeted resource are going to be updated. The API is required +// to only change the values of the fields as specified in the mask +// and leave the others untouched. If a resource is passed in to +// describe the updated values, the API ignores the values of all +// fields not covered by the mask. +// +// If a repeated field is specified for an update operation, new values will +// be appended to the existing repeated field in the target resource. Note that +// a repeated field is only allowed in the last position of a `paths` string. +// +// If a sub-message is specified in the last position of the field mask for an +// update operation, then new value will be merged into the existing sub-message +// in the target resource. +// +// For example, given the target message: +// +// f { +// b { +// d: 1 +// x: 2 +// } +// c: [1] +// } +// +// And an update message: +// +// f { +// b { +// d: 10 +// } +// c: [2] +// } +// +// then if the field mask is: +// +// paths: ["f.b", "f.c"] +// +// then the result will be: +// +// f { +// b { +// d: 10 +// x: 2 +// } +// c: [1, 2] +// } +// +// An implementation may provide options to override this default behavior for +// repeated and message fields. +// +// In order to reset a field's value to the default, the field must +// be in the mask and set to the default value in the provided resource. +// Hence, in order to reset all fields of a resource, provide a default +// instance of the resource and set all fields in the mask, or do +// not provide a mask as described below. +// +// If a field mask is not present on update, the operation applies to +// all fields (as if a field mask of all fields has been specified). +// Note that in the presence of schema evolution, this may mean that +// fields the client does not know and has therefore not filled into +// the request will be reset to their default. If this is unwanted +// behavior, a specific service may require a client to always specify +// a field mask, producing an error if not. +// +// As with get operations, the location of the resource which +// describes the updated values in the request message depends on the +// operation kind. In any case, the effect of the field mask is +// required to be honored by the API. +// +// ## Considerations for HTTP REST +// +// The HTTP kind of an update operation which uses a field mask must +// be set to PATCH instead of PUT in order to satisfy HTTP semantics +// (PUT must only be used for full updates). +// +// # JSON Encoding of Field Masks +// +// In JSON, a field mask is encoded as a single string where paths are +// separated by a comma. Fields name in each path are converted +// to/from lower-camel naming conventions. +// +// As an example, consider the following message declarations: +// +// message Profile { +// User user = 1; +// Photo photo = 2; +// } +// message User { +// string display_name = 1; +// string address = 2; +// } +// +// In proto a field mask for `Profile` may look as such: +// +// mask { +// paths: "user.display_name" +// paths: "photo" +// } +// +// In JSON, the same mask is represented as below: +// +// { +// mask: "user.displayName,photo" +// } +// +// # Field Masks and Oneof Fields +// +// Field masks treat fields in oneofs just as regular fields. Consider the +// following message: +// +// message SampleMessage { +// oneof test_oneof { +// string name = 4; +// SubMessage sub_message = 9; +// } +// } +// +// The field mask can be: +// +// mask { +// paths: "name" +// } +// +// Or: +// +// mask { +// paths: "sub_message" +// } +// +// Note that oneof type names ("test_oneof" in this case) cannot be used in +// paths. +// +// ## Field Mask Verification +// +// The implementation of any API method which has a FieldMask type field in the +// request should verify the included field paths, and return an +// `INVALID_ARGUMENT` error if any path is unmappable. +message FieldMask { + // The set of field mask paths. + repeated string paths = 1; +} \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/source_context.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/source_context.proto new file mode 100644 index 00000000..fe5415a4 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/source_context.proto @@ -0,0 +1,48 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option java_package = "com.google.protobuf"; +option java_outer_classname = "SourceContextProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/sourcecontextpb"; + +// `SourceContext` represents information about the source of a +// protobuf element, like the file in which it is defined. +message SourceContext { + // The path-qualified name of the .proto file that contained the associated + // protobuf element. For example: `"google/protobuf/source_context.proto"`. + string file_name = 1; +} \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/struct.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/struct.proto new file mode 100644 index 00000000..e07e3435 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/struct.proto @@ -0,0 +1,95 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/structpb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "StructProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// `Struct` represents a structured data value, consisting of fields +// which map to dynamically typed values. In some languages, `Struct` +// might be supported by a native representation. For example, in +// scripting languages like JS a struct is represented as an +// object. The details of that representation are described together +// with the proto support for the language. +// +// The JSON representation for `Struct` is JSON object. +message Struct { + // Unordered map of dynamically typed values. + map fields = 1; +} + +// `Value` represents a dynamically typed value which can be either +// null, a number, a string, a boolean, a recursive struct value, or a +// list of values. A producer of value is expected to set one of these +// variants. Absence of any variant indicates an error. +// +// The JSON representation for `Value` is JSON value. +message Value { + // The kind of value. + oneof kind { + // Represents a null value. + NullValue null_value = 1; + // Represents a double value. + double number_value = 2; + // Represents a string value. + string string_value = 3; + // Represents a boolean value. + bool bool_value = 4; + // Represents a structured value. + Struct struct_value = 5; + // Represents a repeated `Value`. + ListValue list_value = 6; + } +} + +// `NullValue` is a singleton enumeration to represent the null value for the +// `Value` type union. +// +// The JSON representation for `NullValue` is JSON `null`. +enum NullValue { + // Null value. + NULL_VALUE = 0; +} + +// `ListValue` is a wrapper around a repeated field of values. +// +// The JSON representation for `ListValue` is JSON array. +message ListValue { + // Repeated field of dynamically typed values. + repeated Value values = 1; +} \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/timestamp.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/timestamp.proto new file mode 100644 index 00000000..184a18f8 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/timestamp.proto @@ -0,0 +1,144 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/timestamppb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TimestampProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; + +// A Timestamp represents a point in time independent of any time zone or local +// calendar, encoded as a count of seconds and fractions of seconds at +// nanosecond resolution. The count is relative to an epoch at UTC midnight on +// January 1, 1970, in the proleptic Gregorian calendar which extends the +// Gregorian calendar backwards to year one. +// +// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap +// second table is needed for interpretation, using a [24-hour linear +// smear](https://developers.google.com/time/smear). +// +// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By +// restricting to that range, we ensure that we can convert to and from [RFC +// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings. +// +// # Examples +// +// Example 1: Compute Timestamp from POSIX `time()`. +// +// Timestamp timestamp; +// timestamp.set_seconds(time(NULL)); +// timestamp.set_nanos(0); +// +// Example 2: Compute Timestamp from POSIX `gettimeofday()`. +// +// struct timeval tv; +// gettimeofday(&tv, NULL); +// +// Timestamp timestamp; +// timestamp.set_seconds(tv.tv_sec); +// timestamp.set_nanos(tv.tv_usec * 1000); +// +// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`. +// +// FILETIME ft; +// GetSystemTimeAsFileTime(&ft); +// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime; +// +// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z +// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z. +// Timestamp timestamp; +// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL)); +// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100)); +// +// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`. +// +// long millis = System.currentTimeMillis(); +// +// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) +// .setNanos((int) ((millis % 1000) * 1000000)).build(); +// +// Example 5: Compute Timestamp from Java `Instant.now()`. +// +// Instant now = Instant.now(); +// +// Timestamp timestamp = +// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) +// .setNanos(now.getNano()).build(); +// +// Example 6: Compute Timestamp from current time in Python. +// +// timestamp = Timestamp() +// timestamp.GetCurrentTime() +// +// # JSON Mapping +// +// In JSON format, the Timestamp type is encoded as a string in the +// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the +// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z" +// where {year} is always expressed using four digits while {month}, {day}, +// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional +// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution), +// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone +// is required. A proto3 JSON serializer should always use UTC (as indicated by +// "Z") when printing the Timestamp type and a proto3 JSON parser should be +// able to accept both UTC and other timezones (as indicated by an offset). +// +// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past +// 01:30 UTC on January 15, 2017. +// +// In JavaScript, one can convert a Date object to this format using the +// standard +// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString) +// method. In Python, a standard `datetime.datetime` object can be converted +// to this format using +// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with +// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use +// the Joda Time's [`ISODateTimeFormat.dateTime()`]( +// http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D +// ) to obtain a formatter capable of generating timestamps in this format. +// +message Timestamp { + // Represents seconds of UTC time since Unix epoch + // 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to + // 9999-12-31T23:59:59Z inclusive. + int64 seconds = 1; + + // Non-negative fractions of a second at nanosecond resolution. Negative + // second values with fractions must still have non-negative nanos values + // that count forward in time. Must be from 0 to 999,999,999 + // inclusive. + int32 nanos = 2; +} diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/type.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/type.proto new file mode 100644 index 00000000..ae720d48 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/type.proto @@ -0,0 +1,193 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +syntax = "proto3"; + +package google.protobuf; + +import "google/protobuf/any.proto"; +import "google/protobuf/source_context.proto"; + +option cc_enable_arenas = true; +option java_package = "com.google.protobuf"; +option java_outer_classname = "TypeProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; +option go_package = "google.golang.org/protobuf/types/known/typepb"; + +// A protocol buffer message type. +message Type { + // The fully qualified message name. + string name = 1; + // The list of fields. + repeated Field fields = 2; + // The list of types appearing in `oneof` definitions in this type. + repeated string oneofs = 3; + // The protocol buffer options. + repeated Option options = 4; + // The source context. + SourceContext source_context = 5; + // The source syntax. + Syntax syntax = 6; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 7; +} + +// A single field of a message type. +message Field { + // Basic field types. + enum Kind { + // Field type unknown. + TYPE_UNKNOWN = 0; + // Field type double. + TYPE_DOUBLE = 1; + // Field type float. + TYPE_FLOAT = 2; + // Field type int64. + TYPE_INT64 = 3; + // Field type uint64. + TYPE_UINT64 = 4; + // Field type int32. + TYPE_INT32 = 5; + // Field type fixed64. + TYPE_FIXED64 = 6; + // Field type fixed32. + TYPE_FIXED32 = 7; + // Field type bool. + TYPE_BOOL = 8; + // Field type string. + TYPE_STRING = 9; + // Field type group. Proto2 syntax only, and deprecated. + TYPE_GROUP = 10; + // Field type message. + TYPE_MESSAGE = 11; + // Field type bytes. + TYPE_BYTES = 12; + // Field type uint32. + TYPE_UINT32 = 13; + // Field type enum. + TYPE_ENUM = 14; + // Field type sfixed32. + TYPE_SFIXED32 = 15; + // Field type sfixed64. + TYPE_SFIXED64 = 16; + // Field type sint32. + TYPE_SINT32 = 17; + // Field type sint64. + TYPE_SINT64 = 18; + } + + // Whether a field is optional, required, or repeated. + enum Cardinality { + // For fields with unknown cardinality. + CARDINALITY_UNKNOWN = 0; + // For optional fields. + CARDINALITY_OPTIONAL = 1; + // For required fields. Proto2 syntax only. + CARDINALITY_REQUIRED = 2; + // For repeated fields. + CARDINALITY_REPEATED = 3; + } + + // The field type. + Kind kind = 1; + // The field cardinality. + Cardinality cardinality = 2; + // The field number. + int32 number = 3; + // The field name. + string name = 4; + // The field type URL, without the scheme, for message or enumeration + // types. Example: `"type.googleapis.com/google.protobuf.Timestamp"`. + string type_url = 6; + // The index of the field type in `Type.oneofs`, for message or enumeration + // types. The first type has index 1; zero means the type is not in the list. + int32 oneof_index = 7; + // Whether to use alternative packed wire representation. + bool packed = 8; + // The protocol buffer options. + repeated Option options = 9; + // The field JSON name. + string json_name = 10; + // The string value of the default value of this field. Proto2 syntax only. + string default_value = 11; +} + +// Enum type definition. +message Enum { + // Enum type name. + string name = 1; + // Enum value definitions. + repeated EnumValue enumvalue = 2; + // Protocol buffer options. + repeated Option options = 3; + // The source context. + SourceContext source_context = 4; + // The source syntax. + Syntax syntax = 5; + // The source edition string, only valid when syntax is SYNTAX_EDITIONS. + string edition = 6; +} + +// Enum value definition. +message EnumValue { + // Enum value name. + string name = 1; + // Enum value number. + int32 number = 2; + // Protocol buffer options. + repeated Option options = 3; +} + +// A protocol buffer option, which can be attached to a message, field, +// enumeration, etc. +message Option { + // The option's name. For protobuf built-in options (options defined in + // descriptor.proto), this is the short name. For example, `"map_entry"`. + // For custom options, it should be the fully-qualified name. For example, + // `"google.api.http"`. + string name = 1; + // The option's value packed in an Any message. If the value is a primitive, + // the corresponding wrapper type defined in google/protobuf/wrappers.proto + // should be used. If the value is an enum, it should be stored as an int32 + // value using the google.protobuf.Int32Value type. + Any value = 2; +} + +// The syntax in which a protocol buffer element is defined. +enum Syntax { + // Syntax `proto2`. + SYNTAX_PROTO2 = 0; + // Syntax `proto3`. + SYNTAX_PROTO3 = 1; + // Syntax `editions`. + SYNTAX_EDITIONS = 2; +} \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/wrappers.proto b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/wrappers.proto new file mode 100644 index 00000000..6c4b5ac6 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/google/protobuf/wrappers.proto @@ -0,0 +1,123 @@ +// Protocol Buffers - Google's data interchange format +// Copyright 2008 Google Inc. All rights reserved. +// https://developers.google.com/protocol-buffers/ +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Wrappers for primitive (non-message) types. These types are useful +// for embedding primitives in the `google.protobuf.Any` type and for places +// where we need to distinguish between the absence of a primitive +// typed field and its default value. +// +// These wrappers have no meaningful use within repeated fields as they lack +// the ability to detect presence on individual elements. +// These wrappers have no meaningful use within a map or a oneof since +// individual entries of a map or fields of a oneof can already detect presence. + +syntax = "proto3"; + +package google.protobuf; + +option cc_enable_arenas = true; +option go_package = "google.golang.org/protobuf/types/known/wrapperspb"; +option java_package = "com.google.protobuf"; +option java_outer_classname = "WrappersProto"; +option java_multiple_files = true; +option objc_class_prefix = "GPB"; +option csharp_namespace = "Google.Protobuf.WellKnownTypes"; + +// Wrapper message for `double`. +// +// The JSON representation for `DoubleValue` is JSON number. +message DoubleValue { + // The double value. + double value = 1; +} + +// Wrapper message for `float`. +// +// The JSON representation for `FloatValue` is JSON number. +message FloatValue { + // The float value. + float value = 1; +} + +// Wrapper message for `int64`. +// +// The JSON representation for `Int64Value` is JSON string. +message Int64Value { + // The int64 value. + int64 value = 1; +} + +// Wrapper message for `uint64`. +// +// The JSON representation for `UInt64Value` is JSON string. +message UInt64Value { + // The uint64 value. + uint64 value = 1; +} + +// Wrapper message for `int32`. +// +// The JSON representation for `Int32Value` is JSON number. +message Int32Value { + // The int32 value. + int32 value = 1; +} + +// Wrapper message for `uint32`. +// +// The JSON representation for `UInt32Value` is JSON number. +message UInt32Value { + // The uint32 value. + uint32 value = 1; +} + +// Wrapper message for `bool`. +// +// The JSON representation for `BoolValue` is JSON `true` and `false`. +message BoolValue { + // The bool value. + bool value = 1; +} + +// Wrapper message for `string`. +// +// The JSON representation for `StringValue` is JSON string. +message StringValue { + // The string value. + string value = 1; +} + +// Wrapper message for `bytes`. +// +// The JSON representation for `BytesValue` is JSON string. +message BytesValue { + // The bytes value. + bytes value = 1; +} \ No newline at end of file From 66690828fe619e2d1a1d5c39daa7817eddaa79c4 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Tue, 4 Jun 2024 10:42:43 -0300 Subject: [PATCH 31/48] Added healthcheck proto --- priv/protos/healthcheck.proto | 39 ++ .../{pinger.pb.ex => healthcheck.pb.ex} | 449 +++++++----------- priv/protos/{pinger.proto => pinger.example} | 0 3 files changed, 199 insertions(+), 289 deletions(-) create mode 100644 priv/protos/healthcheck.proto rename priv/protos/modules/{pinger.pb.ex => healthcheck.pb.ex} (69%) rename priv/protos/{pinger.proto => pinger.example} (100%) diff --git a/priv/protos/healthcheck.proto b/priv/protos/healthcheck.proto new file mode 100644 index 00000000..c5a4a94d --- /dev/null +++ b/priv/protos/healthcheck.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; + +option objc_class_prefix = "HLW"; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "eigr/functions/protocol/actors/extensions.proto"; + +package eigr.functions.protocol.actors.healthcheck; + +message Status { + string status = 1; + string details = 2; + google.protobuf.Timestamp updated_at = 3; +} + +// The state of HealthCheckActor +message HealthCheckState { + Status status = 1; + repeated Status previous_status = 2; +} + +// The HealthCheck actor service definition. +service HealthCheckActor { + + // Get Pong Message + rpc Liveness(google.protobuf.Empty) returns (HealthCheckState) { + option (google.api.http) = { + get : "/v1/health/liveness" + }; + } + + rpc Readiness(google.protobuf.Empty) returns (HealthCheckState) { + option (google.api.http) = { + get : "/v1/health/readiness" + }; + } +} diff --git a/priv/protos/modules/pinger.pb.ex b/priv/protos/modules/healthcheck.pb.ex similarity index 69% rename from priv/protos/modules/pinger.pb.ex rename to priv/protos/modules/healthcheck.pb.ex index edeae250..73a3ef69 100644 --- a/priv/protos/modules/pinger.pb.ex +++ b/priv/protos/modules/healthcheck.pb.ex @@ -1,14 +1,14 @@ -defmodule Pinger.PingPongState do +defmodule Eigr.Functions.Protocol.Actors.Healthcheck.Status do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "PingPongState", + name: "Status", field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "actual_name", + name: "status", extendee: nil, number: 1, label: :LABEL_OPTIONAL, @@ -17,12 +17,12 @@ defmodule Pinger.PingPongState do default_value: nil, options: nil, oneof_index: nil, - json_name: "actualName", + json_name: "status", proto3_optional: nil, __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - name: "previous_name", + name: "details", extendee: nil, number: 2, label: :LABEL_OPTIONAL, @@ -31,7 +31,7 @@ defmodule Pinger.PingPongState do default_value: nil, options: nil, oneof_index: nil, - json_name: "previousName", + json_name: "details", proto3_optional: nil, __unknown_fields__: [] }, @@ -62,96 +62,45 @@ defmodule Pinger.PingPongState do } end - field :actual_name, 1, type: :string, json_name: "actualName" - field :previous_name, 2, type: :string, json_name: "previousName" + field :status, 1, type: :string + field :details, 2, type: :string field :updated_at, 3, type: Google.Protobuf.Timestamp, json_name: "updatedAt" end -defmodule Pinger.PingRequest do +defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "PingRequest", + name: "HealthCheckState", field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "name", + name: "status", extendee: nil, number: 1, label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: %Google.Protobuf.FieldOptions{ - ctype: :STRING, - packed: nil, - deprecated: false, - lazy: false, - jstype: :JS_NORMAL, - weak: false, - unverified_lazy: false, - debug_redact: false, - uninterpreted_option: [], - __pb_extensions__: %{{Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true}, - __unknown_fields__: [] - }, - oneof_index: nil, - json_name: "name", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - end - - field :name, 1, type: :string, deprecated: false -end - -defmodule Pinger.PongReply do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - name: "PongReply", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "message", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.healthcheck.Status", default_value: nil, options: nil, oneof_index: nil, - json_name: "message", + json_name: "status", proto3_optional: nil, __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - name: "today", + name: "previous_status", extendee: nil, number: 2, - label: :LABEL_OPTIONAL, + label: :LABEL_REPEATED, type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp", + type_name: ".eigr.functions.protocol.actors.healthcheck.Status", default_value: nil, options: nil, oneof_index: nil, - json_name: "today", + json_name: "previousStatus", proto3_optional: nil, __unknown_fields__: [] } @@ -168,19 +117,25 @@ defmodule Pinger.PongReply do } end - field :message, 1, type: :string - field :today, 2, type: Google.Protobuf.Timestamp + field :status, 1, type: Eigr.Functions.Protocol.Actors.Healthcheck.Status + + field :previous_status, 2, + repeated: true, + type: Eigr.Functions.Protocol.Actors.Healthcheck.Status, + json_name: "previousStatus" end -defmodule Pinger.PingPongActor.Service do +defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do @moduledoc false - use GRPC.Service, name: "pinger.PingPongActor", protoc_gen_elixir_version: "0.12.0" + use GRPC.Service, + name: "eigr.functions.protocol.actors.healthcheck.HealthCheckActor", + protoc_gen_elixir_version: "0.12.0" def descriptor do # credo:disable-for-next-line %Google.Protobuf.FileDescriptorProto{ - name: "pinger.proto", - package: "pinger", + name: "healthcheck.proto", + package: "eigr.functions.protocol.actors.healthcheck", dependency: [ "google/api/annotations.proto", "google/protobuf/empty.proto", @@ -189,10 +144,10 @@ defmodule Pinger.PingPongActor.Service do ], message_type: [ %Google.Protobuf.DescriptorProto{ - name: "PingPongState", + name: "Status", field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "actual_name", + name: "status", extendee: nil, number: 1, label: :LABEL_OPTIONAL, @@ -201,12 +156,12 @@ defmodule Pinger.PingPongActor.Service do default_value: nil, options: nil, oneof_index: nil, - json_name: "actualName", + json_name: "status", proto3_optional: nil, __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - name: "previous_name", + name: "details", extendee: nil, number: 2, label: :LABEL_OPTIONAL, @@ -215,7 +170,7 @@ defmodule Pinger.PingPongActor.Service do default_value: nil, options: nil, oneof_index: nil, - json_name: "previousName", + json_name: "details", proto3_optional: nil, __unknown_fields__: [] }, @@ -245,75 +200,33 @@ defmodule Pinger.PingPongActor.Service do __unknown_fields__: [] }, %Google.Protobuf.DescriptorProto{ - name: "PingRequest", + name: "HealthCheckState", field: [ %Google.Protobuf.FieldDescriptorProto{ - name: "name", + name: "status", extendee: nil, number: 1, label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: %Google.Protobuf.FieldOptions{ - ctype: :STRING, - packed: nil, - deprecated: false, - lazy: false, - jstype: :JS_NORMAL, - weak: false, - unverified_lazy: false, - debug_redact: false, - uninterpreted_option: [], - __pb_extensions__: %{ - {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true - }, - __unknown_fields__: [] - }, - oneof_index: nil, - json_name: "name", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - }, - %Google.Protobuf.DescriptorProto{ - name: "PongReply", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "message", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.healthcheck.Status", default_value: nil, options: nil, oneof_index: nil, - json_name: "message", + json_name: "status", proto3_optional: nil, __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - name: "today", + name: "previous_status", extendee: nil, number: 2, - label: :LABEL_OPTIONAL, + label: :LABEL_REPEATED, type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp", + type_name: ".eigr.functions.protocol.actors.healthcheck.Status", default_value: nil, options: nil, oneof_index: nil, - json_name: "today", + json_name: "previousStatus", proto3_optional: nil, __unknown_fields__: [] } @@ -332,12 +245,12 @@ defmodule Pinger.PingPongActor.Service do enum_type: [], service: [ %Google.Protobuf.ServiceDescriptorProto{ - name: "PingPongActor", + name: "HealthCheckActor", method: [ %Google.Protobuf.MethodDescriptorProto{ - name: "Ping", - input_type: ".pinger.PingRequest", - output_type: ".pinger.PongReply", + name: "Liveness", + input_type: ".google.protobuf.Empty", + output_type: ".eigr.functions.protocol.actors.healthcheck.HealthCheckState", options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, @@ -345,10 +258,10 @@ defmodule Pinger.PingPongActor.Service do __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ selector: "", - body: "*", + body: "", additional_bindings: [], response_body: "", - pattern: {:post, "/v1/ping/{name}"}, + pattern: {:get, "/v1/health/liveness"}, __unknown_fields__: [] } }, @@ -359,9 +272,9 @@ defmodule Pinger.PingPongActor.Service do __unknown_fields__: [] }, %Google.Protobuf.MethodDescriptorProto{ - name: "Pong", + name: "Readiness", input_type: ".google.protobuf.Empty", - output_type: ".pinger.PingPongState", + output_type: ".eigr.functions.protocol.actors.healthcheck.HealthCheckState", options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, @@ -372,7 +285,7 @@ defmodule Pinger.PingPongActor.Service do body: "", additional_bindings: [], response_body: "", - pattern: {:get, "/v1/pong/{name}"}, + pattern: {:get, "/v1/health/readiness"}, __unknown_fields__: [] } }, @@ -417,7 +330,7 @@ defmodule Pinger.PingPongActor.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 45, 1], + span: [0, 0, 38, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -481,7 +394,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [2], - span: [9, 0, 15], + span: [9, 0, 51], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -489,15 +402,15 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0], - span: [12, 0, 16, 1], - leading_comments: " The ping-pong state of PingPongActor\n", + span: [11, 0, 15, 1], + leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 1], - span: [12, 8, 21], + span: [11, 8, 14], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -505,7 +418,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0], - span: [13, 2, 25], + span: [12, 2, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -513,7 +426,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 5], - span: [13, 2, 8], + span: [12, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -521,7 +434,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 1], - span: [13, 9, 20], + span: [12, 9, 15], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -529,7 +442,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 3], - span: [13, 23, 24], + span: [12, 18, 19], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -537,7 +450,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 1], - span: [14, 2, 27], + span: [13, 2, 21], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -545,7 +458,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 1, 5], - span: [14, 2, 8], + span: [13, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -553,7 +466,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 1, 1], - span: [14, 9, 22], + span: [13, 9, 16], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -561,7 +474,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 1, 3], - span: [14, 25, 26], + span: [13, 19, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -569,7 +482,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 2], - span: [15, 2, 43], + span: [14, 2, 43], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -577,7 +490,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 2, 6], - span: [15, 2, 27], + span: [14, 2, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -585,7 +498,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 2, 1], - span: [15, 28, 38], + span: [14, 28, 38], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -593,7 +506,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 2, 3], - span: [15, 41, 42], + span: [14, 41, 42], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -601,15 +514,15 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1], - span: [19, 0, 21, 1], - leading_comments: " The request message containing the actor name.\n", + span: [18, 0, 21, 1], + leading_comments: " The state of HealthCheckActor\n", trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 1], - span: [19, 8, 19], + span: [18, 8, 24], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -617,15 +530,15 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0], - span: [20, 2, 72], + span: [19, 2, 20], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 5], - span: [20, 2, 8], + path: [4, 1, 2, 0, 6], + span: [19, 2, 8], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -633,7 +546,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 1], - span: [20, 9, 13], + span: [19, 9, 15], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -641,103 +554,47 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 3], - span: [20, 16, 17], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 8], - span: [20, 18, 71], + span: [19, 18, 19], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 8, 9999], - span: [20, 20, 69], + path: [4, 1, 2, 1], + span: [20, 2, 38], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2], - span: [24, 0, 27, 1], - leading_comments: " The response message containing the pong\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 1], - span: [24, 8, 17], + path: [4, 1, 2, 1, 4], + span: [20, 2, 10], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0], - span: [25, 2, 21], + path: [4, 1, 2, 1, 6], + span: [20, 11, 17], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 5], - span: [25, 2, 8], + path: [4, 1, 2, 1, 1], + span: [20, 18, 33], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 1], - span: [25, 9, 16], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 3], - span: [25, 19, 20], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1], - span: [26, 2, 38], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 6], - span: [26, 2, 27], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 1], - span: [26, 28, 33], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 3], - span: [26, 36, 37], + path: [4, 1, 2, 1, 3], + span: [20, 36, 37], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -745,15 +602,15 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0], - span: [30, 0, 45, 1], - leading_comments: " The PingPong actor service definition.\n", + span: [24, 0, 38, 1], + leading_comments: " The HealthCheck actor service definition.\n", trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 1], - span: [30, 8, 21], + span: [24, 8, 24], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -761,15 +618,15 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0], - span: [32, 2, 37, 3], - leading_comments: nil, + span: [27, 2, 31, 3], + leading_comments: " Get Pong Message\n", trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 1], - span: [32, 6, 10], + span: [27, 6, 14], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -777,7 +634,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 2], - span: [32, 11, 22], + span: [27, 15, 36], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -785,7 +642,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 3], - span: ~c" !*", + span: ~c"\e/?", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -793,7 +650,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4], - span: [33, 4, 36, 6], + span: [28, 4, 30, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -801,7 +658,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4, 72_295_728], - span: [33, 4, 36, 6], + span: [28, 4, 30, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -809,15 +666,15 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1], - span: [40, 2, 44, 3], - leading_comments: " Get Pong Message\n", + span: [33, 2, 37, 3], + leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 1], - span: [40, 6, 10], + span: [33, 6, 15], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -825,7 +682,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 2], - span: ~c"(\v ", + span: [33, 16, 37], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -833,7 +690,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 3], - span: ~c"(+8", + span: ~c"!0@", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -841,7 +698,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4], - span: [41, 4, 43, 6], + span: [34, 4, 36, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -849,7 +706,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4, 72_295_728], - span: [41, 4, 43, 6], + span: [34, 4, 36, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -866,64 +723,78 @@ defmodule Pinger.PingPongActor.Service do } end - rpc(:Ping, Pinger.PingRequest, Pinger.PongReply, %{ - http: %{ - type: Google.Api.PbExtension, - value: %Google.Api.HttpRule{ - selector: "", - body: "*", - additional_bindings: [], - response_body: "", - pattern: {:post, "/v1/ping/{name}"}, - __unknown_fields__: [] + rpc( + :Liveness, + Google.Protobuf.Empty, + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState, + %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/health/liveness"}, + __unknown_fields__: [] + } } } - }) - - rpc(:Pong, Google.Protobuf.Empty, Pinger.PingPongState, %{ - http: %{ - type: Google.Api.PbExtension, - value: %Google.Api.HttpRule{ - selector: "", - body: "", - additional_bindings: [], - response_body: "", - pattern: {:get, "/v1/pong/{name}"}, - __unknown_fields__: [] + ) + + rpc( + :Readiness, + Google.Protobuf.Empty, + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState, + %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/health/readiness"}, + __unknown_fields__: [] + } } } - }) + ) end -defmodule Pinger.PingPongActor.ActorDispatcher do +defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher do @moduledoc since: "1.2.1" - use GRPC.Server, service: Pinger.PingPongActor.Service, http_transcode: true + use GRPC.Server, + service: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service, + http_transcode: true alias Sidecar.GRPC.Dispatcher - @spec ping(Pinger.PingRequest.t(), GRPC.Server.Stream.t()) :: Pinger.PongReply.t() - def ping(message, stream) do + @spec liveness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState.t() + def liveness(message, stream) do request = %{ system: "spawn-system", - actor_name: "PingPongActor", - action_name: "Ping", + actor_name: "HealthCheckActor", + action_name: "Liveness", input: message, stream: stream, - descriptor: Pinger.PingPongActor.Service.descriptor() + descriptor: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service.descriptor() } Dispatcher.dispatch(request) end - @spec pong(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: Pinger.PingPongState.t() - def pong(message, stream) do + @spec readiness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState.t() + def readiness(message, stream) do request = %{ system: "spawn-system", - actor_name: "PingPongActor", - action_name: "Pong", + actor_name: "HealthCheckActor", + action_name: "Readiness", input: message, stream: stream, - descriptor: Pinger.PingPongActor.Service.descriptor() + descriptor: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service.descriptor() } Dispatcher.dispatch(request) @@ -937,7 +808,7 @@ defmodule Sidecar.GRPC.ProxyEndpoint do intercept(GRPC.Server.Interceptors.Logger) services = [ - Pinger.PingPongActor.ActorDispatcher + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher ] services = @@ -954,10 +825,10 @@ defmodule Sidecar.GRPC.ServiceResolver do @actors [ { - "PingPongActor", + "HealthCheckActor", %{ - service_name: "Pinger.PingPongActor", - service_module: Pinger.PingPongActor.Service + service_name: "Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor", + service_module: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service } } ] @@ -990,7 +861,7 @@ defmodule Sidecar.GRPC.Reflection.Server do use GrpcReflection.Server, version: :v1, services: [ - Pinger.PingPongActor.Service + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service ] end @@ -998,7 +869,7 @@ defmodule Sidecar.GRPC.Reflection.Server do use GrpcReflection.Server, version: :v1alpha, services: [ - Pinger.PingPongActor.Service + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service ] end end \ No newline at end of file diff --git a/priv/protos/pinger.proto b/priv/protos/pinger.example similarity index 100% rename from priv/protos/pinger.proto rename to priv/protos/pinger.example From 5e29f6d0e2c845502992868c7fea5541b6c8a9b7 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Tue, 4 Jun 2024 15:44:25 -0300 Subject: [PATCH 32/48] Compile dependencies and implemented default grpc server for healthcheck --- compile-pb.sh | 10 + lib/sidecar/grpc/dispatcher.ex | 14 +- .../grpc/generators/service_generator.ex | 3 +- .../healthcheck_handler_actordispatcher.ex | 38 + .../functions/protocol/actors/actor.pb.ex | 1179 +++++++++++ .../protocol/actors/extensions.pb.ex | 9 + .../protocol/actors/healthcheck.pb.ex | 125 ++ .../functions/protocol/actors/protocol.pb.ex | 1867 +++++++++++++++++ .../functions/protocol/actors/state.pb.ex | 91 + .../spawn/actors}/healthcheck.pb.ex | 0 lib/spawn/google/protobuf/any.pb.ex | 4 +- lib/spawn/google/protobuf/descriptor.pb.ex | 592 ++++++ lib/spawn/google/protobuf/duration.pb.ex | 53 + lib/spawn/google/protobuf/empty.pb.ex | 21 + lib/spawn/google/protobuf/field_mask.pb.ex | 38 + .../google/protobuf/source_context.pb.ex | 38 + lib/spawn/google/protobuf/struct.pb.ex | 335 +++ lib/spawn/google/protobuf/timestamp.pb.ex | 53 + lib/spawn/google/protobuf/wrappers.pb.ex | 342 +++ .../grpc/reflection/v1alpha/reflection.pb.ex | 69 +- .../protocol/actors}/healthcheck.proto | 2 +- priv/protos/modules/pinger.pb.ex | 1015 +++++++++ priv/protos/{pinger.example => pinger.proto} | 0 23 files changed, 5848 insertions(+), 50 deletions(-) create mode 100644 lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex create mode 100644 lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex create mode 100644 lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex create mode 100644 lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex create mode 100644 lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex create mode 100644 lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex rename {priv/protos/modules => lib/spawn/actors}/healthcheck.pb.ex (100%) create mode 100644 lib/spawn/google/protobuf/descriptor.pb.ex create mode 100644 lib/spawn/google/protobuf/duration.pb.ex create mode 100644 lib/spawn/google/protobuf/empty.pb.ex create mode 100644 lib/spawn/google/protobuf/field_mask.pb.ex create mode 100644 lib/spawn/google/protobuf/source_context.pb.ex create mode 100644 lib/spawn/google/protobuf/struct.pb.ex create mode 100644 lib/spawn/google/protobuf/timestamp.pb.ex create mode 100644 lib/spawn/google/protobuf/wrappers.pb.ex rename priv/protos/{ => eigr/functions/protocol/actors}/healthcheck.proto (99%) create mode 100644 priv/protos/modules/pinger.pb.ex rename priv/protos/{pinger.example => pinger.proto} (100%) diff --git a/compile-pb.sh b/compile-pb.sh index 71e03a94..986a04af 100755 --- a/compile-pb.sh +++ b/compile-pb.sh @@ -7,9 +7,19 @@ set -o pipefail protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib/spawn/grpc --proto_path=priv/protos/grpc/ priv/protos/grpc/reflection/v1alpha/reflection.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/any.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/empty.proto +protoc --elixir_out=./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/descriptor.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/duration.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/timestamp.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/struct.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/source_context.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/field_mask.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/wrappers.proto + protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/extensions.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/actor.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/protocol.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/state.proto +protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/healthcheck.proto #protoc --elixir_out=gen_descriptors=true:./lib/spawn/cloudevents --proto_path=priv/protos/io/cloudevents/v1 priv/protos/io/cloudevents/v1/spec.proto \ No newline at end of file diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 9c2b3714..322f5869 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -162,10 +162,18 @@ defmodule Sidecar.GRPC.Dispatcher do end defp build_actor_id(system_name, actor_name, message) do - {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{} = actor_settings}}} = - ActorRegistry.lookup(%ActorId{system: system_name, name: actor_name}) + with {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{} = actor_settings}}} <- + ActorRegistry.lookup(%ActorId{system: system_name, name: actor_name}) do + build_actor_id_from_settings(system_name, actor_name, actor_settings, message) + else + {:not_found, []} -> + Logger.warning( + "Actor Not Found. The Actor probably does not exist or not implemented or the request params are incorrect!" + ) - build_actor_id_from_settings(system_name, actor_name, actor_settings, message) + raise ArgumentError, + "Actor Not Found. The id of this Actor does not exist!" + end end defp build_actor_id_from_settings( diff --git a/lib/sidecar/grpc/generators/service_generator.ex b/lib/sidecar/grpc/generators/service_generator.ex index ab5093c2..5b753298 100644 --- a/lib/sidecar/grpc/generators/service_generator.ex +++ b/lib/sidecar/grpc/generators/service_generator.ex @@ -28,7 +28,8 @@ defmodule Sidecar.GRPC.Generators.ServiceGenerator do services = [ Sidecar.GRPC.Reflection.Server.V1, - Sidecar.GRPC.Reflection.Server.V1Alpha + Sidecar.GRPC.Reflection.Server.V1Alpha, + Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher ] ++ services run(services) diff --git a/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex b/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex new file mode 100644 index 00000000..c9efdddf --- /dev/null +++ b/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex @@ -0,0 +1,38 @@ +defmodule Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher do + @moduledoc since: "1.2.1" + use GRPC.Server, + service: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service, + http_transcode: true + + alias Sidecar.GRPC.Dispatcher + + @spec liveness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState.t() + def liveness(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "HealthCheckActor", + action_name: "Liveness", + input: message, + stream: stream, + descriptor: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service.descriptor() + } + + Dispatcher.dispatch(request) + end + + @spec readiness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState.t() + def readiness(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "HealthCheckActor", + action_name: "Readiness", + input: message, + stream: stream, + descriptor: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service.descriptor() + } + + Dispatcher.dispatch(request) + end +end diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex new file mode 100644 index 00000000..a6c50b9f --- /dev/null +++ b/lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex @@ -0,0 +1,1179 @@ +defmodule Eigr.Functions.Protocol.Actors.Kind do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.EnumDescriptorProto{ + __unknown_fields__: [], + name: "Kind", + options: nil, + reserved_name: [], + reserved_range: [], + value: [ + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "UNKNOW_KIND", + number: 0, + options: nil + }, + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "NAMED", + number: 1, + options: nil + }, + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "UNNAMED", + number: 2, + options: nil + }, + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "POOLED", + number: 3, + options: nil + }, + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "PROXY", + number: 4, + options: nil + } + ] + } + end + + field :UNKNOW_KIND, 0 + field :NAMED, 1 + field :UNNAMED, 2 + field :POOLED, 3 + field :PROXY, 4 +end +defmodule Eigr.Functions.Protocol.Actors.Registry.ActorsEntry do + @moduledoc false + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor" + } + ], + name: "ActorsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + end + + field :key, 1, type: :string + field :value, 2, type: Eigr.Functions.Protocol.Actors.Actor +end +defmodule Eigr.Functions.Protocol.Actors.Registry do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actors", + label: :LABEL_REPEATED, + name: "actors", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Registry.ActorsEntry" + } + ], + name: "Registry", + nested_type: [ + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor" + } + ], + name: "ActorsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + ], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :actors, 1, + repeated: true, + type: Eigr.Functions.Protocol.Actors.Registry.ActorsEntry, + map: true +end +defmodule Eigr.Functions.Protocol.Actors.ActorSystem do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "name", + label: :LABEL_OPTIONAL, + name: "name", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "registry", + label: :LABEL_OPTIONAL, + name: "registry", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Registry" + } + ], + name: "ActorSystem", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :name, 1, type: :string + field :registry, 2, type: Eigr.Functions.Protocol.Actors.Registry +end +defmodule Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "timeout", + label: :LABEL_OPTIONAL, + name: "timeout", + number: 1, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.TimeoutStrategy" + } + ], + name: "ActorSnapshotStrategy", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "strategy", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :strategy, 0 + + field :timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0 +end +defmodule Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "timeout", + label: :LABEL_OPTIONAL, + name: "timeout", + number: 1, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.TimeoutStrategy" + } + ], + name: "ActorDeactivationStrategy", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "strategy", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :strategy, 0 + + field :timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0 +end +defmodule Eigr.Functions.Protocol.Actors.TimeoutStrategy do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "timeout", + label: :LABEL_OPTIONAL, + name: "timeout", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT64, + type_name: nil + } + ], + name: "TimeoutStrategy", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :timeout, 1, type: :int64 +end +defmodule Eigr.Functions.Protocol.Actors.Action do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "name", + label: :LABEL_OPTIONAL, + name: "name", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "Action", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :name, 1, type: :string +end +defmodule Eigr.Functions.Protocol.Actors.FixedTimerAction do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "seconds", + label: :LABEL_OPTIONAL, + name: "seconds", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "action", + label: :LABEL_OPTIONAL, + name: "action", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Action" + } + ], + name: "FixedTimerAction", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :seconds, 1, type: :int32 + field :action, 2, type: Eigr.Functions.Protocol.Actors.Action +end +defmodule Eigr.Functions.Protocol.Actors.ActorState.TagsEntry do + @moduledoc false + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "TagsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + end + + field :key, 1, type: :string + field :value, 2, type: :string +end +defmodule Eigr.Functions.Protocol.Actors.ActorState do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "tags", + label: :LABEL_REPEATED, + name: "tags", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState.TagsEntry" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "state", + label: :LABEL_OPTIONAL, + name: "state", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" + } + ], + name: "ActorState", + nested_type: [ + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "TagsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + ], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :tags, 1, + repeated: true, + type: Eigr.Functions.Protocol.Actors.ActorState.TagsEntry, + map: true + + field :state, 2, type: Google.Protobuf.Any +end +defmodule Eigr.Functions.Protocol.Actors.Metadata.TagsEntry do + @moduledoc false + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "TagsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + end + + field :key, 1, type: :string + field :value, 2, type: :string +end +defmodule Eigr.Functions.Protocol.Actors.Metadata do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "channelGroup", + label: :LABEL_REPEATED, + name: "channel_group", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Channel" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "tags", + label: :LABEL_REPEATED, + name: "tags", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Metadata.TagsEntry" + } + ], + name: "Metadata", + nested_type: [ + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "TagsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + ], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :channel_group, 1, + repeated: true, + type: Eigr.Functions.Protocol.Actors.Channel, + json_name: "channelGroup" + + field :tags, 2, + repeated: true, + type: Eigr.Functions.Protocol.Actors.Metadata.TagsEntry, + map: true +end +defmodule Eigr.Functions.Protocol.Actors.Channel do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "topic", + label: :LABEL_OPTIONAL, + name: "topic", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "action", + label: :LABEL_OPTIONAL, + name: "action", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "Channel", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :topic, 1, type: :string + field :action, 2, type: :string +end +defmodule Eigr.Functions.Protocol.Actors.ActorSettings do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "kind", + label: :LABEL_OPTIONAL, + name: "kind", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_ENUM, + type_name: ".eigr.functions.protocol.actors.Kind" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "stateful", + label: :LABEL_OPTIONAL, + name: "stateful", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_BOOL, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "snapshotStrategy", + label: :LABEL_OPTIONAL, + name: "snapshot_strategy", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSnapshotStrategy" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "deactivationStrategy", + label: :LABEL_OPTIONAL, + name: "deactivation_strategy", + number: 4, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorDeactivationStrategy" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "minPoolSize", + label: :LABEL_OPTIONAL, + name: "min_pool_size", + number: 5, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "maxPoolSize", + label: :LABEL_OPTIONAL, + name: "max_pool_size", + number: 6, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + } + ], + name: "ActorSettings", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :kind, 1, type: Eigr.Functions.Protocol.Actors.Kind, enum: true + field :stateful, 2, type: :bool + + field :snapshot_strategy, 3, + type: Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy, + json_name: "snapshotStrategy" + + field :deactivation_strategy, 4, + type: Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy, + json_name: "deactivationStrategy" + + field :min_pool_size, 5, type: :int32, json_name: "minPoolSize" + field :max_pool_size, 6, type: :int32, json_name: "maxPoolSize" +end +defmodule Eigr.Functions.Protocol.Actors.ActorId do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "name", + label: :LABEL_OPTIONAL, + name: "name", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "system", + label: :LABEL_OPTIONAL, + name: "system", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "parent", + label: :LABEL_OPTIONAL, + name: "parent", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "ActorId", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :name, 1, type: :string + field :system, 2, type: :string + field :parent, 3, type: :string +end +defmodule Eigr.Functions.Protocol.Actors.Actor do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "id", + label: :LABEL_OPTIONAL, + name: "id", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "state", + label: :LABEL_OPTIONAL, + name: "state", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "metadata", + label: :LABEL_OPTIONAL, + name: "metadata", + number: 6, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Metadata" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "settings", + label: :LABEL_OPTIONAL, + name: "settings", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSettings" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actions", + label: :LABEL_REPEATED, + name: "actions", + number: 4, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Action" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "timerActions", + label: :LABEL_REPEATED, + name: "timer_actions", + number: 5, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.FixedTimerAction" + } + ], + name: "Actor", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :id, 1, type: Eigr.Functions.Protocol.Actors.ActorId + field :state, 2, type: Eigr.Functions.Protocol.Actors.ActorState + field :metadata, 6, type: Eigr.Functions.Protocol.Actors.Metadata + field :settings, 3, type: Eigr.Functions.Protocol.Actors.ActorSettings + field :actions, 4, repeated: true, type: Eigr.Functions.Protocol.Actors.Action + + field :timer_actions, 5, + repeated: true, + type: Eigr.Functions.Protocol.Actors.FixedTimerAction, + json_name: "timerActions" +end diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex new file mode 100644 index 00000000..662f3381 --- /dev/null +++ b/lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex @@ -0,0 +1,9 @@ +defmodule Eigr.Functions.Protocol.Actors.PbExtension do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + extend Google.Protobuf.FieldOptions, :actor_id, 9999, + optional: true, + type: :bool, + json_name: "actorId" +end diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex new file mode 100644 index 00000000..bd087980 --- /dev/null +++ b/lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex @@ -0,0 +1,125 @@ +defmodule Eigr.Functions.Protocol.Actors.Healthcheck.Status do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "status", + label: :LABEL_OPTIONAL, + name: "status", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "details", + label: :LABEL_OPTIONAL, + name: "details", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "updatedAt", + label: :LABEL_OPTIONAL, + name: "updated_at", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp" + } + ], + name: "Status", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :status, 1, type: :string + field :details, 2, type: :string + field :updated_at, 3, type: Google.Protobuf.Timestamp, json_name: "updatedAt" +end +defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "status", + label: :LABEL_OPTIONAL, + name: "status", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.healthcheck.Status" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "previousStatus", + label: :LABEL_REPEATED, + name: "previous_status", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.healthcheck.Status" + } + ], + name: "HealthCheckState", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :status, 1, type: Eigr.Functions.Protocol.Actors.Healthcheck.Status + + field :previous_status, 2, + repeated: true, + type: Eigr.Functions.Protocol.Actors.Healthcheck.Status, + json_name: "previousStatus" +end diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex new file mode 100644 index 00000000..6348af8b --- /dev/null +++ b/lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex @@ -0,0 +1,1867 @@ +defmodule Eigr.Functions.Protocol.Status do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.EnumDescriptorProto{ + __unknown_fields__: [], + name: "Status", + options: nil, + reserved_name: [], + reserved_range: [], + value: [ + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "UNKNOWN", + number: 0, + options: nil + }, + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "OK", + number: 1, + options: nil + }, + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "ACTOR_NOT_FOUND", + number: 2, + options: nil + }, + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "ERROR", + number: 3, + options: nil + } + ] + } + end + + field :UNKNOWN, 0 + field :OK, 1 + field :ACTOR_NOT_FOUND, 2 + field :ERROR, 3 +end +defmodule Eigr.Functions.Protocol.Context.MetadataEntry do + @moduledoc false + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "MetadataEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + end + + field :key, 1, type: :string + field :value, 2, type: :string +end +defmodule Eigr.Functions.Protocol.Context.TagsEntry do + @moduledoc false + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "TagsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + end + + field :key, 1, type: :string + field :value, 2, type: :string +end +defmodule Eigr.Functions.Protocol.Context do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "state", + label: :LABEL_OPTIONAL, + name: "state", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "metadata", + label: :LABEL_REPEATED, + name: "metadata", + number: 4, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context.MetadataEntry" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "tags", + label: :LABEL_REPEATED, + name: "tags", + number: 5, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context.TagsEntry" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "caller", + label: :LABEL_OPTIONAL, + name: "caller", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "self", + label: :LABEL_OPTIONAL, + name: "self", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" + } + ], + name: "Context", + nested_type: [ + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "MetadataEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + }, + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "TagsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + ], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :state, 1, type: Google.Protobuf.Any + + field :metadata, 4, + repeated: true, + type: Eigr.Functions.Protocol.Context.MetadataEntry, + map: true + + field :tags, 5, repeated: true, type: Eigr.Functions.Protocol.Context.TagsEntry, map: true + field :caller, 2, type: Eigr.Functions.Protocol.Actors.ActorId + field :self, 3, type: Eigr.Functions.Protocol.Actors.ActorId +end +defmodule Eigr.Functions.Protocol.Noop do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [], + name: "Noop", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end +end +defmodule Eigr.Functions.Protocol.JSONType do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "content", + label: :LABEL_OPTIONAL, + name: "content", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "JSONType", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :content, 1, type: :string +end +defmodule Eigr.Functions.Protocol.RegistrationRequest do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "serviceInfo", + label: :LABEL_OPTIONAL, + name: "service_info", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.ServiceInfo" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actorSystem", + label: :LABEL_OPTIONAL, + name: "actor_system", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem" + } + ], + name: "RegistrationRequest", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :service_info, 1, type: Eigr.Functions.Protocol.ServiceInfo, json_name: "serviceInfo" + + field :actor_system, 2, + type: Eigr.Functions.Protocol.Actors.ActorSystem, + json_name: "actorSystem" +end +defmodule Eigr.Functions.Protocol.RegistrationResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "status", + label: :LABEL_OPTIONAL, + name: "status", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "proxyInfo", + label: :LABEL_OPTIONAL, + name: "proxy_info", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.ProxyInfo" + } + ], + name: "RegistrationResponse", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :status, 1, type: Eigr.Functions.Protocol.RequestStatus + field :proxy_info, 2, type: Eigr.Functions.Protocol.ProxyInfo, json_name: "proxyInfo" +end +defmodule Eigr.Functions.Protocol.ServiceInfo do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "serviceName", + label: :LABEL_OPTIONAL, + name: "service_name", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "serviceVersion", + label: :LABEL_OPTIONAL, + name: "service_version", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "serviceRuntime", + label: :LABEL_OPTIONAL, + name: "service_runtime", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "supportLibraryName", + label: :LABEL_OPTIONAL, + name: "support_library_name", + number: 4, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "supportLibraryVersion", + label: :LABEL_OPTIONAL, + name: "support_library_version", + number: 5, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "protocolMajorVersion", + label: :LABEL_OPTIONAL, + name: "protocol_major_version", + number: 6, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "protocolMinorVersion", + label: :LABEL_OPTIONAL, + name: "protocol_minor_version", + number: 7, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + } + ], + name: "ServiceInfo", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :service_name, 1, type: :string, json_name: "serviceName" + field :service_version, 2, type: :string, json_name: "serviceVersion" + field :service_runtime, 3, type: :string, json_name: "serviceRuntime" + field :support_library_name, 4, type: :string, json_name: "supportLibraryName" + field :support_library_version, 5, type: :string, json_name: "supportLibraryVersion" + field :protocol_major_version, 6, type: :int32, json_name: "protocolMajorVersion" + field :protocol_minor_version, 7, type: :int32, json_name: "protocolMinorVersion" +end +defmodule Eigr.Functions.Protocol.SpawnRequest do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actors", + label: :LABEL_REPEATED, + name: "actors", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" + } + ], + name: "SpawnRequest", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorId +end +defmodule Eigr.Functions.Protocol.SpawnResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "status", + label: :LABEL_OPTIONAL, + name: "status", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus" + } + ], + name: "SpawnResponse", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :status, 1, type: Eigr.Functions.Protocol.RequestStatus +end +defmodule Eigr.Functions.Protocol.ProxyInfo do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "protocolMajorVersion", + label: :LABEL_OPTIONAL, + name: "protocol_major_version", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "protocolMinorVersion", + label: :LABEL_OPTIONAL, + name: "protocol_minor_version", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "proxyName", + label: :LABEL_OPTIONAL, + name: "proxy_name", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "proxyVersion", + label: :LABEL_OPTIONAL, + name: "proxy_version", + number: 4, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "ProxyInfo", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :protocol_major_version, 1, type: :int32, json_name: "protocolMajorVersion" + field :protocol_minor_version, 2, type: :int32, json_name: "protocolMinorVersion" + field :proxy_name, 3, type: :string, json_name: "proxyName" + field :proxy_version, 4, type: :string, json_name: "proxyVersion" +end +defmodule Eigr.Functions.Protocol.SideEffect do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "request", + label: :LABEL_OPTIONAL, + name: "request", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.InvocationRequest" + } + ], + name: "SideEffect", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :request, 1, type: Eigr.Functions.Protocol.InvocationRequest +end +defmodule Eigr.Functions.Protocol.Broadcast do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "channelGroup", + label: :LABEL_OPTIONAL, + name: "channel_group", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 3, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "noop", + label: :LABEL_OPTIONAL, + name: "noop", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" + } + ], + name: "Broadcast", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "payload", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :payload, 0 + + field :channel_group, 1, type: :string, json_name: "channelGroup" + field :value, 3, type: Google.Protobuf.Any, oneof: 0 + field :noop, 4, type: Eigr.Functions.Protocol.Noop, oneof: 0 +end +defmodule Eigr.Functions.Protocol.Pipe do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actor", + label: :LABEL_OPTIONAL, + name: "actor", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actionName", + label: :LABEL_OPTIONAL, + name: "action_name", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "Pipe", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :actor, 1, type: :string + field :action_name, 2, type: :string, json_name: "actionName" +end +defmodule Eigr.Functions.Protocol.Forward do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actor", + label: :LABEL_OPTIONAL, + name: "actor", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actionName", + label: :LABEL_OPTIONAL, + name: "action_name", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "Forward", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :actor, 1, type: :string + field :action_name, 2, type: :string, json_name: "actionName" +end +defmodule Eigr.Functions.Protocol.Workflow do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "broadcast", + label: :LABEL_OPTIONAL, + name: "broadcast", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Broadcast" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "effects", + label: :LABEL_REPEATED, + name: "effects", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.SideEffect" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "pipe", + label: :LABEL_OPTIONAL, + name: "pipe", + number: 3, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Pipe" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "forward", + label: :LABEL_OPTIONAL, + name: "forward", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Forward" + } + ], + name: "Workflow", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "routing", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :routing, 0 + + field :broadcast, 2, type: Eigr.Functions.Protocol.Broadcast + field :effects, 1, repeated: true, type: Eigr.Functions.Protocol.SideEffect + field :pipe, 3, type: Eigr.Functions.Protocol.Pipe, oneof: 0 + field :forward, 4, type: Eigr.Functions.Protocol.Forward, oneof: 0 +end +defmodule Eigr.Functions.Protocol.InvocationRequest.MetadataEntry do + @moduledoc false + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "MetadataEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + end + + field :key, 1, type: :string + field :value, 2, type: :string +end +defmodule Eigr.Functions.Protocol.InvocationRequest do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "system", + label: :LABEL_OPTIONAL, + name: "system", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actor", + label: :LABEL_OPTIONAL, + name: "actor", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actionName", + label: :LABEL_OPTIONAL, + name: "action_name", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "noop", + label: :LABEL_OPTIONAL, + name: "noop", + number: 7, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "async", + label: :LABEL_OPTIONAL, + name: "async", + number: 5, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_BOOL, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "caller", + label: :LABEL_OPTIONAL, + name: "caller", + number: 6, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "metadata", + label: :LABEL_REPEATED, + name: "metadata", + number: 8, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.InvocationRequest.MetadataEntry" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "scheduledTo", + label: :LABEL_OPTIONAL, + name: "scheduled_to", + number: 9, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT64, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "pooled", + label: :LABEL_OPTIONAL, + name: "pooled", + number: 10, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_BOOL, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "registerRef", + label: :LABEL_OPTIONAL, + name: "register_ref", + number: 11, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "InvocationRequest", + nested_type: [ + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "MetadataEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + ], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "payload", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :payload, 0 + + field :system, 1, type: Eigr.Functions.Protocol.Actors.ActorSystem + field :actor, 2, type: Eigr.Functions.Protocol.Actors.Actor + field :action_name, 3, type: :string, json_name: "actionName" + field :value, 4, type: Google.Protobuf.Any, oneof: 0 + field :noop, 7, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field :async, 5, type: :bool + field :caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId + + field :metadata, 8, + repeated: true, + type: Eigr.Functions.Protocol.InvocationRequest.MetadataEntry, + map: true + + field :scheduled_to, 9, type: :int64, json_name: "scheduledTo" + field :pooled, 10, type: :bool + field :register_ref, 11, type: :string, json_name: "registerRef" +end +defmodule Eigr.Functions.Protocol.ActorInvocation do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actor", + label: :LABEL_OPTIONAL, + name: "actor", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actionName", + label: :LABEL_OPTIONAL, + name: "action_name", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "currentContext", + label: :LABEL_OPTIONAL, + name: "current_context", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "noop", + label: :LABEL_OPTIONAL, + name: "noop", + number: 5, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "caller", + label: :LABEL_OPTIONAL, + name: "caller", + number: 6, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId" + } + ], + name: "ActorInvocation", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "payload", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :payload, 0 + + field :actor, 1, type: Eigr.Functions.Protocol.Actors.ActorId + field :action_name, 2, type: :string, json_name: "actionName" + field :current_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "currentContext" + field :value, 4, type: Google.Protobuf.Any, oneof: 0 + field :noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field :caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId +end +defmodule Eigr.Functions.Protocol.ActorInvocationResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actorName", + label: :LABEL_OPTIONAL, + name: "actor_name", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actorSystem", + label: :LABEL_OPTIONAL, + name: "actor_system", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "updatedContext", + label: :LABEL_OPTIONAL, + name: "updated_context", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "noop", + label: :LABEL_OPTIONAL, + name: "noop", + number: 6, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "workflow", + label: :LABEL_OPTIONAL, + name: "workflow", + number: 5, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Workflow" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "checkpoint", + label: :LABEL_OPTIONAL, + name: "checkpoint", + number: 7, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_BOOL, + type_name: nil + } + ], + name: "ActorInvocationResponse", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "payload", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :payload, 0 + + field :actor_name, 1, type: :string, json_name: "actorName" + field :actor_system, 2, type: :string, json_name: "actorSystem" + field :updated_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "updatedContext" + field :value, 4, type: Google.Protobuf.Any, oneof: 0 + field :noop, 6, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field :workflow, 5, type: Eigr.Functions.Protocol.Workflow + field :checkpoint, 7, type: :bool +end +defmodule Eigr.Functions.Protocol.InvocationResponse do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "status", + label: :LABEL_OPTIONAL, + name: "status", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "system", + label: :LABEL_OPTIONAL, + name: "system", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "actor", + label: :LABEL_OPTIONAL, + name: "actor", + number: 3, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "noop", + label: :LABEL_OPTIONAL, + name: "noop", + number: 5, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop" + } + ], + name: "InvocationResponse", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{ + __unknown_fields__: [], + name: "payload", + options: nil + } + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :payload, 0 + + field :status, 1, type: Eigr.Functions.Protocol.RequestStatus + field :system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem + field :actor, 3, type: Eigr.Functions.Protocol.Actors.Actor + field :value, 4, type: Google.Protobuf.Any, oneof: 0 + field :noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0 +end +defmodule Eigr.Functions.Protocol.RequestStatus do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "status", + label: :LABEL_OPTIONAL, + name: "status", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_ENUM, + type_name: ".eigr.functions.protocol.Status" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "message", + label: :LABEL_OPTIONAL, + name: "message", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "RequestStatus", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :status, 1, type: Eigr.Functions.Protocol.Status, enum: true + field :message, 2, type: :string +end diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex new file mode 100644 index 00000000..c79a6c38 --- /dev/null +++ b/lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex @@ -0,0 +1,91 @@ +defmodule Eigr.Functions.Protocol.State.Revision do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT64, + type_name: nil + } + ], + name: "Revision", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :int64 +end +defmodule Eigr.Functions.Protocol.State.Checkpoint do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "revision", + label: :LABEL_OPTIONAL, + name: "revision", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.state.Revision" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "state", + label: :LABEL_OPTIONAL, + name: "state", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState" + } + ], + name: "Checkpoint", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :revision, 1, type: Eigr.Functions.Protocol.State.Revision + field :state, 2, type: Eigr.Functions.Protocol.Actors.ActorState +end diff --git a/priv/protos/modules/healthcheck.pb.ex b/lib/spawn/actors/healthcheck.pb.ex similarity index 100% rename from priv/protos/modules/healthcheck.pb.ex rename to lib/spawn/actors/healthcheck.pb.ex diff --git a/lib/spawn/google/protobuf/any.pb.ex b/lib/spawn/google/protobuf/any.pb.ex index 2a3ef175..40d471d7 100644 --- a/lib/spawn/google/protobuf/any.pb.ex +++ b/lib/spawn/google/protobuf/any.pb.ex @@ -48,6 +48,6 @@ defmodule Google.Protobuf.Any do } end - field(:type_url, 1, type: :string, json_name: "typeUrl") - field(:value, 2, type: :bytes) + field :type_url, 1, type: :string, json_name: "typeUrl" + field :value, 2, type: :bytes end diff --git a/lib/spawn/google/protobuf/descriptor.pb.ex b/lib/spawn/google/protobuf/descriptor.pb.ex new file mode 100644 index 00000000..ad25a221 --- /dev/null +++ b/lib/spawn/google/protobuf/descriptor.pb.ex @@ -0,0 +1,592 @@ +defmodule Google.Protobuf.Edition do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :EDITION_UNKNOWN, 0 + field :EDITION_PROTO2, 998 + field :EDITION_PROTO3, 999 + field :EDITION_2023, 1000 + field :EDITION_2024, 1001 + field :EDITION_1_TEST_ONLY, 1 + field :EDITION_2_TEST_ONLY, 2 + field :EDITION_99997_TEST_ONLY, 99997 + field :EDITION_99998_TEST_ONLY, 99998 + field :EDITION_99999_TEST_ONLY, 99999 + field :EDITION_MAX, 2_147_483_647 +end +defmodule Google.Protobuf.ExtensionRangeOptions.VerificationState do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :DECLARATION, 0 + field :UNVERIFIED, 1 +end +defmodule Google.Protobuf.FieldDescriptorProto.Type do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :TYPE_DOUBLE, 1 + field :TYPE_FLOAT, 2 + field :TYPE_INT64, 3 + field :TYPE_UINT64, 4 + field :TYPE_INT32, 5 + field :TYPE_FIXED64, 6 + field :TYPE_FIXED32, 7 + field :TYPE_BOOL, 8 + field :TYPE_STRING, 9 + field :TYPE_GROUP, 10 + field :TYPE_MESSAGE, 11 + field :TYPE_BYTES, 12 + field :TYPE_UINT32, 13 + field :TYPE_ENUM, 14 + field :TYPE_SFIXED32, 15 + field :TYPE_SFIXED64, 16 + field :TYPE_SINT32, 17 + field :TYPE_SINT64, 18 +end +defmodule Google.Protobuf.FieldDescriptorProto.Label do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :LABEL_OPTIONAL, 1 + field :LABEL_REPEATED, 3 + field :LABEL_REQUIRED, 2 +end +defmodule Google.Protobuf.FileOptions.OptimizeMode do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :SPEED, 1 + field :CODE_SIZE, 2 + field :LITE_RUNTIME, 3 +end +defmodule Google.Protobuf.FieldOptions.CType do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :STRING, 0 + field :CORD, 1 + field :STRING_PIECE, 2 +end +defmodule Google.Protobuf.FieldOptions.JSType do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :JS_NORMAL, 0 + field :JS_STRING, 1 + field :JS_NUMBER, 2 +end +defmodule Google.Protobuf.FieldOptions.OptionRetention do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :RETENTION_UNKNOWN, 0 + field :RETENTION_RUNTIME, 1 + field :RETENTION_SOURCE, 2 +end +defmodule Google.Protobuf.FieldOptions.OptionTargetType do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :TARGET_TYPE_UNKNOWN, 0 + field :TARGET_TYPE_FILE, 1 + field :TARGET_TYPE_EXTENSION_RANGE, 2 + field :TARGET_TYPE_MESSAGE, 3 + field :TARGET_TYPE_FIELD, 4 + field :TARGET_TYPE_ONEOF, 5 + field :TARGET_TYPE_ENUM, 6 + field :TARGET_TYPE_ENUM_ENTRY, 7 + field :TARGET_TYPE_SERVICE, 8 + field :TARGET_TYPE_METHOD, 9 +end +defmodule Google.Protobuf.MethodOptions.IdempotencyLevel do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :IDEMPOTENCY_UNKNOWN, 0 + field :NO_SIDE_EFFECTS, 1 + field :IDEMPOTENT, 2 +end +defmodule Google.Protobuf.FeatureSet.FieldPresence do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :FIELD_PRESENCE_UNKNOWN, 0 + field :EXPLICIT, 1 + field :IMPLICIT, 2 + field :LEGACY_REQUIRED, 3 +end +defmodule Google.Protobuf.FeatureSet.EnumType do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :ENUM_TYPE_UNKNOWN, 0 + field :OPEN, 1 + field :CLOSED, 2 +end +defmodule Google.Protobuf.FeatureSet.RepeatedFieldEncoding do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :REPEATED_FIELD_ENCODING_UNKNOWN, 0 + field :PACKED, 1 + field :EXPANDED, 2 +end +defmodule Google.Protobuf.FeatureSet.Utf8Validation do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :UTF8_VALIDATION_UNKNOWN, 0 + field :VERIFY, 2 + field :NONE, 3 +end +defmodule Google.Protobuf.FeatureSet.MessageEncoding do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :MESSAGE_ENCODING_UNKNOWN, 0 + field :LENGTH_PREFIXED, 1 + field :DELIMITED, 2 +end +defmodule Google.Protobuf.FeatureSet.JsonFormat do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :JSON_FORMAT_UNKNOWN, 0 + field :ALLOW, 1 + field :LEGACY_BEST_EFFORT, 2 +end +defmodule Google.Protobuf.GeneratedCodeInfo.Annotation.Semantic do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :NONE, 0 + field :SET, 1 + field :ALIAS, 2 +end +defmodule Google.Protobuf.FileDescriptorSet do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :file, 1, repeated: true, type: Google.Protobuf.FileDescriptorProto +end +defmodule Google.Protobuf.FileDescriptorProto do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 1, optional: true, type: :string + field :package, 2, optional: true, type: :string + field :dependency, 3, repeated: true, type: :string + field :public_dependency, 10, repeated: true, type: :int32 + field :weak_dependency, 11, repeated: true, type: :int32 + field :message_type, 4, repeated: true, type: Google.Protobuf.DescriptorProto + field :enum_type, 5, repeated: true, type: Google.Protobuf.EnumDescriptorProto + field :service, 6, repeated: true, type: Google.Protobuf.ServiceDescriptorProto + field :extension, 7, repeated: true, type: Google.Protobuf.FieldDescriptorProto + field :options, 8, optional: true, type: Google.Protobuf.FileOptions + field :source_code_info, 9, optional: true, type: Google.Protobuf.SourceCodeInfo + field :syntax, 12, optional: true, type: :string + field :edition, 14, optional: true, type: Google.Protobuf.Edition, enum: true +end +defmodule Google.Protobuf.DescriptorProto.ExtensionRange do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :start, 1, optional: true, type: :int32 + field :end, 2, optional: true, type: :int32 + field :options, 3, optional: true, type: Google.Protobuf.ExtensionRangeOptions +end +defmodule Google.Protobuf.DescriptorProto.ReservedRange do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :start, 1, optional: true, type: :int32 + field :end, 2, optional: true, type: :int32 +end +defmodule Google.Protobuf.DescriptorProto do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 1, optional: true, type: :string + field :field, 2, repeated: true, type: Google.Protobuf.FieldDescriptorProto + field :extension, 6, repeated: true, type: Google.Protobuf.FieldDescriptorProto + field :nested_type, 3, repeated: true, type: Google.Protobuf.DescriptorProto + field :enum_type, 4, repeated: true, type: Google.Protobuf.EnumDescriptorProto + field :extension_range, 5, repeated: true, type: Google.Protobuf.DescriptorProto.ExtensionRange + field :oneof_decl, 8, repeated: true, type: Google.Protobuf.OneofDescriptorProto + field :options, 7, optional: true, type: Google.Protobuf.MessageOptions + field :reserved_range, 9, repeated: true, type: Google.Protobuf.DescriptorProto.ReservedRange + field :reserved_name, 10, repeated: true, type: :string +end +defmodule Google.Protobuf.ExtensionRangeOptions.Declaration do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :number, 1, optional: true, type: :int32 + field :full_name, 2, optional: true, type: :string + field :type, 3, optional: true, type: :string + field :reserved, 5, optional: true, type: :bool + field :repeated, 6, optional: true, type: :bool +end +defmodule Google.Protobuf.ExtensionRangeOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + field :declaration, 2, + repeated: true, + type: Google.Protobuf.ExtensionRangeOptions.Declaration, + deprecated: false + + field :features, 50, optional: true, type: Google.Protobuf.FeatureSet + + field :verification, 3, + optional: true, + type: Google.Protobuf.ExtensionRangeOptions.VerificationState, + default: :UNVERIFIED, + enum: true, + deprecated: false + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.FieldDescriptorProto do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 1, optional: true, type: :string + field :number, 3, optional: true, type: :int32 + field :label, 4, optional: true, type: Google.Protobuf.FieldDescriptorProto.Label, enum: true + field :type, 5, optional: true, type: Google.Protobuf.FieldDescriptorProto.Type, enum: true + field :type_name, 6, optional: true, type: :string + field :extendee, 2, optional: true, type: :string + field :default_value, 7, optional: true, type: :string + field :oneof_index, 9, optional: true, type: :int32 + field :json_name, 10, optional: true, type: :string + field :options, 8, optional: true, type: Google.Protobuf.FieldOptions + field :proto3_optional, 17, optional: true, type: :bool +end +defmodule Google.Protobuf.OneofDescriptorProto do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 1, optional: true, type: :string + field :options, 2, optional: true, type: Google.Protobuf.OneofOptions +end +defmodule Google.Protobuf.EnumDescriptorProto.EnumReservedRange do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :start, 1, optional: true, type: :int32 + field :end, 2, optional: true, type: :int32 +end +defmodule Google.Protobuf.EnumDescriptorProto do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 1, optional: true, type: :string + field :value, 2, repeated: true, type: Google.Protobuf.EnumValueDescriptorProto + field :options, 3, optional: true, type: Google.Protobuf.EnumOptions + + field :reserved_range, 4, + repeated: true, + type: Google.Protobuf.EnumDescriptorProto.EnumReservedRange + + field :reserved_name, 5, repeated: true, type: :string +end +defmodule Google.Protobuf.EnumValueDescriptorProto do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 1, optional: true, type: :string + field :number, 2, optional: true, type: :int32 + field :options, 3, optional: true, type: Google.Protobuf.EnumValueOptions +end +defmodule Google.Protobuf.ServiceDescriptorProto do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 1, optional: true, type: :string + field :method, 2, repeated: true, type: Google.Protobuf.MethodDescriptorProto + field :options, 3, optional: true, type: Google.Protobuf.ServiceOptions +end +defmodule Google.Protobuf.MethodDescriptorProto do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 1, optional: true, type: :string + field :input_type, 2, optional: true, type: :string + field :output_type, 3, optional: true, type: :string + field :options, 4, optional: true, type: Google.Protobuf.MethodOptions + field :client_streaming, 5, optional: true, type: :bool, default: false + field :server_streaming, 6, optional: true, type: :bool, default: false +end +defmodule Google.Protobuf.FileOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :java_package, 1, optional: true, type: :string + field :java_outer_classname, 8, optional: true, type: :string + field :java_multiple_files, 10, optional: true, type: :bool, default: false + field :java_generate_equals_and_hash, 20, optional: true, type: :bool, deprecated: true + field :java_string_check_utf8, 27, optional: true, type: :bool, default: false + + field :optimize_for, 9, + optional: true, + type: Google.Protobuf.FileOptions.OptimizeMode, + default: :SPEED, + enum: true + + field :go_package, 11, optional: true, type: :string + field :cc_generic_services, 16, optional: true, type: :bool, default: false + field :java_generic_services, 17, optional: true, type: :bool, default: false + field :py_generic_services, 18, optional: true, type: :bool, default: false + field :deprecated, 23, optional: true, type: :bool, default: false + field :cc_enable_arenas, 31, optional: true, type: :bool, default: true + field :objc_class_prefix, 36, optional: true, type: :string + field :csharp_namespace, 37, optional: true, type: :string + field :swift_prefix, 39, optional: true, type: :string + field :php_class_prefix, 40, optional: true, type: :string + field :php_namespace, 41, optional: true, type: :string + field :php_metadata_namespace, 44, optional: true, type: :string + field :ruby_package, 45, optional: true, type: :string + field :features, 50, optional: true, type: Google.Protobuf.FeatureSet + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.MessageOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :message_set_wire_format, 1, optional: true, type: :bool, default: false + field :no_standard_descriptor_accessor, 2, optional: true, type: :bool, default: false + field :deprecated, 3, optional: true, type: :bool, default: false + field :map_entry, 7, optional: true, type: :bool + field :deprecated_legacy_json_field_conflicts, 11, optional: true, type: :bool, deprecated: true + field :features, 12, optional: true, type: Google.Protobuf.FeatureSet + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.FieldOptions.EditionDefault do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :edition, 3, optional: true, type: Google.Protobuf.Edition, enum: true + field :value, 2, optional: true, type: :string +end +defmodule Google.Protobuf.FieldOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :ctype, 1, + optional: true, + type: Google.Protobuf.FieldOptions.CType, + default: :STRING, + enum: true + + field :packed, 2, optional: true, type: :bool + + field :jstype, 6, + optional: true, + type: Google.Protobuf.FieldOptions.JSType, + default: :JS_NORMAL, + enum: true + + field :lazy, 5, optional: true, type: :bool, default: false + field :unverified_lazy, 15, optional: true, type: :bool, default: false + field :deprecated, 3, optional: true, type: :bool, default: false + field :weak, 10, optional: true, type: :bool, default: false + field :debug_redact, 16, optional: true, type: :bool, default: false + + field :retention, 17, + optional: true, + type: Google.Protobuf.FieldOptions.OptionRetention, + enum: true + + field :targets, 19, + repeated: true, + type: Google.Protobuf.FieldOptions.OptionTargetType, + enum: true + + field :edition_defaults, 20, repeated: true, type: Google.Protobuf.FieldOptions.EditionDefault + field :features, 21, optional: true, type: Google.Protobuf.FeatureSet + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.OneofOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :features, 1, optional: true, type: Google.Protobuf.FeatureSet + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.EnumOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :allow_alias, 2, optional: true, type: :bool + field :deprecated, 3, optional: true, type: :bool, default: false + field :deprecated_legacy_json_field_conflicts, 6, optional: true, type: :bool, deprecated: true + field :features, 7, optional: true, type: Google.Protobuf.FeatureSet + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.EnumValueOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :deprecated, 1, optional: true, type: :bool, default: false + field :features, 2, optional: true, type: Google.Protobuf.FeatureSet + field :debug_redact, 3, optional: true, type: :bool, default: false + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.ServiceOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :features, 34, optional: true, type: Google.Protobuf.FeatureSet + field :deprecated, 33, optional: true, type: :bool, default: false + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.MethodOptions do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :deprecated, 33, optional: true, type: :bool, default: false + + field :idempotency_level, 34, + optional: true, + type: Google.Protobuf.MethodOptions.IdempotencyLevel, + default: :IDEMPOTENCY_UNKNOWN, + enum: true + + field :features, 35, optional: true, type: Google.Protobuf.FeatureSet + field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + + extensions [{1000, 536_870_912}] +end +defmodule Google.Protobuf.UninterpretedOption.NamePart do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name_part, 1, required: true, type: :string + field :is_extension, 2, required: true, type: :bool +end +defmodule Google.Protobuf.UninterpretedOption do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :name, 2, repeated: true, type: Google.Protobuf.UninterpretedOption.NamePart + field :identifier_value, 3, optional: true, type: :string + field :positive_int_value, 4, optional: true, type: :uint64 + field :negative_int_value, 5, optional: true, type: :int64 + field :double_value, 6, optional: true, type: :double + field :string_value, 7, optional: true, type: :bytes + field :aggregate_value, 8, optional: true, type: :string +end +defmodule Google.Protobuf.FeatureSet do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :field_presence, 1, + optional: true, + type: Google.Protobuf.FeatureSet.FieldPresence, + enum: true, + deprecated: false + + field :enum_type, 2, + optional: true, + type: Google.Protobuf.FeatureSet.EnumType, + enum: true, + deprecated: false + + field :repeated_field_encoding, 3, + optional: true, + type: Google.Protobuf.FeatureSet.RepeatedFieldEncoding, + enum: true, + deprecated: false + + field :utf8_validation, 4, + optional: true, + type: Google.Protobuf.FeatureSet.Utf8Validation, + enum: true, + deprecated: false + + field :message_encoding, 5, + optional: true, + type: Google.Protobuf.FeatureSet.MessageEncoding, + enum: true, + deprecated: false + + field :json_format, 6, + optional: true, + type: Google.Protobuf.FeatureSet.JsonFormat, + enum: true, + deprecated: false + + extensions [{1000, 1001}, {1001, 1002}, {1002, 1003}, {9995, 10000}, {10000, 10001}] +end +defmodule Google.Protobuf.FeatureSetDefaults.FeatureSetEditionDefault do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :edition, 3, optional: true, type: Google.Protobuf.Edition, enum: true + field :features, 2, optional: true, type: Google.Protobuf.FeatureSet +end +defmodule Google.Protobuf.FeatureSetDefaults do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :defaults, 1, + repeated: true, + type: Google.Protobuf.FeatureSetDefaults.FeatureSetEditionDefault + + field :minimum_edition, 4, optional: true, type: Google.Protobuf.Edition, enum: true + field :maximum_edition, 5, optional: true, type: Google.Protobuf.Edition, enum: true +end +defmodule Google.Protobuf.SourceCodeInfo.Location do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :path, 1, repeated: true, type: :int32, packed: true, deprecated: false + field :span, 2, repeated: true, type: :int32, packed: true, deprecated: false + field :leading_comments, 3, optional: true, type: :string + field :trailing_comments, 4, optional: true, type: :string + field :leading_detached_comments, 6, repeated: true, type: :string +end +defmodule Google.Protobuf.SourceCodeInfo do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :location, 1, repeated: true, type: Google.Protobuf.SourceCodeInfo.Location +end +defmodule Google.Protobuf.GeneratedCodeInfo.Annotation do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :path, 1, repeated: true, type: :int32, packed: true, deprecated: false + field :source_file, 2, optional: true, type: :string + field :begin, 3, optional: true, type: :int32 + field :end, 4, optional: true, type: :int32 + + field :semantic, 5, + optional: true, + type: Google.Protobuf.GeneratedCodeInfo.Annotation.Semantic, + enum: true +end +defmodule Google.Protobuf.GeneratedCodeInfo do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 + + field :annotation, 1, repeated: true, type: Google.Protobuf.GeneratedCodeInfo.Annotation +end diff --git a/lib/spawn/google/protobuf/duration.pb.ex b/lib/spawn/google/protobuf/duration.pb.ex new file mode 100644 index 00000000..0679508f --- /dev/null +++ b/lib/spawn/google/protobuf/duration.pb.ex @@ -0,0 +1,53 @@ +defmodule Google.Protobuf.Duration do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "seconds", + label: :LABEL_OPTIONAL, + name: "seconds", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT64, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "nanos", + label: :LABEL_OPTIONAL, + name: "nanos", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + } + ], + name: "Duration", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :seconds, 1, type: :int64 + field :nanos, 2, type: :int32 +end diff --git a/lib/spawn/google/protobuf/empty.pb.ex b/lib/spawn/google/protobuf/empty.pb.ex new file mode 100644 index 00000000..673979f1 --- /dev/null +++ b/lib/spawn/google/protobuf/empty.pb.ex @@ -0,0 +1,21 @@ +defmodule Google.Protobuf.Empty do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [], + name: "Empty", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end +end diff --git a/lib/spawn/google/protobuf/field_mask.pb.ex b/lib/spawn/google/protobuf/field_mask.pb.ex new file mode 100644 index 00000000..01097679 --- /dev/null +++ b/lib/spawn/google/protobuf/field_mask.pb.ex @@ -0,0 +1,38 @@ +defmodule Google.Protobuf.FieldMask do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "paths", + label: :LABEL_REPEATED, + name: "paths", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "FieldMask", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :paths, 1, repeated: true, type: :string +end diff --git a/lib/spawn/google/protobuf/source_context.pb.ex b/lib/spawn/google/protobuf/source_context.pb.ex new file mode 100644 index 00000000..246fcc1f --- /dev/null +++ b/lib/spawn/google/protobuf/source_context.pb.ex @@ -0,0 +1,38 @@ +defmodule Google.Protobuf.SourceContext do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "fileName", + label: :LABEL_OPTIONAL, + name: "file_name", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "SourceContext", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :file_name, 1, type: :string, json_name: "fileName" +end diff --git a/lib/spawn/google/protobuf/struct.pb.ex b/lib/spawn/google/protobuf/struct.pb.ex new file mode 100644 index 00000000..050ddc84 --- /dev/null +++ b/lib/spawn/google/protobuf/struct.pb.ex @@ -0,0 +1,335 @@ +defmodule Google.Protobuf.NullValue do + @moduledoc false + use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.EnumDescriptorProto{ + __unknown_fields__: [], + name: "NullValue", + options: nil, + reserved_name: [], + reserved_range: [], + value: [ + %Google.Protobuf.EnumValueDescriptorProto{ + __unknown_fields__: [], + name: "NULL_VALUE", + number: 0, + options: nil + } + ] + } + end + + field :NULL_VALUE, 0 +end +defmodule Google.Protobuf.Struct.FieldsEntry do + @moduledoc false + use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Value" + } + ], + name: "FieldsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + end + + field :key, 1, type: :string + field :value, 2, type: Google.Protobuf.Value +end +defmodule Google.Protobuf.Struct do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "fields", + label: :LABEL_REPEATED, + name: "fields", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Struct.FieldsEntry" + } + ], + name: "Struct", + nested_type: [ + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "key", + label: :LABEL_OPTIONAL, + name: "key", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Value" + } + ], + name: "FieldsEntry", + nested_type: [], + oneof_decl: [], + options: %Google.Protobuf.MessageOptions{ + __pb_extensions__: %{}, + __unknown_fields__: [], + deprecated: false, + map_entry: true, + message_set_wire_format: false, + no_standard_descriptor_accessor: false, + uninterpreted_option: [] + }, + reserved_name: [], + reserved_range: [] + } + ], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :fields, 1, repeated: true, type: Google.Protobuf.Struct.FieldsEntry, map: true +end +defmodule Google.Protobuf.Value do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "nullValue", + label: :LABEL_OPTIONAL, + name: "null_value", + number: 1, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_ENUM, + type_name: ".google.protobuf.NullValue" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "numberValue", + label: :LABEL_OPTIONAL, + name: "number_value", + number: 2, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_DOUBLE, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "stringValue", + label: :LABEL_OPTIONAL, + name: "string_value", + number: 3, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "boolValue", + label: :LABEL_OPTIONAL, + name: "bool_value", + number: 4, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_BOOL, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "structValue", + label: :LABEL_OPTIONAL, + name: "struct_value", + number: 5, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Struct" + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "listValue", + label: :LABEL_OPTIONAL, + name: "list_value", + number: 6, + oneof_index: 0, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.ListValue" + } + ], + name: "Value", + nested_type: [], + oneof_decl: [ + %Google.Protobuf.OneofDescriptorProto{__unknown_fields__: [], name: "kind", options: nil} + ], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + oneof :kind, 0 + + field :null_value, 1, + type: Google.Protobuf.NullValue, + json_name: "nullValue", + enum: true, + oneof: 0 + + field :number_value, 2, type: :double, json_name: "numberValue", oneof: 0 + field :string_value, 3, type: :string, json_name: "stringValue", oneof: 0 + field :bool_value, 4, type: :bool, json_name: "boolValue", oneof: 0 + field :struct_value, 5, type: Google.Protobuf.Struct, json_name: "structValue", oneof: 0 + field :list_value, 6, type: Google.Protobuf.ListValue, json_name: "listValue", oneof: 0 +end +defmodule Google.Protobuf.ListValue do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "values", + label: :LABEL_REPEATED, + name: "values", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Value" + } + ], + name: "ListValue", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :values, 1, repeated: true, type: Google.Protobuf.Value +end diff --git a/lib/spawn/google/protobuf/timestamp.pb.ex b/lib/spawn/google/protobuf/timestamp.pb.ex new file mode 100644 index 00000000..b6086b41 --- /dev/null +++ b/lib/spawn/google/protobuf/timestamp.pb.ex @@ -0,0 +1,53 @@ +defmodule Google.Protobuf.Timestamp do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "seconds", + label: :LABEL_OPTIONAL, + name: "seconds", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT64, + type_name: nil + }, + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "nanos", + label: :LABEL_OPTIONAL, + name: "nanos", + number: 2, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + } + ], + name: "Timestamp", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :seconds, 1, type: :int64 + field :nanos, 2, type: :int32 +end diff --git a/lib/spawn/google/protobuf/wrappers.pb.ex b/lib/spawn/google/protobuf/wrappers.pb.ex new file mode 100644 index 00000000..985ffe2e --- /dev/null +++ b/lib/spawn/google/protobuf/wrappers.pb.ex @@ -0,0 +1,342 @@ +defmodule Google.Protobuf.DoubleValue do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_DOUBLE, + type_name: nil + } + ], + name: "DoubleValue", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :double +end +defmodule Google.Protobuf.FloatValue do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_FLOAT, + type_name: nil + } + ], + name: "FloatValue", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :float +end +defmodule Google.Protobuf.Int64Value do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT64, + type_name: nil + } + ], + name: "Int64Value", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :int64 +end +defmodule Google.Protobuf.UInt64Value do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_UINT64, + type_name: nil + } + ], + name: "UInt64Value", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :uint64 +end +defmodule Google.Protobuf.Int32Value do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_INT32, + type_name: nil + } + ], + name: "Int32Value", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :int32 +end +defmodule Google.Protobuf.UInt32Value do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_UINT32, + type_name: nil + } + ], + name: "UInt32Value", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :uint32 +end +defmodule Google.Protobuf.BoolValue do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_BOOL, + type_name: nil + } + ], + name: "BoolValue", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :bool +end +defmodule Google.Protobuf.StringValue do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_STRING, + type_name: nil + } + ], + name: "StringValue", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :string +end +defmodule Google.Protobuf.BytesValue do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + __unknown_fields__: [], + enum_type: [], + extension: [], + extension_range: [], + field: [ + %Google.Protobuf.FieldDescriptorProto{ + __unknown_fields__: [], + default_value: nil, + extendee: nil, + json_name: "value", + label: :LABEL_OPTIONAL, + name: "value", + number: 1, + oneof_index: nil, + options: nil, + proto3_optional: nil, + type: :TYPE_BYTES, + type_name: nil + } + ], + name: "BytesValue", + nested_type: [], + oneof_decl: [], + options: nil, + reserved_name: [], + reserved_range: [] + } + end + + field :value, 1, type: :bytes +end diff --git a/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex b/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex index 29a76e93..acc59fcc 100644 --- a/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex +++ b/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex @@ -110,27 +110,24 @@ defmodule Grpc.Reflection.V1alpha.ServerReflectionRequest do } end - oneof(:message_request, 0) + oneof :message_request, 0 - field(:host, 1, type: :string) - field(:file_by_filename, 3, type: :string, json_name: "fileByFilename", oneof: 0) - field(:file_containing_symbol, 4, type: :string, json_name: "fileContainingSymbol", oneof: 0) + field :host, 1, type: :string + field :file_by_filename, 3, type: :string, json_name: "fileByFilename", oneof: 0 + field :file_containing_symbol, 4, type: :string, json_name: "fileContainingSymbol", oneof: 0 - field(:file_containing_extension, 5, + field :file_containing_extension, 5, type: Grpc.Reflection.V1alpha.ExtensionRequest, json_name: "fileContainingExtension", oneof: 0 - ) - field(:all_extension_numbers_of_type, 6, + field :all_extension_numbers_of_type, 6, type: :string, json_name: "allExtensionNumbersOfType", oneof: 0 - ) - field(:list_services, 7, type: :string, json_name: "listServices", oneof: 0) + field :list_services, 7, type: :string, json_name: "listServices", oneof: 0 end - defmodule Grpc.Reflection.V1alpha.ExtensionRequest do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -181,10 +178,9 @@ defmodule Grpc.Reflection.V1alpha.ExtensionRequest do } end - field(:containing_type, 1, type: :string, json_name: "containingType") - field(:extension_number, 2, type: :int32, json_name: "extensionNumber") + field :containing_type, 1, type: :string, json_name: "containingType" + field :extension_number, 2, type: :int32, json_name: "extensionNumber" end - defmodule Grpc.Reflection.V1alpha.ServerReflectionResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -297,40 +293,34 @@ defmodule Grpc.Reflection.V1alpha.ServerReflectionResponse do } end - oneof(:message_response, 0) + oneof :message_response, 0 - field(:valid_host, 1, type: :string, json_name: "validHost") + field :valid_host, 1, type: :string, json_name: "validHost" - field(:original_request, 2, + field :original_request, 2, type: Grpc.Reflection.V1alpha.ServerReflectionRequest, json_name: "originalRequest" - ) - field(:file_descriptor_response, 4, + field :file_descriptor_response, 4, type: Grpc.Reflection.V1alpha.FileDescriptorResponse, json_name: "fileDescriptorResponse", oneof: 0 - ) - field(:all_extension_numbers_response, 5, + field :all_extension_numbers_response, 5, type: Grpc.Reflection.V1alpha.ExtensionNumberResponse, json_name: "allExtensionNumbersResponse", oneof: 0 - ) - field(:list_services_response, 6, + field :list_services_response, 6, type: Grpc.Reflection.V1alpha.ListServiceResponse, json_name: "listServicesResponse", oneof: 0 - ) - field(:error_response, 7, + field :error_response, 7, type: Grpc.Reflection.V1alpha.ErrorResponse, json_name: "errorResponse", oneof: 0 - ) end - defmodule Grpc.Reflection.V1alpha.FileDescriptorResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -367,9 +357,8 @@ defmodule Grpc.Reflection.V1alpha.FileDescriptorResponse do } end - field(:file_descriptor_proto, 1, repeated: true, type: :bytes, json_name: "fileDescriptorProto") + field :file_descriptor_proto, 1, repeated: true, type: :bytes, json_name: "fileDescriptorProto" end - defmodule Grpc.Reflection.V1alpha.ExtensionNumberResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -420,10 +409,9 @@ defmodule Grpc.Reflection.V1alpha.ExtensionNumberResponse do } end - field(:base_type_name, 1, type: :string, json_name: "baseTypeName") - field(:extension_number, 2, repeated: true, type: :int32, json_name: "extensionNumber") + field :base_type_name, 1, type: :string, json_name: "baseTypeName" + field :extension_number, 2, repeated: true, type: :int32, json_name: "extensionNumber" end - defmodule Grpc.Reflection.V1alpha.ListServiceResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -460,9 +448,8 @@ defmodule Grpc.Reflection.V1alpha.ListServiceResponse do } end - field(:service, 1, repeated: true, type: Grpc.Reflection.V1alpha.ServiceResponse) + field :service, 1, repeated: true, type: Grpc.Reflection.V1alpha.ServiceResponse end - defmodule Grpc.Reflection.V1alpha.ServiceResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -499,9 +486,8 @@ defmodule Grpc.Reflection.V1alpha.ServiceResponse do } end - field(:name, 1, type: :string) + field :name, 1, type: :string end - defmodule Grpc.Reflection.V1alpha.ErrorResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -552,10 +538,9 @@ defmodule Grpc.Reflection.V1alpha.ErrorResponse do } end - field(:error_code, 1, type: :int32, json_name: "errorCode") - field(:error_message, 2, type: :string, json_name: "errorMessage") + field :error_code, 1, type: :int32, json_name: "errorCode" + field :error_message, 2, type: :string, json_name: "errorMessage" end - defmodule Grpc.Reflection.V1alpha.ServerReflection.Service do @moduledoc false use GRPC.Service, @@ -582,11 +567,9 @@ defmodule Grpc.Reflection.V1alpha.ServerReflection.Service do } end - rpc( - :ServerReflectionInfo, - stream(Grpc.Reflection.V1alpha.ServerReflectionRequest), - stream(Grpc.Reflection.V1alpha.ServerReflectionResponse) - ) + rpc :ServerReflectionInfo, + stream(Grpc.Reflection.V1alpha.ServerReflectionRequest), + stream(Grpc.Reflection.V1alpha.ServerReflectionResponse) end defmodule Grpc.Reflection.V1alpha.ServerReflection.Stub do diff --git a/priv/protos/healthcheck.proto b/priv/protos/eigr/functions/protocol/actors/healthcheck.proto similarity index 99% rename from priv/protos/healthcheck.proto rename to priv/protos/eigr/functions/protocol/actors/healthcheck.proto index c5a4a94d..41204fa6 100644 --- a/priv/protos/healthcheck.proto +++ b/priv/protos/eigr/functions/protocol/actors/healthcheck.proto @@ -36,4 +36,4 @@ service HealthCheckActor { get : "/v1/health/readiness" }; } -} +} \ No newline at end of file diff --git a/priv/protos/modules/pinger.pb.ex b/priv/protos/modules/pinger.pb.ex new file mode 100644 index 00000000..05660dcc --- /dev/null +++ b/priv/protos/modules/pinger.pb.ex @@ -0,0 +1,1015 @@ +defmodule Pinger.PingPongState do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "PingPongState", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "actual_name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "actualName", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "previous_name", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "previousName", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "updated_at", + extendee: nil, + number: 3, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "updatedAt", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :actual_name, 1, type: :string, json_name: "actualName" + field :previous_name, 2, type: :string, json_name: "previousName" + field :updated_at, 3, type: Google.Protobuf.Timestamp, json_name: "updatedAt" +end + +defmodule Pinger.PingRequest do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "PingRequest", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + retention: nil, + targets: [], + edition_defaults: [], + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{{Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true}, + __unknown_fields__: [] + }, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :name, 1, type: :string, deprecated: false +end + +defmodule Pinger.PongReply do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "PongReply", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "message", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "message", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "today", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "today", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :message, 1, type: :string + field :today, 2, type: Google.Protobuf.Timestamp +end + +defmodule Pinger.PingPongActor.Service do + @moduledoc false + use GRPC.Service, name: "pinger.PingPongActor", protoc_gen_elixir_version: "0.12.0" + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.FileDescriptorProto{ + name: "pinger.proto", + package: "pinger", + dependency: [ + "google/api/annotations.proto", + "google/protobuf/empty.proto", + "google/protobuf/timestamp.proto", + "eigr/functions/protocol/actors/extensions.proto" + ], + message_type: [ + %Google.Protobuf.DescriptorProto{ + name: "PingPongState", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "actual_name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "actualName", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "previous_name", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "previousName", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "updated_at", + extendee: nil, + number: 3, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "updatedAt", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + }, + %Google.Protobuf.DescriptorProto{ + name: "PingRequest", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "name", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: %Google.Protobuf.FieldOptions{ + ctype: :STRING, + packed: nil, + deprecated: false, + lazy: false, + jstype: :JS_NORMAL, + weak: false, + unverified_lazy: false, + debug_redact: false, + retention: nil, + targets: [], + edition_defaults: [], + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true + }, + __unknown_fields__: [] + }, + oneof_index: nil, + json_name: "name", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + }, + %Google.Protobuf.DescriptorProto{ + name: "PongReply", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "message", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "message", + proto3_optional: nil, + __unknown_fields__: [] + }, + %Google.Protobuf.FieldDescriptorProto{ + name: "today", + extendee: nil, + number: 2, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Timestamp", + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "today", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + ], + enum_type: [], + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "PingPongActor", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "Ping", + input_type: ".pinger.PingRequest", + output_type: ".pinger.PongReply", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/ping/{name}"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + }, + %Google.Protobuf.MethodDescriptorProto{ + name: "Pong", + input_type: ".google.protobuf.Empty", + output_type: ".pinger.PingPongState", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/pong/{name}"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + } + ], + options: nil, + __unknown_fields__: [] + } + ], + extension: [], + options: %Google.Protobuf.FileOptions{ + java_package: nil, + java_outer_classname: nil, + optimize_for: :SPEED, + java_multiple_files: false, + go_package: nil, + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + java_generate_equals_and_hash: nil, + deprecated: false, + java_string_check_utf8: false, + cc_enable_arenas: true, + objc_class_prefix: "HLW", + csharp_namespace: nil, + swift_prefix: nil, + php_class_prefix: nil, + php_namespace: nil, + php_metadata_namespace: nil, + ruby_package: nil, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] + }, + source_code_info: %Google.Protobuf.SourceCodeInfo{ + location: [ + %Google.Protobuf.SourceCodeInfo.Location{ + path: [], + span: [0, 0, 45, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\f", + span: [0, 0, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [2, 0, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b$", + span: [2, 0, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 0], + span: [4, 0, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 1], + span: [5, 0, 37], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 2], + span: [6, 0, 41], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 3], + span: [7, 0, 57], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [2], + span: [9, 0, 15], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0], + span: [12, 0, 16, 1], + leading_comments: " The ping-pong state of PingPongActor\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 1], + span: [12, 8, 21], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0], + span: [13, 2, 25], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 5], + span: [13, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 1], + span: [13, 9, 20], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 3], + span: [13, 23, 24], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 1], + span: [14, 2, 27], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 1, 5], + span: [14, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 1, 1], + span: [14, 9, 22], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 1, 3], + span: [14, 25, 26], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 2], + span: [15, 2, 43], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 2, 6], + span: [15, 2, 27], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 2, 1], + span: [15, 28, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 2, 3], + span: [15, 41, 42], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1], + span: [19, 0, 21, 1], + leading_comments: " The request message containing the actor name.\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 1], + span: [19, 8, 19], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0], + span: [20, 2, 72], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 5], + span: [20, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 1], + span: [20, 9, 13], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 3], + span: [20, 16, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 8], + span: [20, 18, 71], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 8, 9999], + span: [20, 20, 69], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2], + span: [24, 0, 27, 1], + leading_comments: " The response message containing the pong\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 1], + span: [24, 8, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0], + span: [25, 2, 21], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 5], + span: [25, 2, 8], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 1], + span: [25, 9, 16], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 0, 3], + span: [25, 19, 20], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1], + span: [26, 2, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 6], + span: [26, 2, 27], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 1], + span: [26, 28, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 2, 2, 1, 3], + span: [26, 36, 37], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0], + span: [30, 0, 45, 1], + leading_comments: " The PingPong actor service definition.\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 1], + span: [30, 8, 21], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0], + span: [32, 2, 37, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 1], + span: [32, 6, 10], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 2], + span: [32, 11, 22], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 3], + span: ~c" !*", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4], + span: [33, 4, 36, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4, 72_295_728], + span: [33, 4, 36, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1], + span: [40, 2, 44, 3], + leading_comments: " Get Pong Message\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 1], + span: [40, 6, 10], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 2], + span: ~c"(\v ", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 3], + span: ~c"(+8", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4], + span: [41, 4, 43, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4, 72_295_728], + span: [41, 4, 43, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + } + ], + __unknown_fields__: [] + }, + public_dependency: [], + weak_dependency: [], + syntax: "proto3", + edition: nil, + __unknown_fields__: [] + } + end + + rpc(:Ping, Pinger.PingRequest, Pinger.PongReply, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/ping/{name}"}, + __unknown_fields__: [] + } + } + }) + + rpc(:Pong, Google.Protobuf.Empty, Pinger.PingPongState, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/pong/{name}"}, + __unknown_fields__: [] + } + } + }) +end + +defmodule Pinger.PingPongActor.ActorDispatcher do + @moduledoc since: "1.2.1" + use GRPC.Server, service: Pinger.PingPongActor.Service, http_transcode: true + + alias Sidecar.GRPC.Dispatcher + + @spec ping(Pinger.PingRequest.t(), GRPC.Server.Stream.t()) :: Pinger.PongReply.t() + def ping(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "PingPongActor", + action_name: "Ping", + input: message, + stream: stream, + descriptor: Pinger.PingPongActor.Service.descriptor() + } + + Dispatcher.dispatch(request) + end + + @spec pong(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: Pinger.PingPongState.t() + def pong(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "PingPongActor", + action_name: "Pong", + input: message, + stream: stream, + descriptor: Pinger.PingPongActor.Service.descriptor() + } + + Dispatcher.dispatch(request) + end +end + +defmodule Sidecar.GRPC.ProxyEndpoint do + @moduledoc false + use GRPC.Endpoint + + intercept(GRPC.Server.Interceptors.Logger) + + services = [ + Pinger.PingPongActor.ActorDispatcher + ] + + services = + [ + Sidecar.GRPC.Reflection.Server.V1, + Sidecar.GRPC.Reflection.Server.V1Alpha, + Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher + ] ++ services + + run(services) +end + +defmodule Sidecar.GRPC.ServiceResolver do + @moduledoc since: "1.2.1" + + @actors [ + { + "PingPongActor", + %{ + service_name: "Pinger.PingPongActor", + service_module: Pinger.PingPongActor.Service + } + } + ] + + def has_actor?(actor_name) do + Enum.any?(@actors, fn {name, _} -> actor_name == name end) + end + + def get_descriptor(actor_name) do + actor_attributes = + Enum.filter(@actors, fn {name, _} -> actor_name == name end) + |> Enum.map(fn {_name, attributes} -> attributes end) + |> List.first() + + mod = Map.get(actor_attributes, :service_module) + + mod.descriptor() + |> Map.get(:service) + |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> + actor_name == name + end) + |> List.first() + end +end + +defmodule Sidecar.GRPC.Reflection.Server do + @moduledoc since: "1.2.1" + + defmodule V1 do + use GrpcReflection.Server, + version: :v1, + services: [ + Pinger.PingPongActor.Service + ] + end + + defmodule V1Alpha do + use GrpcReflection.Server, + version: :v1alpha, + services: [ + Pinger.PingPongActor.Service + ] + end +end \ No newline at end of file diff --git a/priv/protos/pinger.example b/priv/protos/pinger.proto similarity index 100% rename from priv/protos/pinger.example rename to priv/protos/pinger.proto From d04fc11bc3d45c397566cc37ee340afc95de93f3 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Tue, 4 Jun 2024 18:55:27 -0300 Subject: [PATCH 33/48] Refactor. Move package --- compile-pb.sh | 2 +- lib/sidecar/grpc/dispatcher.ex | 95 +- lib/spawn/actors/actor.pb.ex | 1202 ----------- .../protocol/actors/healthcheck.pb.ex | 125 -- lib/spawn/actors/extensions.pb.ex | 10 - lib/spawn/actors/protocol.pb.ex | 1892 ----------------- lib/spawn/actors/state.pb.ex | 92 - .../functions/protocol/actors/actor.pb.ex | 0 .../protocol/actors/extensions.pb.ex | 0 .../protocol}/actors/healthcheck.pb.ex | 7 +- .../functions/protocol/actors/protocol.pb.ex | 0 .../functions/protocol/actors/state.pb.ex | 0 priv/protos/modules/pinger.pb.ex | 30 +- priv/protos/pinger.proto | 15 +- 14 files changed, 94 insertions(+), 3376 deletions(-) delete mode 100644 lib/spawn/actors/actor.pb.ex delete mode 100644 lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex delete mode 100644 lib/spawn/actors/extensions.pb.ex delete mode 100644 lib/spawn/actors/protocol.pb.ex delete mode 100644 lib/spawn/actors/state.pb.ex rename lib/spawn/{actors => }/eigr/functions/protocol/actors/actor.pb.ex (100%) rename lib/spawn/{actors => }/eigr/functions/protocol/actors/extensions.pb.ex (100%) rename lib/spawn/{ => eigr/functions/protocol}/actors/healthcheck.pb.ex (99%) rename lib/spawn/{actors => }/eigr/functions/protocol/actors/protocol.pb.ex (100%) rename lib/spawn/{actors => }/eigr/functions/protocol/actors/state.pb.ex (100%) diff --git a/compile-pb.sh b/compile-pb.sh index 986a04af..a7c42984 100755 --- a/compile-pb.sh +++ b/compile-pb.sh @@ -20,6 +20,6 @@ protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/pr protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/actor.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/protocol.proto protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/state.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/healthcheck.proto +#protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/healthcheck.proto #protoc --elixir_out=gen_descriptors=true:./lib/spawn/cloudevents --proto_path=priv/protos/io/cloudevents/v1 priv/protos/io/cloudevents/v1/spec.proto \ No newline at end of file diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 322f5869..4ff74c33 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -130,32 +130,74 @@ defmodule Sidecar.GRPC.Dispatcher do end defp dispatch_sync(system_name, actor_name, action_name, message, stream) do - build_actor_id(system_name, actor_name, message) - |> build_request(system_name, action_name, message, async: false) - |> invoke_request() - |> case do - {:ok, response} -> - Server.send_reply(stream, response) - - error -> + with {:actor_id, actor_id} <- {:actor_id, build_actor_id(system_name, actor_name, message)}, + {:request, {:ok, request}} <- + {:request, build_request(actor_id, system_name, action_name, message, async: false)}, + {:response, {:ok, response}} <- {:response, invoke_request(request)} do + Server.send_reply(stream, response) + else + {:actor_id, {:not_found, _}} -> + log_and_raise_error( + :warning, + "Actor Not Found. The Actor probably does not exist or not implemented or the request params are incorrect!", + GRPC.Status.not_found() + ) + + {:actor_id, error} -> log_and_raise_error( - "Failure during Actor processing. Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + :error, + "Failed to build actor ID for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) + + {:request, error} -> + log_and_raise_error( + :error, + "Failed to build request for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.failed_precondition() + ) + + {:response, error} -> + log_and_raise_error( + :error, + "Failed to invoke request for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", GRPC.Status.unknown() ) end end defp dispatch_async(system_name, actor_name, action_name, message, stream) do - build_actor_id(system_name, actor_name, message) - |> build_request(system_name, action_name, message, async: true) - |> invoke_request() - |> case do - {:ok, :async} -> - Server.send_reply(stream, %{}) - - error -> + with {:actor_id, actor_id} <- {:actor_id, build_actor_id(system_name, actor_name, message)}, + {:request, {:ok, request}} <- + {:request, build_request(actor_id, system_name, action_name, message, async: true)}, + {:response, {:ok, :async}} <- {:response, invoke_request(request)} do + Server.send_reply(stream, %{}) + else + {:actor_id, {:not_found, _}} -> log_and_raise_error( - "Failure during Actor processing. Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + :warning, + "Actor Not Found. The Actor probably does not exist or not implemented or the request params are incorrect!", + GRPC.Status.not_found() + ) + + {:actor_id, error} -> + log_and_raise_error( + :error, + "Failed to build actor ID for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) + + {:request, error} -> + log_and_raise_error( + :error, + "Failed to build request for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) + + {:response, error} -> + log_and_raise_error( + :error, + "Failed to invoke request for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", GRPC.Status.unknown() ) end @@ -166,13 +208,12 @@ defmodule Sidecar.GRPC.Dispatcher do ActorRegistry.lookup(%ActorId{system: system_name, name: actor_name}) do build_actor_id_from_settings(system_name, actor_name, actor_settings, message) else - {:not_found, []} -> - Logger.warning( - "Actor Not Found. The Actor probably does not exist or not implemented or the request params are incorrect!" + {:not_found, _} -> + log_and_raise_error( + :warning, + "Actor Not Found. The Actor probably does not exist or not implemented or the request params are incorrect!", + GRPC.Status.not_found() ) - - raise ArgumentError, - "Actor Not Found. The id of this Actor does not exist!" end end @@ -234,12 +275,12 @@ defmodule Sidecar.GRPC.Dispatcher do defp invoke_request(request), do: CallerProducer.invoke(request) - defp log_and_raise_error(message, status) do - Logger.error(message) + defp log_and_raise_error(level, message, status) do + Logger.log(level, message) raise GRPC.RPCError, status: status, message: message end defp handle_error(message, status) do - log_and_raise_error(message, status) + log_and_raise_error(:error, message, status) end end diff --git a/lib/spawn/actors/actor.pb.ex b/lib/spawn/actors/actor.pb.ex deleted file mode 100644 index 48a9ac1f..00000000 --- a/lib/spawn/actors/actor.pb.ex +++ /dev/null @@ -1,1202 +0,0 @@ -defmodule Eigr.Functions.Protocol.Actors.Kind do - @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.EnumDescriptorProto{ - __unknown_fields__: [], - name: "Kind", - options: nil, - reserved_name: [], - reserved_range: [], - value: [ - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "UNKNOW_KIND", - number: 0, - options: nil - }, - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "NAMED", - number: 1, - options: nil - }, - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "UNNAMED", - number: 2, - options: nil - }, - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "POOLED", - number: 3, - options: nil - }, - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "PROXY", - number: 4, - options: nil - } - ] - } - end - - field(:UNKNOW_KIND, 0) - field(:NAMED, 1) - field(:UNNAMED, 2) - field(:POOLED, 3) - field(:PROXY, 4) -end - -defmodule Eigr.Functions.Protocol.Actors.Registry.ActorsEntry do - @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor" - } - ], - name: "ActorsEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - end - - field(:key, 1, type: :string) - field(:value, 2, type: Eigr.Functions.Protocol.Actors.Actor) -end - -defmodule Eigr.Functions.Protocol.Actors.Registry do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actors", - label: :LABEL_REPEATED, - name: "actors", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Registry.ActorsEntry" - } - ], - name: "Registry", - nested_type: [ - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor" - } - ], - name: "ActorsEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - ], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:actors, 1, - repeated: true, - type: Eigr.Functions.Protocol.Actors.Registry.ActorsEntry, - map: true - ) -end - -defmodule Eigr.Functions.Protocol.Actors.ActorSystem do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "name", - label: :LABEL_OPTIONAL, - name: "name", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "registry", - label: :LABEL_OPTIONAL, - name: "registry", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Registry" - } - ], - name: "ActorSystem", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:name, 1, type: :string) - field(:registry, 2, type: Eigr.Functions.Protocol.Actors.Registry) -end - -defmodule Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "timeout", - label: :LABEL_OPTIONAL, - name: "timeout", - number: 1, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.TimeoutStrategy" - } - ], - name: "ActorSnapshotStrategy", - nested_type: [], - oneof_decl: [ - %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], - name: "strategy", - options: nil - } - ], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - oneof(:strategy, 0) - - field(:timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0) -end - -defmodule Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "timeout", - label: :LABEL_OPTIONAL, - name: "timeout", - number: 1, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.TimeoutStrategy" - } - ], - name: "ActorDeactivationStrategy", - nested_type: [], - oneof_decl: [ - %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], - name: "strategy", - options: nil - } - ], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - oneof(:strategy, 0) - - field(:timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0) -end - -defmodule Eigr.Functions.Protocol.Actors.TimeoutStrategy do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "timeout", - label: :LABEL_OPTIONAL, - name: "timeout", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT64, - type_name: nil - } - ], - name: "TimeoutStrategy", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:timeout, 1, type: :int64) -end - -defmodule Eigr.Functions.Protocol.Actors.Action do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "name", - label: :LABEL_OPTIONAL, - name: "name", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "Action", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:name, 1, type: :string) -end - -defmodule Eigr.Functions.Protocol.Actors.FixedTimerAction do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "seconds", - label: :LABEL_OPTIONAL, - name: "seconds", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "action", - label: :LABEL_OPTIONAL, - name: "action", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Action" - } - ], - name: "FixedTimerAction", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:seconds, 1, type: :int32) - field(:action, 2, type: Eigr.Functions.Protocol.Actors.Action) -end - -defmodule Eigr.Functions.Protocol.Actors.ActorState.TagsEntry do - @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "TagsEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - end - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Eigr.Functions.Protocol.Actors.ActorState do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "tags", - label: :LABEL_REPEATED, - name: "tags", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState.TagsEntry" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "state", - label: :LABEL_OPTIONAL, - name: "state", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" - } - ], - name: "ActorState", - nested_type: [ - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "TagsEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - ], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:tags, 1, - repeated: true, - type: Eigr.Functions.Protocol.Actors.ActorState.TagsEntry, - map: true - ) - - field(:state, 2, type: Google.Protobuf.Any) -end - -defmodule Eigr.Functions.Protocol.Actors.Metadata.TagsEntry do - @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "TagsEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - end - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Eigr.Functions.Protocol.Actors.Metadata do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "channelGroup", - label: :LABEL_REPEATED, - name: "channel_group", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Channel" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "tags", - label: :LABEL_REPEATED, - name: "tags", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Metadata.TagsEntry" - } - ], - name: "Metadata", - nested_type: [ - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "TagsEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - ], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:channel_group, 1, - repeated: true, - type: Eigr.Functions.Protocol.Actors.Channel, - json_name: "channelGroup" - ) - - field(:tags, 2, - repeated: true, - type: Eigr.Functions.Protocol.Actors.Metadata.TagsEntry, - map: true - ) -end - -defmodule Eigr.Functions.Protocol.Actors.Channel do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "topic", - label: :LABEL_OPTIONAL, - name: "topic", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "action", - label: :LABEL_OPTIONAL, - name: "action", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "Channel", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:topic, 1, type: :string) - field(:action, 2, type: :string) -end - -defmodule Eigr.Functions.Protocol.Actors.ActorSettings do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "kind", - label: :LABEL_OPTIONAL, - name: "kind", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_ENUM, - type_name: ".eigr.functions.protocol.actors.Kind" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "stateful", - label: :LABEL_OPTIONAL, - name: "stateful", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_BOOL, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "snapshotStrategy", - label: :LABEL_OPTIONAL, - name: "snapshot_strategy", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSnapshotStrategy" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "deactivationStrategy", - label: :LABEL_OPTIONAL, - name: "deactivation_strategy", - number: 4, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorDeactivationStrategy" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "minPoolSize", - label: :LABEL_OPTIONAL, - name: "min_pool_size", - number: 5, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "maxPoolSize", - label: :LABEL_OPTIONAL, - name: "max_pool_size", - number: 6, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil - } - ], - name: "ActorSettings", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:kind, 1, type: Eigr.Functions.Protocol.Actors.Kind, enum: true) - field(:stateful, 2, type: :bool) - - field(:snapshot_strategy, 3, - type: Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy, - json_name: "snapshotStrategy" - ) - - field(:deactivation_strategy, 4, - type: Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy, - json_name: "deactivationStrategy" - ) - - field(:min_pool_size, 5, type: :int32, json_name: "minPoolSize") - field(:max_pool_size, 6, type: :int32, json_name: "maxPoolSize") -end - -defmodule Eigr.Functions.Protocol.Actors.ActorId do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "name", - label: :LABEL_OPTIONAL, - name: "name", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "system", - label: :LABEL_OPTIONAL, - name: "system", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "parent", - label: :LABEL_OPTIONAL, - name: "parent", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "ActorId", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:name, 1, type: :string) - field(:system, 2, type: :string) - field(:parent, 3, type: :string) -end - -defmodule Eigr.Functions.Protocol.Actors.Actor do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "id", - label: :LABEL_OPTIONAL, - name: "id", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "state", - label: :LABEL_OPTIONAL, - name: "state", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "metadata", - label: :LABEL_OPTIONAL, - name: "metadata", - number: 6, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Metadata" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "settings", - label: :LABEL_OPTIONAL, - name: "settings", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSettings" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actions", - label: :LABEL_REPEATED, - name: "actions", - number: 4, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Action" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "timerActions", - label: :LABEL_REPEATED, - name: "timer_actions", - number: 5, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.FixedTimerAction" - } - ], - name: "Actor", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:id, 1, type: Eigr.Functions.Protocol.Actors.ActorId) - field(:state, 2, type: Eigr.Functions.Protocol.Actors.ActorState) - field(:metadata, 6, type: Eigr.Functions.Protocol.Actors.Metadata) - field(:settings, 3, type: Eigr.Functions.Protocol.Actors.ActorSettings) - field(:actions, 4, repeated: true, type: Eigr.Functions.Protocol.Actors.Action) - - field(:timer_actions, 5, - repeated: true, - type: Eigr.Functions.Protocol.Actors.FixedTimerAction, - json_name: "timerActions" - ) -end diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex deleted file mode 100644 index bd087980..00000000 --- a/lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex +++ /dev/null @@ -1,125 +0,0 @@ -defmodule Eigr.Functions.Protocol.Actors.Healthcheck.Status do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, - name: "status", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "details", - label: :LABEL_OPTIONAL, - name: "details", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "updatedAt", - label: :LABEL_OPTIONAL, - name: "updated_at", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp" - } - ], - name: "Status", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field :status, 1, type: :string - field :details, 2, type: :string - field :updated_at, 3, type: Google.Protobuf.Timestamp, json_name: "updatedAt" -end -defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, - name: "status", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.healthcheck.Status" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "previousStatus", - label: :LABEL_REPEATED, - name: "previous_status", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.healthcheck.Status" - } - ], - name: "HealthCheckState", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field :status, 1, type: Eigr.Functions.Protocol.Actors.Healthcheck.Status - - field :previous_status, 2, - repeated: true, - type: Eigr.Functions.Protocol.Actors.Healthcheck.Status, - json_name: "previousStatus" -end diff --git a/lib/spawn/actors/extensions.pb.ex b/lib/spawn/actors/extensions.pb.ex deleted file mode 100644 index 7e072be5..00000000 --- a/lib/spawn/actors/extensions.pb.ex +++ /dev/null @@ -1,10 +0,0 @@ -defmodule Eigr.Functions.Protocol.Actors.PbExtension do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - extend(Google.Protobuf.FieldOptions, :actor_id, 9999, - optional: true, - type: :bool, - json_name: "actorId" - ) -end diff --git a/lib/spawn/actors/protocol.pb.ex b/lib/spawn/actors/protocol.pb.ex deleted file mode 100644 index 03084a56..00000000 --- a/lib/spawn/actors/protocol.pb.ex +++ /dev/null @@ -1,1892 +0,0 @@ -defmodule Eigr.Functions.Protocol.Status do - @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.EnumDescriptorProto{ - __unknown_fields__: [], - name: "Status", - options: nil, - reserved_name: [], - reserved_range: [], - value: [ - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "UNKNOWN", - number: 0, - options: nil - }, - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "OK", - number: 1, - options: nil - }, - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "ACTOR_NOT_FOUND", - number: 2, - options: nil - }, - %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], - name: "ERROR", - number: 3, - options: nil - } - ] - } - end - - field(:UNKNOWN, 0) - field(:OK, 1) - field(:ACTOR_NOT_FOUND, 2) - field(:ERROR, 3) -end - -defmodule Eigr.Functions.Protocol.Context.MetadataEntry do - @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "MetadataEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - end - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Eigr.Functions.Protocol.Context.TagsEntry do - @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "TagsEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - end - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Eigr.Functions.Protocol.Context do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "state", - label: :LABEL_OPTIONAL, - name: "state", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "metadata", - label: :LABEL_REPEATED, - name: "metadata", - number: 4, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context.MetadataEntry" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "tags", - label: :LABEL_REPEATED, - name: "tags", - number: 5, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context.TagsEntry" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "caller", - label: :LABEL_OPTIONAL, - name: "caller", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "self", - label: :LABEL_OPTIONAL, - name: "self", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" - } - ], - name: "Context", - nested_type: [ - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "MetadataEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - }, - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "TagsEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - ], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:state, 1, type: Google.Protobuf.Any) - - field(:metadata, 4, - repeated: true, - type: Eigr.Functions.Protocol.Context.MetadataEntry, - map: true - ) - - field(:tags, 5, repeated: true, type: Eigr.Functions.Protocol.Context.TagsEntry, map: true) - field(:caller, 2, type: Eigr.Functions.Protocol.Actors.ActorId) - field(:self, 3, type: Eigr.Functions.Protocol.Actors.ActorId) -end - -defmodule Eigr.Functions.Protocol.Noop do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [], - name: "Noop", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end -end - -defmodule Eigr.Functions.Protocol.JSONType do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "content", - label: :LABEL_OPTIONAL, - name: "content", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "JSONType", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:content, 1, type: :string) -end - -defmodule Eigr.Functions.Protocol.RegistrationRequest do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceInfo", - label: :LABEL_OPTIONAL, - name: "service_info", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.ServiceInfo" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actorSystem", - label: :LABEL_OPTIONAL, - name: "actor_system", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem" - } - ], - name: "RegistrationRequest", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:service_info, 1, type: Eigr.Functions.Protocol.ServiceInfo, json_name: "serviceInfo") - - field(:actor_system, 2, - type: Eigr.Functions.Protocol.Actors.ActorSystem, - json_name: "actorSystem" - ) -end - -defmodule Eigr.Functions.Protocol.RegistrationResponse do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, - name: "status", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "proxyInfo", - label: :LABEL_OPTIONAL, - name: "proxy_info", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.ProxyInfo" - } - ], - name: "RegistrationResponse", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) - field(:proxy_info, 2, type: Eigr.Functions.Protocol.ProxyInfo, json_name: "proxyInfo") -end - -defmodule Eigr.Functions.Protocol.ServiceInfo do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceName", - label: :LABEL_OPTIONAL, - name: "service_name", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceVersion", - label: :LABEL_OPTIONAL, - name: "service_version", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceRuntime", - label: :LABEL_OPTIONAL, - name: "service_runtime", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "supportLibraryName", - label: :LABEL_OPTIONAL, - name: "support_library_name", - number: 4, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "supportLibraryVersion", - label: :LABEL_OPTIONAL, - name: "support_library_version", - number: 5, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "protocolMajorVersion", - label: :LABEL_OPTIONAL, - name: "protocol_major_version", - number: 6, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "protocolMinorVersion", - label: :LABEL_OPTIONAL, - name: "protocol_minor_version", - number: 7, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil - } - ], - name: "ServiceInfo", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:service_name, 1, type: :string, json_name: "serviceName") - field(:service_version, 2, type: :string, json_name: "serviceVersion") - field(:service_runtime, 3, type: :string, json_name: "serviceRuntime") - field(:support_library_name, 4, type: :string, json_name: "supportLibraryName") - field(:support_library_version, 5, type: :string, json_name: "supportLibraryVersion") - field(:protocol_major_version, 6, type: :int32, json_name: "protocolMajorVersion") - field(:protocol_minor_version, 7, type: :int32, json_name: "protocolMinorVersion") -end - -defmodule Eigr.Functions.Protocol.SpawnRequest do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actors", - label: :LABEL_REPEATED, - name: "actors", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" - } - ], - name: "SpawnRequest", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorId) -end - -defmodule Eigr.Functions.Protocol.SpawnResponse do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, - name: "status", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus" - } - ], - name: "SpawnResponse", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) -end - -defmodule Eigr.Functions.Protocol.ProxyInfo do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "protocolMajorVersion", - label: :LABEL_OPTIONAL, - name: "protocol_major_version", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "protocolMinorVersion", - label: :LABEL_OPTIONAL, - name: "protocol_minor_version", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "proxyName", - label: :LABEL_OPTIONAL, - name: "proxy_name", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "proxyVersion", - label: :LABEL_OPTIONAL, - name: "proxy_version", - number: 4, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "ProxyInfo", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:protocol_major_version, 1, type: :int32, json_name: "protocolMajorVersion") - field(:protocol_minor_version, 2, type: :int32, json_name: "protocolMinorVersion") - field(:proxy_name, 3, type: :string, json_name: "proxyName") - field(:proxy_version, 4, type: :string, json_name: "proxyVersion") -end - -defmodule Eigr.Functions.Protocol.SideEffect do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "request", - label: :LABEL_OPTIONAL, - name: "request", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.InvocationRequest" - } - ], - name: "SideEffect", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:request, 1, type: Eigr.Functions.Protocol.InvocationRequest) -end - -defmodule Eigr.Functions.Protocol.Broadcast do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "channelGroup", - label: :LABEL_OPTIONAL, - name: "channel_group", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 3, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, - name: "noop", - number: 4, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" - } - ], - name: "Broadcast", - nested_type: [], - oneof_decl: [ - %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], - name: "payload", - options: nil - } - ], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - oneof(:payload, 0) - - field(:channel_group, 1, type: :string, json_name: "channelGroup") - field(:value, 3, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 4, type: Eigr.Functions.Protocol.Noop, oneof: 0) -end - -defmodule Eigr.Functions.Protocol.Pipe do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, - name: "actor", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actionName", - label: :LABEL_OPTIONAL, - name: "action_name", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "Pipe", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:actor, 1, type: :string) - field(:action_name, 2, type: :string, json_name: "actionName") -end - -defmodule Eigr.Functions.Protocol.Forward do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, - name: "actor", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actionName", - label: :LABEL_OPTIONAL, - name: "action_name", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "Forward", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:actor, 1, type: :string) - field(:action_name, 2, type: :string, json_name: "actionName") -end - -defmodule Eigr.Functions.Protocol.Workflow do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "broadcast", - label: :LABEL_OPTIONAL, - name: "broadcast", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Broadcast" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "effects", - label: :LABEL_REPEATED, - name: "effects", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.SideEffect" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "pipe", - label: :LABEL_OPTIONAL, - name: "pipe", - number: 3, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Pipe" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "forward", - label: :LABEL_OPTIONAL, - name: "forward", - number: 4, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Forward" - } - ], - name: "Workflow", - nested_type: [], - oneof_decl: [ - %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], - name: "routing", - options: nil - } - ], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - oneof(:routing, 0) - - field(:broadcast, 2, type: Eigr.Functions.Protocol.Broadcast) - field(:effects, 1, repeated: true, type: Eigr.Functions.Protocol.SideEffect) - field(:pipe, 3, type: Eigr.Functions.Protocol.Pipe, oneof: 0) - field(:forward, 4, type: Eigr.Functions.Protocol.Forward, oneof: 0) -end - -defmodule Eigr.Functions.Protocol.InvocationRequest.MetadataEntry do - @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "MetadataEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - end - - field(:key, 1, type: :string) - field(:value, 2, type: :string) -end - -defmodule Eigr.Functions.Protocol.InvocationRequest do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "system", - label: :LABEL_OPTIONAL, - name: "system", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, - name: "actor", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actionName", - label: :LABEL_OPTIONAL, - name: "action_name", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 4, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, - name: "noop", - number: 7, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "async", - label: :LABEL_OPTIONAL, - name: "async", - number: 5, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_BOOL, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "caller", - label: :LABEL_OPTIONAL, - name: "caller", - number: 6, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "metadata", - label: :LABEL_REPEATED, - name: "metadata", - number: 8, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.InvocationRequest.MetadataEntry" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "scheduledTo", - label: :LABEL_OPTIONAL, - name: "scheduled_to", - number: 9, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT64, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "pooled", - label: :LABEL_OPTIONAL, - name: "pooled", - number: 10, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_BOOL, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "registerRef", - label: :LABEL_OPTIONAL, - name: "register_ref", - number: 11, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "InvocationRequest", - nested_type: [ - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, - name: "key", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "MetadataEntry", - nested_type: [], - oneof_decl: [], - options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, - message_set_wire_format: false, - no_standard_descriptor_accessor: false, - uninterpreted_option: [] - }, - reserved_name: [], - reserved_range: [] - } - ], - oneof_decl: [ - %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], - name: "payload", - options: nil - } - ], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - oneof(:payload, 0) - - field(:system, 1, type: Eigr.Functions.Protocol.Actors.ActorSystem) - field(:actor, 2, type: Eigr.Functions.Protocol.Actors.Actor) - field(:action_name, 3, type: :string, json_name: "actionName") - field(:value, 4, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 7, type: Eigr.Functions.Protocol.Noop, oneof: 0) - field(:async, 5, type: :bool) - field(:caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId) - - field(:metadata, 8, - repeated: true, - type: Eigr.Functions.Protocol.InvocationRequest.MetadataEntry, - map: true - ) - - field(:scheduled_to, 9, type: :int64, json_name: "scheduledTo") - field(:pooled, 10, type: :bool) - field(:register_ref, 11, type: :string, json_name: "registerRef") -end - -defmodule Eigr.Functions.Protocol.ActorInvocation do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, - name: "actor", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actionName", - label: :LABEL_OPTIONAL, - name: "action_name", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "currentContext", - label: :LABEL_OPTIONAL, - name: "current_context", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 4, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, - name: "noop", - number: 5, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "caller", - label: :LABEL_OPTIONAL, - name: "caller", - number: 6, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" - } - ], - name: "ActorInvocation", - nested_type: [], - oneof_decl: [ - %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], - name: "payload", - options: nil - } - ], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - oneof(:payload, 0) - - field(:actor, 1, type: Eigr.Functions.Protocol.Actors.ActorId) - field(:action_name, 2, type: :string, json_name: "actionName") - field(:current_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "currentContext") - field(:value, 4, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0) - field(:caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId) -end - -defmodule Eigr.Functions.Protocol.ActorInvocationResponse do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actorName", - label: :LABEL_OPTIONAL, - name: "actor_name", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actorSystem", - label: :LABEL_OPTIONAL, - name: "actor_system", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "updatedContext", - label: :LABEL_OPTIONAL, - name: "updated_context", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 4, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, - name: "noop", - number: 6, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "workflow", - label: :LABEL_OPTIONAL, - name: "workflow", - number: 5, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Workflow" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "checkpoint", - label: :LABEL_OPTIONAL, - name: "checkpoint", - number: 7, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_BOOL, - type_name: nil - } - ], - name: "ActorInvocationResponse", - nested_type: [], - oneof_decl: [ - %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], - name: "payload", - options: nil - } - ], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - oneof(:payload, 0) - - field(:actor_name, 1, type: :string, json_name: "actorName") - field(:actor_system, 2, type: :string, json_name: "actorSystem") - field(:updated_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "updatedContext") - field(:value, 4, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 6, type: Eigr.Functions.Protocol.Noop, oneof: 0) - field(:workflow, 5, type: Eigr.Functions.Protocol.Workflow) - field(:checkpoint, 7, type: :bool) -end - -defmodule Eigr.Functions.Protocol.InvocationResponse do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, - name: "status", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "system", - label: :LABEL_OPTIONAL, - name: "system", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, - name: "actor", - number: 3, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 4, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, - name: "noop", - number: 5, - oneof_index: 0, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" - } - ], - name: "InvocationResponse", - nested_type: [], - oneof_decl: [ - %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], - name: "payload", - options: nil - } - ], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - oneof(:payload, 0) - - field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) - field(:system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem) - field(:actor, 3, type: Eigr.Functions.Protocol.Actors.Actor) - field(:value, 4, type: Google.Protobuf.Any, oneof: 0) - field(:noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0) -end - -defmodule Eigr.Functions.Protocol.RequestStatus do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, - name: "status", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_ENUM, - type_name: ".eigr.functions.protocol.Status" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "message", - label: :LABEL_OPTIONAL, - name: "message", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil - } - ], - name: "RequestStatus", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:status, 1, type: Eigr.Functions.Protocol.Status, enum: true) - field(:message, 2, type: :string) -end diff --git a/lib/spawn/actors/state.pb.ex b/lib/spawn/actors/state.pb.ex deleted file mode 100644 index 4a8db315..00000000 --- a/lib/spawn/actors/state.pb.ex +++ /dev/null @@ -1,92 +0,0 @@ -defmodule Eigr.Functions.Protocol.State.Revision do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, - name: "value", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_INT64, - type_name: nil - } - ], - name: "Revision", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:value, 1, type: :int64) -end - -defmodule Eigr.Functions.Protocol.State.Checkpoint do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [ - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "revision", - label: :LABEL_OPTIONAL, - name: "revision", - number: 1, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.state.Revision" - }, - %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "state", - label: :LABEL_OPTIONAL, - name: "state", - number: 2, - oneof_index: nil, - options: nil, - proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState" - } - ], - name: "Checkpoint", - nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] - } - end - - field(:revision, 1, type: Eigr.Functions.Protocol.State.Revision) - field(:state, 2, type: Eigr.Functions.Protocol.Actors.ActorState) -end diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex b/lib/spawn/eigr/functions/protocol/actors/actor.pb.ex similarity index 100% rename from lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex rename to lib/spawn/eigr/functions/protocol/actors/actor.pb.ex diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex b/lib/spawn/eigr/functions/protocol/actors/extensions.pb.ex similarity index 100% rename from lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex rename to lib/spawn/eigr/functions/protocol/actors/extensions.pb.ex diff --git a/lib/spawn/actors/healthcheck.pb.ex b/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex similarity index 99% rename from lib/spawn/actors/healthcheck.pb.ex rename to lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex index 73a3ef69..b0625835 100644 --- a/lib/spawn/actors/healthcheck.pb.ex +++ b/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex @@ -254,6 +254,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, uninterpreted_option: [], __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ @@ -278,6 +279,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, uninterpreted_option: [], __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ @@ -319,9 +321,9 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do swift_prefix: nil, php_class_prefix: nil, php_namespace: nil, - php_generic_services: false, php_metadata_namespace: nil, ruby_package: nil, + features: nil, uninterpreted_option: [], __pb_extensions__: %{}, __unknown_fields__: [] @@ -814,7 +816,8 @@ defmodule Sidecar.GRPC.ProxyEndpoint do services = [ Sidecar.GRPC.Reflection.Server.V1, - Sidecar.GRPC.Reflection.Server.V1Alpha + Sidecar.GRPC.Reflection.Server.V1Alpha, + Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher ] ++ services run(services) diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex b/lib/spawn/eigr/functions/protocol/actors/protocol.pb.ex similarity index 100% rename from lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex rename to lib/spawn/eigr/functions/protocol/actors/protocol.pb.ex diff --git a/lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex b/lib/spawn/eigr/functions/protocol/actors/state.pb.ex similarity index 100% rename from lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex rename to lib/spawn/eigr/functions/protocol/actors/state.pb.ex diff --git a/priv/protos/modules/pinger.pb.ex b/priv/protos/modules/pinger.pb.ex index 05660dcc..8bd649ed 100644 --- a/priv/protos/modules/pinger.pb.ex +++ b/priv/protos/modules/pinger.pb.ex @@ -427,7 +427,7 @@ defmodule Pinger.PingPongActor.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 45, 1], + span: [0, 0, 40, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -627,7 +627,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0], - span: [20, 2, 72], + span: [20, 2, 70], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -659,7 +659,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 8], - span: [20, 18, 71], + span: [20, 18, 69], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -667,7 +667,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 8, 9999], - span: [20, 20, 69], + span: [20, 19, 68], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -755,7 +755,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0], - span: [30, 0, 45, 1], + span: [30, 0, 40, 1], leading_comments: " The PingPong actor service definition.\n", trailing_comments: nil, leading_detached_comments: [], @@ -771,7 +771,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0], - span: [32, 2, 37, 3], + span: [32, 2, 34, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -795,7 +795,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 3], - span: ~c" !*", + span: ~c" )", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -803,7 +803,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4], - span: [33, 4, 36, 6], + span: [33, 4, 68], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -811,7 +811,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4, 72_295_728], - span: [33, 4, 36, 6], + span: [33, 4, 68], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -819,7 +819,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1], - span: [40, 2, 44, 3], + span: [37, 2, 39, 3], leading_comments: " Get Pong Message\n", trailing_comments: nil, leading_detached_comments: [], @@ -827,7 +827,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 1], - span: [40, 6, 10], + span: [37, 6, 10], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -835,7 +835,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 2], - span: ~c"(\v ", + span: ~c"%\v ", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -843,7 +843,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 3], - span: ~c"(+8", + span: ~c"%*7", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -851,7 +851,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4], - span: [41, 4, 43, 6], + span: [38, 4, 56], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -859,7 +859,7 @@ defmodule Pinger.PingPongActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4, 72_295_728], - span: [41, 4, 43, 6], + span: [38, 4, 56], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], diff --git a/priv/protos/pinger.proto b/priv/protos/pinger.proto index 6678cf44..3c90ff5e 100644 --- a/priv/protos/pinger.proto +++ b/priv/protos/pinger.proto @@ -18,7 +18,7 @@ message PingPongState { // The request message containing the actor name. message PingRequest { - string name = 1 [ (.eigr.functions.protocol.actors.actor_id) = true ]; + string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; } // The response message containing the pong @@ -30,17 +30,12 @@ message PongReply { // The PingPong actor service definition. service PingPongActor { - rpc Ping(PingRequest) returns (PongReply) { - option (google.api.http) = { - post : "/v1/ping/{name}" - body : "*" - }; + rpc Ping(PingRequest) returns(PongReply) { + option(google.api.http) = {post : "/v1/ping/{name}" body : "*"}; } // Get Pong Message - rpc Pong(google.protobuf.Empty) returns (PingPongState) { - option (google.api.http) = { - get : "/v1/pong/{name}" - }; + rpc Pong(google.protobuf.Empty) returns(PingPongState) { + option(google.api.http) = {get : "/v1/pong/{name}"}; } } From 98dd0214aef7b25bc0af8f0a3452e35cb129c5a6 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 5 Jun 2024 11:03:04 -0300 Subject: [PATCH 34/48] Refactor. Remove state from health check actor. Use stateless actor instead --- .../grpc/generators/service_generator.ex | 2 +- .../healthcheck_handler_actordispatcher.ex | 6 +- .../protocol/actors/healthcheck.pb.ex | 256 +++--------------- lib/spawn/utils/any_serializer.ex | 4 +- .../protocol/actors/healthcheck.proto | 13 +- priv/protos/modules/pinger.pb.ex | 2 +- 6 files changed, 47 insertions(+), 236 deletions(-) diff --git a/lib/sidecar/grpc/generators/service_generator.ex b/lib/sidecar/grpc/generators/service_generator.ex index 5b753298..7fe0ea70 100644 --- a/lib/sidecar/grpc/generators/service_generator.ex +++ b/lib/sidecar/grpc/generators/service_generator.ex @@ -29,7 +29,7 @@ defmodule Sidecar.GRPC.Generators.ServiceGenerator do [ Sidecar.GRPC.Reflection.Server.V1, Sidecar.GRPC.Reflection.Server.V1Alpha, - Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher ] ++ services run(services) diff --git a/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex b/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex index c9efdddf..3c8f0c6e 100644 --- a/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex +++ b/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex @@ -1,4 +1,4 @@ -defmodule Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher do +defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher do @moduledoc since: "1.2.1" use GRPC.Server, service: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service, @@ -7,7 +7,7 @@ defmodule Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher do alias Sidecar.GRPC.Dispatcher @spec liveness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState.t() + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply.t() def liveness(message, stream) do request = %{ system: "spawn-system", @@ -22,7 +22,7 @@ defmodule Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher do end @spec readiness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState.t() + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply.t() def readiness(message, stream) do request = %{ system: "spawn-system", diff --git a/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex b/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex index b0625835..3c4c315c 100644 --- a/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex +++ b/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex @@ -62,19 +62,19 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.Status do } end - field :status, 1, type: :string - field :details, 2, type: :string - field :updated_at, 3, type: Google.Protobuf.Timestamp, json_name: "updatedAt" + field(:status, 1, type: :string) + field(:details, 2, type: :string) + field(:updated_at, 3, type: Google.Protobuf.Timestamp, json_name: "updatedAt") end -defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState do +defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - name: "HealthCheckState", + name: "HealthCheckReply", field: [ %Google.Protobuf.FieldDescriptorProto{ name: "status", @@ -89,20 +89,6 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState do json_name: "status", proto3_optional: nil, __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "previous_status", - extendee: nil, - number: 2, - label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.healthcheck.Status", - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "previousStatus", - proto3_optional: nil, - __unknown_fields__: [] } ], nested_type: [], @@ -117,12 +103,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState do } end - field :status, 1, type: Eigr.Functions.Protocol.Actors.Healthcheck.Status - - field :previous_status, 2, - repeated: true, - type: Eigr.Functions.Protocol.Actors.Healthcheck.Status, - json_name: "previousStatus" + field(:status, 1, type: Eigr.Functions.Protocol.Actors.Healthcheck.Status) end defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do @@ -200,7 +181,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do __unknown_fields__: [] }, %Google.Protobuf.DescriptorProto{ - name: "HealthCheckState", + name: "HealthCheckReply", field: [ %Google.Protobuf.FieldDescriptorProto{ name: "status", @@ -215,20 +196,6 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do json_name: "status", proto3_optional: nil, __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "previous_status", - extendee: nil, - number: 2, - label: :LABEL_REPEATED, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.healthcheck.Status", - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "previousStatus", - proto3_optional: nil, - __unknown_fields__: [] } ], nested_type: [], @@ -250,7 +217,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do %Google.Protobuf.MethodDescriptorProto{ name: "Liveness", input_type: ".google.protobuf.Empty", - output_type: ".eigr.functions.protocol.actors.healthcheck.HealthCheckState", + output_type: ".eigr.functions.protocol.actors.healthcheck.HealthCheckReply", options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, @@ -262,7 +229,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do body: "", additional_bindings: [], response_body: "", - pattern: {:get, "/v1/health/liveness"}, + pattern: {:get, "/health/liveness"}, __unknown_fields__: [] } }, @@ -275,7 +242,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do %Google.Protobuf.MethodDescriptorProto{ name: "Readiness", input_type: ".google.protobuf.Empty", - output_type: ".eigr.functions.protocol.actors.healthcheck.HealthCheckState", + output_type: ".eigr.functions.protocol.actors.healthcheck.HealthCheckReply", options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, @@ -287,7 +254,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do body: "", additional_bindings: [], response_body: "", - pattern: {:get, "/v1/health/readiness"}, + pattern: {:get, "/health/readiness"}, __unknown_fields__: [] } }, @@ -332,7 +299,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 38, 1], + span: [0, 0, 35, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -516,7 +483,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1], - span: [18, 0, 21, 1], + span: [18, 0, 47], leading_comments: " The state of HealthCheckActor\n", trailing_comments: nil, leading_detached_comments: [], @@ -532,7 +499,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0], - span: [19, 2, 20], + span: [18, 27, 45], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -540,7 +507,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 6], - span: [19, 2, 8], + span: [18, 27, 33], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -548,7 +515,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 1], - span: [19, 9, 15], + span: [18, 34, 40], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -556,47 +523,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 3], - span: [19, 18, 19], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1], - span: [20, 2, 38], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 4], - span: [20, 2, 10], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 6], - span: [20, 11, 17], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 1], - span: [20, 18, 33], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 1, 3], - span: [20, 36, 37], + span: [18, 43, 44], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -604,7 +531,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0], - span: [24, 0, 38, 1], + span: [21, 0, 35, 1], leading_comments: " The HealthCheck actor service definition.\n", trailing_comments: nil, leading_detached_comments: [], @@ -612,7 +539,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 1], - span: [24, 8, 24], + span: [21, 8, 24], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -620,7 +547,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0], - span: [27, 2, 31, 3], + span: [24, 2, 28, 3], leading_comments: " Get Pong Message\n", trailing_comments: nil, leading_detached_comments: [], @@ -628,7 +555,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 1], - span: [27, 6, 14], + span: [24, 6, 14], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -636,7 +563,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 2], - span: [27, 15, 36], + span: [24, 15, 36], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -644,7 +571,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 3], - span: ~c"\e/?", + span: [24, 47, 63], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -652,7 +579,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4], - span: [28, 4, 30, 6], + span: [25, 4, 27, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -660,7 +587,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4, 72_295_728], - span: [28, 4, 30, 6], + span: [25, 4, 27, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -668,7 +595,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1], - span: [33, 2, 37, 3], + span: [30, 2, 34, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -676,7 +603,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 1], - span: [33, 6, 15], + span: [30, 6, 15], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -684,7 +611,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 2], - span: [33, 16, 37], + span: [30, 16, 37], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -692,7 +619,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 3], - span: ~c"!0@", + span: [30, 48, 64], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -700,7 +627,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4], - span: [34, 4, 36, 6], + span: [31, 4, 33, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -708,7 +635,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4, 72_295_728], - span: [34, 4, 36, 6], + span: [31, 4, 33, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -728,7 +655,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do rpc( :Liveness, Google.Protobuf.Empty, - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState, + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply, %{ http: %{ type: Google.Api.PbExtension, @@ -737,7 +664,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do body: "", additional_bindings: [], response_body: "", - pattern: {:get, "/v1/health/liveness"}, + pattern: {:get, "/health/liveness"}, __unknown_fields__: [] } } @@ -747,7 +674,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do rpc( :Readiness, Google.Protobuf.Empty, - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState, + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply, %{ http: %{ type: Google.Api.PbExtension, @@ -756,123 +683,10 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do body: "", additional_bindings: [], response_body: "", - pattern: {:get, "/v1/health/readiness"}, + pattern: {:get, "/health/readiness"}, __unknown_fields__: [] } } } ) end - -defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher do - @moduledoc since: "1.2.1" - use GRPC.Server, - service: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service, - http_transcode: true - - alias Sidecar.GRPC.Dispatcher - - @spec liveness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState.t() - def liveness(message, stream) do - request = %{ - system: "spawn-system", - actor_name: "HealthCheckActor", - action_name: "Liveness", - input: message, - stream: stream, - descriptor: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service.descriptor() - } - - Dispatcher.dispatch(request) - end - - @spec readiness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckState.t() - def readiness(message, stream) do - request = %{ - system: "spawn-system", - actor_name: "HealthCheckActor", - action_name: "Readiness", - input: message, - stream: stream, - descriptor: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service.descriptor() - } - - Dispatcher.dispatch(request) - end -end - -defmodule Sidecar.GRPC.ProxyEndpoint do - @moduledoc false - use GRPC.Endpoint - - intercept(GRPC.Server.Interceptors.Logger) - - services = [ - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher - ] - - services = - [ - Sidecar.GRPC.Reflection.Server.V1, - Sidecar.GRPC.Reflection.Server.V1Alpha, - Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher - ] ++ services - - run(services) -end - -defmodule Sidecar.GRPC.ServiceResolver do - @moduledoc since: "1.2.1" - - @actors [ - { - "HealthCheckActor", - %{ - service_name: "Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor", - service_module: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service - } - } - ] - - def has_actor?(actor_name) do - Enum.any?(@actors, fn {name, _} -> actor_name == name end) - end - - def get_descriptor(actor_name) do - actor_attributes = - Enum.filter(@actors, fn {name, _} -> actor_name == name end) - |> Enum.map(fn {_name, attributes} -> attributes end) - |> List.first() - - mod = Map.get(actor_attributes, :service_module) - - mod.descriptor() - |> Map.get(:service) - |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> - actor_name == name - end) - |> List.first() - end -end - -defmodule Sidecar.GRPC.Reflection.Server do - @moduledoc since: "1.2.1" - - defmodule V1 do - use GrpcReflection.Server, - version: :v1, - services: [ - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service - ] - end - - defmodule V1Alpha do - use GrpcReflection.Server, - version: :v1alpha, - services: [ - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service - ] - end -end \ No newline at end of file diff --git a/lib/spawn/utils/any_serializer.ex b/lib/spawn/utils/any_serializer.ex index 9ea2e031..2f42a374 100644 --- a/lib/spawn/utils/any_serializer.ex +++ b/lib/spawn/utils/any_serializer.ex @@ -24,6 +24,8 @@ defmodule Spawn.Utils.AnySerializer do |> maybe_unpack_json! end + def unpack_unknown(_), do: nil + defp normalize_package_name(type_url) do type_url |> String.replace("type.googleapis.com/", "") @@ -49,8 +51,6 @@ defmodule Spawn.Utils.AnySerializer do end end - def unpack_unknown(_), do: nil - defp maybe_unpack_json!(%JSONType{} = json) do Jason.decode!(json.content, keys: :atoms) end diff --git a/priv/protos/eigr/functions/protocol/actors/healthcheck.proto b/priv/protos/eigr/functions/protocol/actors/healthcheck.proto index 41204fa6..b9ce324a 100644 --- a/priv/protos/eigr/functions/protocol/actors/healthcheck.proto +++ b/priv/protos/eigr/functions/protocol/actors/healthcheck.proto @@ -16,24 +16,21 @@ message Status { } // The state of HealthCheckActor -message HealthCheckState { - Status status = 1; - repeated Status previous_status = 2; -} +message HealthCheckReply { Status status = 1; } // The HealthCheck actor service definition. service HealthCheckActor { // Get Pong Message - rpc Liveness(google.protobuf.Empty) returns (HealthCheckState) { + rpc Liveness(google.protobuf.Empty) returns (HealthCheckReply) { option (google.api.http) = { - get : "/v1/health/liveness" + get : "/health/liveness" }; } - rpc Readiness(google.protobuf.Empty) returns (HealthCheckState) { + rpc Readiness(google.protobuf.Empty) returns (HealthCheckReply) { option (google.api.http) = { - get : "/v1/health/readiness" + get : "/health/readiness" }; } } \ No newline at end of file diff --git a/priv/protos/modules/pinger.pb.ex b/priv/protos/modules/pinger.pb.ex index 8bd649ed..5742391e 100644 --- a/priv/protos/modules/pinger.pb.ex +++ b/priv/protos/modules/pinger.pb.ex @@ -954,7 +954,7 @@ defmodule Sidecar.GRPC.ProxyEndpoint do [ Sidecar.GRPC.Reflection.Server.V1, Sidecar.GRPC.Reflection.Server.V1Alpha, - Sidecar.Grpc.Healthcheck.HealthcheckHandler.Actordispatcher + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher ] ++ services run(services) From fc40cb8a3c8bd64a81c3260b2570a65e775785b5 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 5 Jun 2024 15:01:37 -0300 Subject: [PATCH 35/48] Add actor entity health checks --- lib/actors/actor/caller_consumer.ex | 142 ++++++++++++++++++ lib/actors/actor/entity/entity.ex | 94 +++++++++++- .../protocol/actors/healthcheck.pb.ex | 6 +- test/actors/actors_test.exs | 34 +++++ 4 files changed, 267 insertions(+), 9 deletions(-) diff --git a/lib/actors/actor/caller_consumer.ex b/lib/actors/actor/caller_consumer.ex index f86cb1d9..21a9b6d5 100644 --- a/lib/actors/actor/caller_consumer.ex +++ b/lib/actors/actor/caller_consumer.ex @@ -235,6 +235,148 @@ defmodule Actors.Actor.CallerConsumer do end end + @doc """ + Performs a readiness check for a given actor identified by `%ActorId{}`. + + This function uses a retry mechanism with exponential backoff, randomization, and a 30-second expiry to handle errors and failures gracefully. + It attempts to check the readiness of the specified actor, logging any errors encountered during the process. + + ## Parameters + + - `id`: An `%ActorId{}` struct that contains: + - `name`: The name of the actor. + - `system`: The name of the system the actor belongs to. + + ## Returns + + - `{:ok, %HealthCheckReply{}}` if the readiness check is successful. The `HealthCheckReply` struct contains: + - `status`: A `HealthcheckStatus` struct with: + - `status`: A string indicating the status, e.g., "OK". + - `details`: A string providing additional details, e.g., "I'm alive!". + - `updated_at`: A `Google.Protobuf.Timestamp` indicating the last update time. + - An error tuple (e.g., `{:error, :noproc}`) if the readiness check fails after all retry attempts. + + ## Examples + + iex> readiness(%ActorId{name: "actor1", system: "system1"}) + {:ok, + %HealthCheckReply{ + status: %HealthcheckStatus{ + status: "OK", + details: "I'm alive!", + updated_at: %Google.Protobuf.Timestamp{seconds: 1717606730} + } + }} + + iex> readiness(%ActorId{name: "nonexistent_actor", system: "system1"}) + {:error, :noproc} + + ## Notes + + The retry mechanism handles the following cases: `:error`, `:exit`, `:noproc`, `:erpc`, `:noconnection`, and `:timeout`. It rescues only `ErlangError`. + + The readiness check is performed by calling `ActorEntity.readiness/2` on the actor reference obtained through `do_lookup_action/4`. + + Any errors during the readiness check are logged with a message indicating the actor's name and the error encountered. + """ + @spec readiness(ActorId.t()) :: {:ok, HealthCheckReply.t()} | {:error, any()} + def readiness(%ActorId{name: actor_name, system: system_name} = id) do + retry with: exponential_backoff() |> randomize |> expiry(30_000), + atoms: [:error, :exit, :noproc, :erpc, :noconnection, :timeout], + rescue_only: [ErlangError] do + try do + do_lookup_action( + system_name, + {false, system_name, actor_name, id}, + nil, + fn actor_ref, _actor_ref_id -> + ActorEntity.readiness(actor_ref) + end + ) + rescue + e -> + Logger.error("Failure to make a call to actor #{inspect(actor_name)} #{inspect(e)}") + + reraise e, __STACKTRACE__ + end + after + result -> result + else + error -> error + end + end + + @doc """ + Performs a liveness check for a given actor identified by `%ActorId{}`. + + This function uses a retry mechanism with exponential backoff, randomization, and a 30-second expiry to handle errors and failures gracefully. + It attempts to check the liveness of the specified actor, logging any errors encountered during the process. + + ## Parameters + + - `id`: An `%ActorId{}` struct that contains: + - `name`: The name of the actor. + - `system`: The name of the system the actor belongs to. + + ## Returns + + - `{:ok, %HealthCheckReply{}}` if the liveness check is successful. The `HealthCheckReply` struct contains: + - `status`: A `HealthcheckStatus` struct with: + - `status`: A string indicating the status, e.g., "OK". + - `details`: A string providing additional details, e.g., "I'm alive!". + - `updated_at`: A `Google.Protobuf.Timestamp` indicating the last update time. + - An error tuple (e.g., `{:error, :noproc}`) if the liveness check fails after all retry attempts. + + ## Examples + + iex> liveness(%ActorId{name: "actor1", system: "system1"}) + {:ok, + %HealthCheckReply{ + status: %HealthcheckStatus{ + status: "OK", + details: "I'm still alive!", + updated_at: %Google.Protobuf.Timestamp{seconds: 1717606837} + } + }} + + iex> liveness(%ActorId{name: "nonexistent_actor", system: "system1"}) + {:error, :noproc} + + ## Notes + + The retry mechanism handles the following cases: `:error`, `:exit`, `:noproc`, `:erpc`, `:noconnection`, and `:timeout`. It rescues only `ErlangError`. + + The liveness check is performed by calling `ActorEntity.liveness/2` on the actor reference obtained through `do_lookup_action/4`. + + Any errors during the liveness check are logged with a message indicating the actor's name and the error encountered. + """ + @spec liveness(ActorId.t()) :: {:ok, HealthCheckReply.t()} | {:error, any()} + def liveness(%ActorId{name: actor_name, system: system_name} = id) do + retry with: exponential_backoff() |> randomize |> expiry(30_000), + atoms: [:error, :exit, :noproc, :erpc, :noconnection, :timeout], + rescue_only: [ErlangError] do + try do + do_lookup_action( + system_name, + {false, system_name, actor_name, id}, + nil, + fn actor_ref, _actor_ref_id -> + ActorEntity.liveness(actor_ref) + end + ) + rescue + e -> + Logger.error("Failure to make a call to actor #{inspect(actor_name)} #{inspect(e)}") + + reraise e, __STACKTRACE__ + end + after + result -> result + else + error -> error + end + end + @doc """ Spawns an actor or a group of actors based on the provided `SpawnRequest`. diff --git a/lib/actors/actor/entity/entity.ex b/lib/actors/actor/entity/entity.ex index c9f54f83..a42e850d 100644 --- a/lib/actors/actor/entity/entity.ex +++ b/lib/actors/actor/entity/entity.ex @@ -66,13 +66,15 @@ defmodule Actors.Actor.Entity do require Logger alias Actors.Actor.StateManager - alias Actors.Actor.Entity.{EntityState, Lifecycle, Invocation} + alias Actors.Actor.Entity.EntityState + alias Actors.Actor.Entity.Lifecycle + alias Actors.Actor.Entity.Invocation - alias Eigr.Functions.Protocol.Actors.{ - Actor, - ActorId, - ActorState - } + alias Eigr.Functions.Protocol.Actors.Actor + alias Eigr.Functions.Protocol.Actors.ActorId + alias Eigr.Functions.Protocol.Actors.ActorState + alias Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply + alias Eigr.Functions.Protocol.Actors.Healthcheck.Status, as: HealthcheckStatus alias Eigr.Functions.Protocol.State.Checkpoint alias Eigr.Functions.Protocol.State.Revision @@ -141,6 +143,12 @@ defmodule Actors.Actor.Entity do :get_state -> do_handle_get_state(action, from, state) + :readiness -> + do_handle_readiness(action, from, state) + + :liveness -> + do_handle_liveness(action, from, state) + :checkpoint -> do_handle_checkpoint(action, from, state) @@ -149,6 +157,48 @@ defmodule Actors.Actor.Entity do end end + defp do_handle_readiness( + _action, + _from, + %EntityState{ + actor: %Actor{} = _actor + } = state + ) do + {:reply, + {:ok, + %HealthCheckReply{ + status: %HealthcheckStatus{ + status: "OK", + details: "I'm alive!", + updated_at: %Google.Protobuf.Timestamp{ + seconds: DateTime.to_unix(DateTime.utc_now(:second)) + } + } + }}, state} + |> return_and_maybe_hibernate() + end + + defp do_handle_liveness( + _action, + _from, + %EntityState{ + actor: %Actor{} = _actor + } = state + ) do + {:reply, + {:ok, + %HealthCheckReply{ + status: %HealthcheckStatus{ + status: "OK", + details: "I'm still alive!", + updated_at: %Google.Protobuf.Timestamp{ + seconds: DateTime.to_unix(DateTime.utc_now(:second)) + } + } + }}, state} + |> return_and_maybe_hibernate() + end + defp do_handle_checkpoint( _action, _from, @@ -360,6 +410,38 @@ defmodule Actors.Actor.Entity do GenServer.call(via(ref), :get_state, timeout) end + @doc """ + Retrieve the health check readiness status. + """ + @spec readiness(any, any) :: {:error, term()} | {:ok, term()} + def readiness(ref, opts \\ []) + + def readiness(ref, opts) when is_pid(ref) do + timeout = Keyword.get(opts, :timeout, @default_call_timeout) + GenServer.call(ref, :readiness, timeout) + end + + def readiness(ref, opts) do + timeout = Keyword.get(opts, :timeout, @default_call_timeout) + GenServer.call(via(ref), :readiness, timeout) + end + + @doc """ + Retrieve the health check liveness status. + """ + @spec readiness(any, any) :: {:error, term()} | {:ok, term()} + def liveness(ref, opts \\ []) + + def liveness(ref, opts) when is_pid(ref) do + timeout = Keyword.get(opts, :timeout, @default_call_timeout) + GenServer.call(ref, :liveness, timeout) + end + + def liveness(ref, opts) do + timeout = Keyword.get(opts, :timeout, @default_call_timeout) + GenServer.call(via(ref), :liveness, timeout) + end + @doc """ Synchronously invokes an Action on an Actor. """ diff --git a/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex b/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex index 3c4c315c..346eaa9a 100644 --- a/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex +++ b/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex @@ -221,7 +221,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, - features: nil, + # features: nil, uninterpreted_option: [], __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ @@ -246,7 +246,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, - features: nil, + # features: nil, uninterpreted_option: [], __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ @@ -290,7 +290,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do php_namespace: nil, php_metadata_namespace: nil, ruby_package: nil, - features: nil, + # features: nil, uninterpreted_option: [], __pb_extensions__: %{}, __unknown_fields__: [] diff --git a/test/actors/actors_test.exs b/test/actors/actors_test.exs index 81c00fcd..ecbc5654 100644 --- a/test/actors/actors_test.exs +++ b/test/actors/actors_test.exs @@ -49,6 +49,40 @@ defmodule ActorsTest do end end + describe "readiness/2" do + test "readiness for a newly registered actor" do + actor_name = "readiness_actor_test_" <> Ecto.UUID.generate() + + actor_entry = build_actor_entry(name: actor_name) + registry = build_registry_with_actors(actors: actor_entry) + system = build_system(registry: registry) + + request = build_registration_request(actor_system: system) + + {:ok, %RegistrationResponse{}} = Actors.register(request) + + assert {:ok, %HealthCheckReply{status: %HealthcheckStatus{}}} = + Actors.readiness(%ActorId{name: actor_name, system: system.name}) + end + end + + describe "liveness/2" do + test "liveness for a newly registered actor" do + actor_name = "liveness_actor_test_" <> Ecto.UUID.generate() + + actor_entry = build_actor_entry(name: actor_name) + registry = build_registry_with_actors(actors: actor_entry) + system = build_system(registry: registry) + + request = build_registration_request(actor_system: system) + + {:ok, %RegistrationResponse{}} = Actors.register(request) + + assert {:ok, %HealthCheckReply{status: %HealthcheckStatus{}}} = + Actors.liveness(%ActorId{name: actor_name, system: system.name}) + end + end + describe "invoke/2" do test "invoke actor function for a newly registered actor" do actor_name = "newly_actor_test_" <> Ecto.UUID.generate() From 0932241ad9dc31b36189eb9a50ee9b725e2fad1a Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 5 Jun 2024 15:25:54 -0300 Subject: [PATCH 36/48] Add module import --- test/actors/actors_test.exs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/actors/actors_test.exs b/test/actors/actors_test.exs index ecbc5654..2786c124 100644 --- a/test/actors/actors_test.exs +++ b/test/actors/actors_test.exs @@ -4,6 +4,8 @@ defmodule ActorsTest do alias Eigr.Functions.Protocol.ActorInvocationResponse alias Eigr.Functions.Protocol.Actors.ActorState alias Eigr.Functions.Protocol.Actors.ActorId + alias Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply + alias Eigr.Functions.Protocol.RegistrationResponse setup do From d6c056d6a3fce1336f23569ec4893406c5625370 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 5 Jun 2024 15:27:57 -0300 Subject: [PATCH 37/48] Add correct import --- test/actors/actors_test.exs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/actors/actors_test.exs b/test/actors/actors_test.exs index 2786c124..2a4a09c0 100644 --- a/test/actors/actors_test.exs +++ b/test/actors/actors_test.exs @@ -5,6 +5,7 @@ defmodule ActorsTest do alias Eigr.Functions.Protocol.Actors.ActorState alias Eigr.Functions.Protocol.Actors.ActorId alias Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply + alias Eigr.Functions.Protocol.Actors.Healthcheck.Status, as: HealthcheckStatus alias Eigr.Functions.Protocol.RegistrationResponse From 019c8b2dd479a9e048f7e1bfad580659b1f13ce9 Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Wed, 5 Jun 2024 15:37:42 -0300 Subject: [PATCH 38/48] skip distributed tests --- test/actors/actors_test.exs | 2 ++ test/actors/registry/actor_registry_test.exs | 1 + test/test_helper.exs | 3 ++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/actors/actors_test.exs b/test/actors/actors_test.exs index 2a4a09c0..770ba2a9 100644 --- a/test/actors/actors_test.exs +++ b/test/actors/actors_test.exs @@ -111,6 +111,7 @@ defmodule ActorsTest do Actors.invoke(invoke_request) end + @tag :skip test "invoke actor function for a already registered actor in another node", ctx do %{system: system, actor: actor} = ctx actor_name = actor.id.name @@ -149,6 +150,7 @@ defmodule ActorsTest do any_unpack!(updated_context.state, Actors.Protos.ChangeNameResponseTest) end + @tag :skip test "invoke function for a new actor without persistence in another node", _ctx do actor_name = "actor_not_persistent" diff --git a/test/actors/registry/actor_registry_test.exs b/test/actors/registry/actor_registry_test.exs index 75597a38..ea8a87d1 100644 --- a/test/actors/registry/actor_registry_test.exs +++ b/test/actors/registry/actor_registry_test.exs @@ -16,6 +16,7 @@ defmodule Actors.ActorRegistryTest do %{request: request, actor_name: actor_name, actor_id: actor.id} end + @tag :skip test "register the same actor for a system in two different nodes", ctx do %{request: request, actor_id: actor_id} = ctx diff --git a/test/test_helper.exs b/test/test_helper.exs index 907b836e..15aac62a 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -2,6 +2,7 @@ Spawn.InitializerHelper.setup() ExUnit.start() -Spawn.InitializerHelper.spawn_peer("spawn_actors_node") +# skipping distributed tests +# Spawn.InitializerHelper.spawn_peer("spawn_actors_node") IO.puts("Nodes connected: #{inspect(Node.list())}") From 91ac42189ebbc725c35bad2e118c2e43cf29a6c6 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Wed, 5 Jun 2024 22:18:42 -0300 Subject: [PATCH 39/48] Implemented healthcheck actor callbacks --- lib/actors/actor/caller_consumer.ex | 9 +++ lib/actors/actor/caller_producer.ex | 46 ++++++++++++ lib/actors/actors.ex | 34 +++++++++ lib/sidecar/grpc/dispatcher.ex | 67 ++++++++++++++++++ .../healthcheck_handler_actordispatcher.ex | 6 +- lib/sidecar/grpc/supervisor.ex | 38 ++++++++++ lib/sidecar/process_supervisor.ex | 70 ++++++++++++++++++- 7 files changed, 267 insertions(+), 3 deletions(-) diff --git a/lib/actors/actor/caller_consumer.ex b/lib/actors/actor/caller_consumer.ex index 21a9b6d5..d5fb82ba 100644 --- a/lib/actors/actor/caller_consumer.ex +++ b/lib/actors/actor/caller_consumer.ex @@ -106,6 +106,14 @@ defmodule Actors.Actor.CallerConsumer do reply_to_producer(from, get_state(event)) end + defp dispatch_to_actor({from, {:readiness, event, _opts}} = _producer_event) do + reply_to_producer(from, readiness(event)) + end + + defp dispatch_to_actor({from, {:liveness, event, _opts}} = _producer_event) do + reply_to_producer(from, liveness(event)) + end + defp dispatch_to_actor({from, {:spawn_actor, event, opts}} = _producer_event) do reply_to_producer(from, spawn_actor(event, opts)) end @@ -143,6 +151,7 @@ defmodule Actors.Actor.CallerConsumer do opts ) do if Sidecar.GracefulShutdown.running?() do + # actors ++ [%Actor{id: %ActorId{} = id, settings: %ActorSettings{} = settings}] actors |> Map.values() |> Enum.map(fn actor -> ActorPool.create_actor_host_pool(actor, opts) end) diff --git a/lib/actors/actor/caller_producer.ex b/lib/actors/actor/caller_producer.ex index df684aac..7352c255 100644 --- a/lib/actors/actor/caller_producer.ex +++ b/lib/actors/actor/caller_producer.ex @@ -95,6 +95,52 @@ defmodule Actors.Actor.CallerProducer do end end + @doc """ + Performs a readiness check for a given actor. + + ## Parameters + + - `actor_id` (ActorId.t()): The ID of the actor. + - `opts` (any): Additional options. + + ## Returns + + - `{:ok, response}`: If the response is successfully. + - `{:error, reason}`: If an error occurs during the operation. + + """ + @spec readiness(ActorId.t()) :: {:ok, term()} | {:error, term()} + def readiness(actor_id, opts \\ []) do + if Config.get(:actors_global_backpressure_enabled) do + GenStage.call(__MODULE__, {:enqueue, {:readiness, actor_id, opts}}, :infinity) + else + CallerConsumer.readiness(actor_id) + end + end + + @doc """ + Performs a liveness check for a given actor. + + ## Parameters + + - `actor_id` (ActorId.t()): The ID of the actor. + - `opts` (any): Additional options. + + ## Returns + + - `{:ok, response}`: If the response is successfully. + - `{:error, reason}`: If an error occurs during the operation. + + """ + @spec liveness(ActorId.t()) :: {:ok, term()} | {:error, term()} + def liveness(actor_id, opts \\ []) do + if Config.get(:actors_global_backpressure_enabled) do + GenStage.call(__MODULE__, {:enqueue, {:liveness, actor_id, opts}}, :infinity) + else + CallerConsumer.liveness(actor_id) + end + end + @doc """ Registers an actor with the specified registration request. diff --git a/lib/actors/actors.ex b/lib/actors/actors.ex index eff18146..ecc0c7e1 100644 --- a/lib/actors/actors.ex +++ b/lib/actors/actors.ex @@ -40,6 +40,40 @@ defmodule Actors do @spec get_state(ActorId.t()) :: {:ok, term()} | {:error, term()} defdelegate get_state(id), to: CallerProducer + @doc """ + Performs a readiness check for a given actor. + + ## Parameters + + - `actor_id` (ActorId.t()): The ID of the actor. + - `opts` (any): Additional options. + + ## Returns + + - `{:ok, response}`: If the response is successfully. + - `{:error, reason}`: If an error occurs during the operation. + + """ + @spec readiness(ActorId.t()) :: {:ok, term()} | {:error, term()} + defdelegate readiness(id), to: CallerProducer + + @doc """ + Performs a liveness check for a given actor. + + ## Parameters + + - `actor_id` (ActorId.t()): The ID of the actor. + - `opts` (any): Additional options. + + ## Returns + + - `{:ok, response}`: If the response is successfully. + - `{:error, reason}`: If an error occurs during the operation. + + """ + @spec liveness(ActorId.t()) :: {:ok, term()} | {:error, term()} + defdelegate liveness(id), to: CallerProducer + @doc """ Spawn actors defined in HostActor. diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 4ff74c33..80e3a292 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -129,6 +129,62 @@ defmodule Sidecar.GRPC.Dispatcher do dispatch_sync(system_name, actor_name, action_name, message, stream) end + defp dispatch_sync(system_name, actor_name, "Readiness", message, stream) do + with {:actor_id, actor_id} <- {:actor_id, build_actor_id(system_name, actor_name, message)}, + {:response, {:ok, response}} <- {:response, invoke_readiness(actor_id)} do + Server.send_reply(stream, response) + else + {:actor_id, {:not_found, _}} -> + log_and_raise_error( + :warning, + "Actor Not Found. The Actor probably does not exist or not implemented or the request params are incorrect!", + GRPC.Status.not_found() + ) + + {:actor_id, error} -> + log_and_raise_error( + :error, + "Failed to build actor ID for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) + + {:response, error} -> + log_and_raise_error( + :error, + "Failed to invoke request for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) + end + end + + defp dispatch_sync(system_name, actor_name, "Liveness", message, stream) do + with {:actor_id, actor_id} <- {:actor_id, build_actor_id(system_name, actor_name, message)}, + {:response, {:ok, response}} <- {:response, invoke_liveness(actor_id)} do + Server.send_reply(stream, response) + else + {:actor_id, {:not_found, _}} -> + log_and_raise_error( + :warning, + "Actor Not Found. The Actor probably does not exist or not implemented or the request params are incorrect!", + GRPC.Status.not_found() + ) + + {:actor_id, error} -> + log_and_raise_error( + :error, + "Failed to build actor ID for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) + + {:response, error} -> + log_and_raise_error( + :error, + "Failed to invoke request for Actor #{system_name}:#{actor_name}. Details: #{inspect(error)}", + GRPC.Status.unknown() + ) + end + end + defp dispatch_sync(system_name, actor_name, action_name, message, stream) do with {:actor_id, actor_id} <- {:actor_id, build_actor_id(system_name, actor_name, message)}, {:request, {:ok, request}} <- @@ -271,6 +327,17 @@ defmodule Sidecar.GRPC.Dispatcher do } end + defp build_healthcheck_request(_actor_id, _actor_system, _action_name, _opts), + do: %Google.Protobuf.Empty{} + + defp invoke_readiness(nil), do: {:error, :invalid_payload} + + defp invoke_readiness(request), do: CallerProducer.readiness(request) + + defp invoke_liveness(nil), do: {:error, :invalid_payload} + + defp invoke_liveness(request), do: CallerProducer.liveness(request) + defp invoke_request(nil), do: {:error, :invalid_payload} defp invoke_request(request), do: CallerProducer.invoke(request) diff --git a/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex b/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex index 3c8f0c6e..fbb672c6 100644 --- a/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex +++ b/lib/sidecar/grpc/healthcheck/healthcheck_handler_actordispatcher.ex @@ -4,13 +4,15 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispa service: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service, http_transcode: true + alias Actors.Config.PersistentTermConfig, as: Config + alias Sidecar.GRPC.Dispatcher @spec liveness(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply.t() def liveness(message, stream) do request = %{ - system: "spawn-system", + system: "#{Config.get(:actor_system_name)}-internal", actor_name: "HealthCheckActor", action_name: "Liveness", input: message, @@ -25,7 +27,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispa Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckReply.t() def readiness(message, stream) do request = %{ - system: "spawn-system", + system: "#{Config.get(:actor_system_name)}-internal", actor_name: "HealthCheckActor", action_name: "Readiness", input: message, diff --git a/lib/sidecar/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex index fe7841f1..7ca661c8 100644 --- a/lib/sidecar/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -14,6 +14,7 @@ defmodule Sidecar.GRPC.Supervisor do {:compiling_modules, :ok} <- {:compiling_modules, Generator.compile_modules(modules)} do children = [] + # |> start_healthcheck_actor() |> maybe_start_reflection(Config.get(:grpc_reflection_enabled)) |> maybe_start_grpc_server(Config.get(:grpc_server_enabled)) @@ -37,6 +38,43 @@ defmodule Sidecar.GRPC.Supervisor do end end + # defp start_healthcheck_actor(children) do + # Logger.info("Initializing HealthCheckActor...") + + # (children ++ + # [ + # [ + # %{ + # id: :healthcheck_actor_init, + # start: + # {Task, :start, + # [ + # fn -> + # Process.flag(:trap_exit, true) + + # Logger.info("[SUPERVISOR] HealthCheckActor is up") + # registration = %RegistrationRequest{ + # service_info: attrs[:service_info] || build_service_info(), + # actor_system: attrs[:actor_system] || build_system() + # } + # Actors.register() + + # receive do + # {:EXIT, _pid, reason} -> + # Logger.info( + # "[SUPERVISOR] HealthCheckActor:#{inspect(self())} is successfully down with reason #{inspect(reason)}" + # ) + + # :ok + # end + # end + # ]} + # } + # ] + # ]) + # |> List.flatten() + # end + defp maybe_start_reflection(children, false), do: children defp maybe_start_reflection(children, true) do diff --git a/lib/sidecar/process_supervisor.ex b/lib/sidecar/process_supervisor.ex index b3c0dc0b..af071a06 100644 --- a/lib/sidecar/process_supervisor.ex +++ b/lib/sidecar/process_supervisor.ex @@ -3,6 +3,20 @@ defmodule Sidecar.ProcessSupervisor do use Supervisor require Logger + alias Actors.Config.PersistentTermConfig, as: Config + + alias Eigr.Functions.Protocol.Actors.Actor + alias Eigr.Functions.Protocol.Actors.ActorId + alias Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy + alias Eigr.Functions.Protocol.Actors.ActorSettings + alias Eigr.Functions.Protocol.Actors.ActorSystem + alias Eigr.Functions.Protocol.Actors.Metadata + alias Eigr.Functions.Protocol.Actors.Registry + alias Eigr.Functions.Protocol.Actors.TimeoutStrategy + + alias Eigr.Functions.Protocol.RegistrationRequest + alias Eigr.Functions.Protocol.ServiceInfo + import Spawn.Utils.Common, only: [supervisor_process_logger: 1] @impl true @@ -14,7 +28,61 @@ defmodule Sidecar.ProcessSupervisor do Spawn.Supervisor.child_spec(opts), statestores(), Actors.Supervisors.ActorSupervisor.child_spec(opts), - Actors.Supervisors.ProtocolSupervisor.child_spec(opts) + Actors.Supervisors.ProtocolSupervisor.child_spec(opts), + %{ + id: :healthcheck_actor_init, + start: + {Task, :start, + [ + fn -> + Process.flag(:trap_exit, true) + + Logger.info("[SUPERVISOR] HealthCheckActor is up") + + registration_internal_system = %RegistrationRequest{ + service_info: %ServiceInfo{ + service_name: "", + service_version: "", + service_runtime: "", + support_library_name: "", + support_library_version: "" + }, + actor_system: %ActorSystem{ + name: "#{Config.get(:actor_system_name)}-internal", + registry: %Registry{ + actors: %{ + "HealthCheckActor" => %Actor{ + id: %ActorId{ + system: "#{Config.get(:actor_system_name)}-internal", + name: "HealthCheckActor" + }, + metadata: %Metadata{}, + settings: %ActorSettings{ + kind: :NAMED, + stateful: false, + deactivation_strategy: %ActorDeactivationStrategy{ + strategy: {:timeout, %TimeoutStrategy{timeout: 120_000}} + } + } + } + } + } + } + } + + Actors.register(registration_internal_system) + + receive do + {:EXIT, _pid, reason} -> + Logger.info( + "[SUPERVISOR] HealthCheckActor:#{inspect(self())} is successfully down with reason #{inspect(reason)}" + ) + + :ok + end + end + ]} + } ] |> Enum.reject(&is_nil/1) From d635e41bcfae198e1b986450a33583adceb2e6ac Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Mon, 10 Jun 2024 19:03:39 -0300 Subject: [PATCH 40/48] Fix. Dispatch evento to actors --- compile-pb.sh | 59 +- lib/actors/actor/entity/lifecycle.ex | 4 +- lib/sidecar/grpc/code_generator.ex | 44 +- lib/sidecar/grpc/dispatcher.ex | 45 +- .../grpc/generators/service_generator.ex | 2 + lib/sidecar/grpc/supervisor.ex | 95 +- .../functions/protocol/actors/actor.pb.ex | 1191 +++++----- .../protocol/actors/extensions.pb.ex | 5 +- .../protocol/actors/healthcheck.pb.ex | 2 +- .../functions/protocol/actors/protocol.pb.ex | 1959 +++++++++-------- .../functions/protocol/actors/state.pb.ex | 87 +- lib/spawn/google/protobuf/any.pb.ex | 4 +- lib/spawn/google/protobuf/descriptor.pb.ex | 583 ++--- lib/spawn/google/protobuf/duration.pb.ex | 4 +- lib/spawn/google/protobuf/field_mask.pb.ex | 2 +- .../google/protobuf/source_context.pb.ex | 2 +- lib/spawn/google/protobuf/struct.pb.ex | 29 +- lib/spawn/google/protobuf/timestamp.pb.ex | 4 +- lib/spawn/google/protobuf/wrappers.pb.ex | 26 +- .../grpc/reflection/v1alpha/reflection.pb.ex | 69 +- mix.exs | 2 +- priv/protos/modules/README.md | 1 + priv/protos/modules/pinger.pb.ex | 1015 --------- priv/protos/pinger.proto | 41 - .../spawn_sdk_example/compile-example-pb.sh | 21 +- .../lib/spawn_sdk_example/actors/joe_actor.ex | 8 +- .../lib/spawn_sdk_example/example.pb.ex | 548 ++++- .../priv/protos/example.proto | 7 +- 28 files changed, 2755 insertions(+), 3104 deletions(-) rename lib/spawn/{ => actors}/eigr/functions/protocol/actors/actor.pb.ex (76%) rename lib/spawn/{ => actors}/eigr/functions/protocol/actors/extensions.pb.ex (54%) rename lib/spawn/{ => actors}/eigr/functions/protocol/actors/healthcheck.pb.ex (99%) rename lib/spawn/{ => actors}/eigr/functions/protocol/actors/protocol.pb.ex (73%) rename lib/spawn/{ => actors}/eigr/functions/protocol/actors/state.pb.ex (75%) create mode 100644 priv/protos/modules/README.md delete mode 100644 priv/protos/modules/pinger.pb.ex delete mode 100644 priv/protos/pinger.proto diff --git a/compile-pb.sh b/compile-pb.sh index a7c42984..787be7f1 100755 --- a/compile-pb.sh +++ b/compile-pb.sh @@ -6,20 +6,49 @@ set -o pipefail protoc --elixir_out=gen_descriptors=true,plugins=grpc:./lib/spawn/grpc --proto_path=priv/protos/grpc/ priv/protos/grpc/reflection/v1alpha/reflection.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/any.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/empty.proto -protoc --elixir_out=./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/descriptor.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/duration.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/timestamp.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/struct.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/source_context.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/field_mask.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/wrappers.proto - -protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/extensions.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/actor.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/protocol.proto -protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/state.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/any.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/empty.proto +# protoc --elixir_out=./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/descriptor.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/duration.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/timestamp.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/struct.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/source_context.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/field_mask.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/google/protobuf --proto_path=priv/protos/google/protobuf priv/protos/google/protobuf/wrappers.proto + +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/extensions.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/actor.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/protocol.proto +# protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/state.proto + + #protoc --elixir_out=gen_descriptors=true:./lib/spawn/actors --proto_path=priv/protos priv/protos/eigr/functions/protocol/actors/healthcheck.proto -#protoc --elixir_out=gen_descriptors=true:./lib/spawn/cloudevents --proto_path=priv/protos/io/cloudevents/v1 priv/protos/io/cloudevents/v1/spec.proto \ No newline at end of file +#protoc --elixir_out=gen_descriptors=true:./lib/spawn/cloudevents --proto_path=priv/protos/io/cloudevents/v1 priv/protos/io/cloudevents/v1/spec.proto + +PROTOS=(" + priv/protos/eigr/functions/protocol/actors/extensions.proto + priv/protos/eigr/functions/protocol/actors/actor.proto + priv/protos/eigr/functions/protocol/actors/protocol.proto + priv/protos/eigr/functions/protocol/actors/state.proto + priv/protos/eigr/functions/protocol/actors/healthcheck.proto +") + +BASE_PATH=`pwd` + +echo "Base protobuf path is: $BASE_PATH/priv/protos" + +for file in $PROTOS; do + echo "Compiling file $BASE_PATH/$file..." + + mix protobuf.generate \ + --output-path=./lib/spawn/actors \ + --include-docs=true \ + --generate-descriptors=true \ + --include-path=$BASE_PATH/priv/protos/ \ + --include-path=./priv/protos/google/protobuf \ + --include-path=./priv/protos/google/api \ + --plugins=ProtobufGenerate.Plugins.GRPCWithOptions \ + --one-file-per-module \ + $BASE_PATH/$file +done \ No newline at end of file diff --git a/lib/actors/actor/entity/lifecycle.ex b/lib/actors/actor/entity/lifecycle.ex index bf1f7d49..fe743049 100644 --- a/lib/actors/actor/entity/lifecycle.ex +++ b/lib/actors/actor/entity/lifecycle.ex @@ -117,7 +117,9 @@ defmodule Actors.Actor.Entity.Lifecycle do {:not_found, %{}, _current_revision} -> Logger.debug("Not found state on statestore for Actor #{inspect(actor.id)}.") - {:noreply, updated_state(state, state.actor.state, revision), {:continue, :call_init_action}} + + {:noreply, updated_state(state, state.actor.state, revision), + {:continue, :call_init_action}} error -> handle_load_state_error(actor.name, state, error) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 9e3efc5a..ab8f68c3 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -48,23 +48,31 @@ defmodule Sidecar.GRPC.CodeGenerator do user_defined_proto_files = list_files_with_extension(include_path, ".proto") - |> Enum.join(" ") - - protoc_options = [ - "--include-path=#{include_path}", - "--include-path=#{File.cwd!()}/priv/protos/google/protobuf", - "--include-path=#{File.cwd!()}/priv/protos/google/api", - "--generate-descriptors=true", - "--output-path=#{output_path}", - "--plugins=#{grpc_generator_plugin}", - "--plugins=#{handler_generator_plugin}", - "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", - "--plugins=Sidecar.GRPC.Generators.ServiceResolverGenerator", - "--plugins=Sidecar.Grpc.Generators.ReflectionServerGenerator", - "#{include_path}/#{user_defined_proto_files}" - ] - - _ = Generate.run(protoc_options) + + mod_numbers = length(user_defined_proto_files) + + user_defined_proto_files = user_defined_proto_files |> Enum.join(" ") + + if mod_numbers > 0 do + protoc_options = [ + "--include-path=#{include_path}", + "--include-path=#{File.cwd!()}/priv/protos/google/protobuf", + "--include-path=#{File.cwd!()}/priv/protos/google/api", + "--generate-descriptors=true", + "--output-path=#{output_path}", + "--plugins=#{grpc_generator_plugin}", + "--plugins=#{handler_generator_plugin}", + "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", + "--plugins=Sidecar.GRPC.Generators.ServiceResolverGenerator", + "--plugins=Sidecar.Grpc.Generators.ReflectionServerGenerator", + "#{include_path}/#{user_defined_proto_files}" + ] + + _ = Generate.run(protoc_options) + :ok + else + {:ok, :nothing_to_compile} + end end @doc """ @@ -101,6 +109,8 @@ defmodule Sidecar.GRPC.CodeGenerator do File.read!(full_path) end) + Logger.debug("Found #{length(modules)} ActorHost contract modules to compiling...") + {:ok, modules} end diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index 80e3a292..acd068c3 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -11,6 +11,7 @@ defmodule Sidecar.GRPC.Dispatcher do alias Actors.Registry.ActorRegistry alias Actors.Registry.HostActor + alias Eigr.Functions.Protocol.ActorInvocationResponse alias Eigr.Functions.Protocol.Actors.Actor alias Eigr.Functions.Protocol.Actors.ActorId alias Eigr.Functions.Protocol.Actors.ActorSettings @@ -20,7 +21,7 @@ defmodule Sidecar.GRPC.Dispatcher do alias GRPC.Server alias GRPC.Server.Stream, as: GRPCStream - import Spawn.Utils.AnySerializer, only: [any_pack!: 1] + import Spawn.Utils.AnySerializer, only: [any_pack!: 1, unpack_unknown: 1] @doc """ Dispatches a gRPC message to the specified actor. @@ -81,9 +82,7 @@ defmodule Sidecar.GRPC.Dispatcher do descriptor: _descriptor } = request ) do - Logger.info( - "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. Params: #{inspect(request)}" - ) + Logger.info("Dispatching gRPC message to Actor #{system_name}:#{actor_name}.") handle_dispatch(system_name, actor_name, action_name, message, stream, grpc_type) end @@ -313,18 +312,19 @@ defmodule Sidecar.GRPC.Dispatcher do defp get_actor_id_name(_ctype, message, attribute), do: "#{inspect(Map.get(message, attribute))}" - defp build_request(nil, _, _, _, _), do: nil + defp build_request(nil, _, _, _, _), do: {:error, nil} defp build_request(actor_id, actor_system, action_name, message, opts) do async = Keyword.get(opts, :async, false) - %InvocationRequest{ - async: async, - system: %ActorSystem{name: actor_system}, - actor: %Actor{id: actor_id}, - action_name: action_name, - payload: {:value, any_pack!(message)} - } + {:ok, + %InvocationRequest{ + async: async, + system: %ActorSystem{name: actor_system}, + actor: %Actor{id: actor_id}, + action_name: action_name, + payload: {:value, any_pack!(message)} + }} end defp build_healthcheck_request(_actor_id, _actor_system, _action_name, _opts), @@ -340,7 +340,26 @@ defmodule Sidecar.GRPC.Dispatcher do defp invoke_request(nil), do: {:error, :invalid_payload} - defp invoke_request(request), do: CallerProducer.invoke(request) + defp invoke_request(request) do + case CallerProducer.invoke(request) do + {:ok, %ActorInvocationResponse{payload: {:value, %Google.Protobuf.Any{} = response}}} -> + {:ok, unpack_unknown(response)} + + {:ok, %ActorInvocationResponse{payload: %Google.Protobuf.Any{} = response}} -> + {:ok, unpack_unknown(response)} + + {:ok, + %ActorInvocationResponse{payload: {:noop, %Eigr.Functions.Protocol.Noop{}} = response}} -> + {:ok, %Google.Protobuf.Empty{}} + + :async -> + {:ok, %Google.Protobuf.Empty{}} + + error -> + Logger.warning("Error during parse response. Details: #{inspect(error)}") + {:error, error} + end + end defp log_and_raise_error(level, message, status) do Logger.log(level, message) diff --git a/lib/sidecar/grpc/generators/service_generator.ex b/lib/sidecar/grpc/generators/service_generator.ex index 7fe0ea70..f6a45959 100644 --- a/lib/sidecar/grpc/generators/service_generator.ex +++ b/lib/sidecar/grpc/generators/service_generator.ex @@ -9,6 +9,7 @@ defmodule Sidecar.GRPC.Generators.ServiceGenerator do @behaviour ProtobufGenerate.Plugin alias Protobuf.Protoc.Generator.Util + require Logger @impl true def template do @@ -40,6 +41,7 @@ defmodule Sidecar.GRPC.Generators.ServiceGenerator do @impl true def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do services = Enum.map(svcs, fn svc -> Util.mod_name(ctx, [Macro.camelize(svc.name)]) end) + Logger.debug("Generate follow services #{inspect(services)}") {List.first(services), [ diff --git a/lib/sidecar/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex index 7ca661c8..d522c4a5 100644 --- a/lib/sidecar/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -9,72 +9,39 @@ defmodule Sidecar.GRPC.Supervisor do def init(opts) do Logger.debug("Parser and compiling Protocol Buffers...") - with {:compiling_protos, :ok} <- {:compiling_protos, Generator.compile_protos()}, - {:load_modules, {:ok, modules}} <- {:load_modules, Generator.load_modules(opts)}, - {:compiling_modules, :ok} <- {:compiling_modules, Generator.compile_modules(modules)} do - children = - [] - # |> start_healthcheck_actor() - |> maybe_start_reflection(Config.get(:grpc_reflection_enabled)) - |> maybe_start_grpc_server(Config.get(:grpc_server_enabled)) - - Supervisor.init(children, strategy: :one_for_one) - else - {:compiling_protos, error} -> - raise ArgumentError, - "Failed during compilation of ActorHost Protobufs files. Details: #{inspect(error)}" - - {:load_modules, error} -> - raise ArgumentError, - "Failed on load of ActorHost Protobufs modules. Details: #{inspect(error)}" - - {:compiling_modules, error} -> - raise ArgumentError, - "Failed during compilation of ActorHost protobufs modules. Details: #{inspect(error)}" - - error -> - raise ArgumentError, - "Failed to load ActorHost Protobufs modules. Details: #{inspect(error)}" - end + children = + with {:compiling_protos, :ok} <- + {:compiling_protos, Generator.compile_protos()}, + {:load_modules, {:ok, modules}} <- {:load_modules, Generator.load_modules(opts)}, + {:compiling_modules, :ok} <- {:compiling_modules, Generator.compile_modules(modules)} do + children = + [] + |> maybe_start_reflection(Config.get(:grpc_reflection_enabled)) + |> maybe_start_grpc_server(Config.get(:grpc_server_enabled)) + else + {:compiling_protos, {:ok, :nothing_to_compile}} -> + [] + + {:compiling_protos, error} -> + raise ArgumentError, + "Failed during compilation of ActorHost Protobufs files. Details: #{inspect(error)}" + + {:load_modules, error} -> + raise ArgumentError, + "Failed on load of ActorHost Protobufs modules. Details: #{inspect(error)}" + + {:compiling_modules, error} -> + raise ArgumentError, + "Failed during compilation of ActorHost protobufs modules. Details: #{inspect(error)}" + + error -> + raise ArgumentError, + "Failed to load ActorHost Protobufs modules. Details: #{inspect(error)}" + end + + Supervisor.init(children, strategy: :one_for_one) end - # defp start_healthcheck_actor(children) do - # Logger.info("Initializing HealthCheckActor...") - - # (children ++ - # [ - # [ - # %{ - # id: :healthcheck_actor_init, - # start: - # {Task, :start, - # [ - # fn -> - # Process.flag(:trap_exit, true) - - # Logger.info("[SUPERVISOR] HealthCheckActor is up") - # registration = %RegistrationRequest{ - # service_info: attrs[:service_info] || build_service_info(), - # actor_system: attrs[:actor_system] || build_system() - # } - # Actors.register() - - # receive do - # {:EXIT, _pid, reason} -> - # Logger.info( - # "[SUPERVISOR] HealthCheckActor:#{inspect(self())} is successfully down with reason #{inspect(reason)}" - # ) - - # :ok - # end - # end - # ]} - # } - # ] - # ]) - # |> List.flatten() - # end - defp maybe_start_reflection(children, false), do: children defp maybe_start_reflection(children, true) do diff --git a/lib/spawn/eigr/functions/protocol/actors/actor.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex similarity index 76% rename from lib/spawn/eigr/functions/protocol/actors/actor.pb.ex rename to lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex index a6c50b9f..747f9206 100644 --- a/lib/spawn/eigr/functions/protocol/actors/actor.pb.ex +++ b/lib/spawn/actors/eigr/functions/protocol/actors/actor.pb.ex @@ -1,1179 +1,1214 @@ defmodule Eigr.Functions.Protocol.Actors.Kind do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, enum: true, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.EnumDescriptorProto{ - __unknown_fields__: [], name: "Kind", - options: nil, - reserved_name: [], - reserved_range: [], value: [ %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "UNKNOW_KIND", number: 0, - options: nil + options: nil, + __unknown_fields__: [] }, %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "NAMED", number: 1, - options: nil + options: nil, + __unknown_fields__: [] }, %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "UNNAMED", number: 2, - options: nil + options: nil, + __unknown_fields__: [] }, %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "POOLED", number: 3, - options: nil + options: nil, + __unknown_fields__: [] }, %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "PROXY", number: 4, - options: nil + options: nil, + __unknown_fields__: [] } - ] + ], + options: nil, + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] } end - field :UNKNOW_KIND, 0 - field :NAMED, 1 - field :UNNAMED, 2 - field :POOLED, 3 - field :PROXY, 4 + field(:UNKNOW_KIND, 0) + field(:NAMED, 1) + field(:UNNAMED, 2) + field(:POOLED, 3) + field(:PROXY, 4) end + defmodule Eigr.Functions.Protocol.Actors.Registry.ActorsEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorsEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor" + __unknown_fields__: [] } ], - name: "ActorsEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :key, 1, type: :string - field :value, 2, type: Eigr.Functions.Protocol.Actors.Actor + field(:key, 1, type: :string) + field(:value, 2, type: Eigr.Functions.Protocol.Actors.Actor) end + defmodule Eigr.Functions.Protocol.Actors.Registry do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Registry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actors", - label: :LABEL_REPEATED, name: "actors", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Registry.ActorsEntry", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actors", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Registry.ActorsEntry" + __unknown_fields__: [] } ], - name: "Registry", nested_type: [ %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorsEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor" + __unknown_fields__: [] } ], - name: "ActorsEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } ], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :actors, 1, + field(:actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.Registry.ActorsEntry, map: true + ) end + defmodule Eigr.Functions.Protocol.Actors.ActorSystem do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorSystem", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "name", - label: :LABEL_OPTIONAL, name: "name", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "name", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "registry", - label: :LABEL_OPTIONAL, name: "registry", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Registry", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "registry", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Registry" + __unknown_fields__: [] } ], - name: "ActorSystem", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :name, 1, type: :string - field :registry, 2, type: Eigr.Functions.Protocol.Actors.Registry + field(:name, 1, type: :string) + field(:registry, 2, type: Eigr.Functions.Protocol.Actors.Registry) end + defmodule Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorSnapshotStrategy", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "timeout", - label: :LABEL_OPTIONAL, name: "timeout", + extendee: nil, number: 1, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.TimeoutStrategy", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "timeout", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.TimeoutStrategy" + __unknown_fields__: [] } ], - name: "ActorSnapshotStrategy", nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], name: "strategy", - options: nil + options: nil, + __unknown_fields__: [] } ], - options: nil, + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - oneof :strategy, 0 + oneof(:strategy, 0) - field :timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0 + field(:timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0) end + defmodule Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorDeactivationStrategy", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "timeout", - label: :LABEL_OPTIONAL, name: "timeout", + extendee: nil, number: 1, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.TimeoutStrategy", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "timeout", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.TimeoutStrategy" + __unknown_fields__: [] } ], - name: "ActorDeactivationStrategy", nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], name: "strategy", - options: nil + options: nil, + __unknown_fields__: [] } ], - options: nil, + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - oneof :strategy, 0 + oneof(:strategy, 0) - field :timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0 + field(:timeout, 1, type: Eigr.Functions.Protocol.Actors.TimeoutStrategy, oneof: 0) end + defmodule Eigr.Functions.Protocol.Actors.TimeoutStrategy do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "TimeoutStrategy", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "timeout", - label: :LABEL_OPTIONAL, name: "timeout", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT64, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "timeout", proto3_optional: nil, - type: :TYPE_INT64, - type_name: nil + __unknown_fields__: [] } ], - name: "TimeoutStrategy", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :timeout, 1, type: :int64 + field(:timeout, 1, type: :int64) end + defmodule Eigr.Functions.Protocol.Actors.Action do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Action", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "name", - label: :LABEL_OPTIONAL, name: "name", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "name", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "Action", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :name, 1, type: :string + field(:name, 1, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.FixedTimerAction do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "FixedTimerAction", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "seconds", - label: :LABEL_OPTIONAL, name: "seconds", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "seconds", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "action", - label: :LABEL_OPTIONAL, name: "action", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Action", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "action", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Action" + __unknown_fields__: [] } ], - name: "FixedTimerAction", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :seconds, 1, type: :int32 - field :action, 2, type: Eigr.Functions.Protocol.Actors.Action + field(:seconds, 1, type: :int32) + field(:action, 2, type: Eigr.Functions.Protocol.Actors.Action) end + defmodule Eigr.Functions.Protocol.Actors.ActorState.TagsEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "TagsEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "TagsEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.ActorState do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorState", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "tags", - label: :LABEL_REPEATED, name: "tags", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState.TagsEntry", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "tags", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState.TagsEntry" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "state", - label: :LABEL_OPTIONAL, name: "state", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "state", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" + __unknown_fields__: [] } ], - name: "ActorState", nested_type: [ %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "TagsEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "TagsEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } ], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :tags, 1, + field(:tags, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorState.TagsEntry, map: true + ) - field :state, 2, type: Google.Protobuf.Any + field(:state, 2, type: Google.Protobuf.Any) end + defmodule Eigr.Functions.Protocol.Actors.Metadata.TagsEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "TagsEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "TagsEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.Metadata do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Metadata", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "channelGroup", - label: :LABEL_REPEATED, name: "channel_group", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Channel", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "channelGroup", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Channel" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "tags", - label: :LABEL_REPEATED, name: "tags", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Metadata.TagsEntry", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "tags", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Metadata.TagsEntry" + __unknown_fields__: [] } ], - name: "Metadata", nested_type: [ %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "TagsEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "TagsEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } ], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :channel_group, 1, + field(:channel_group, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.Channel, json_name: "channelGroup" + ) - field :tags, 2, + field(:tags, 2, repeated: true, type: Eigr.Functions.Protocol.Actors.Metadata.TagsEntry, map: true + ) end + defmodule Eigr.Functions.Protocol.Actors.Channel do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Channel", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "topic", - label: :LABEL_OPTIONAL, name: "topic", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "topic", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "action", - label: :LABEL_OPTIONAL, name: "action", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "action", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "Channel", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :topic, 1, type: :string - field :action, 2, type: :string + field(:topic, 1, type: :string) + field(:action, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.ActorSettings do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorSettings", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "kind", - label: :LABEL_OPTIONAL, name: "kind", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_ENUM, + type_name: ".eigr.functions.protocol.actors.Kind", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "kind", proto3_optional: nil, - type: :TYPE_ENUM, - type_name: ".eigr.functions.protocol.actors.Kind" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "stateful", - label: :LABEL_OPTIONAL, name: "stateful", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_BOOL, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "stateful", proto3_optional: nil, - type: :TYPE_BOOL, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "snapshotStrategy", - label: :LABEL_OPTIONAL, name: "snapshot_strategy", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSnapshotStrategy", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "snapshotStrategy", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSnapshotStrategy" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "deactivationStrategy", - label: :LABEL_OPTIONAL, name: "deactivation_strategy", + extendee: nil, number: 4, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorDeactivationStrategy", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "deactivationStrategy", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorDeactivationStrategy" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "minPoolSize", - label: :LABEL_OPTIONAL, name: "min_pool_size", + extendee: nil, number: 5, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "minPoolSize", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "maxPoolSize", - label: :LABEL_OPTIONAL, name: "max_pool_size", + extendee: nil, number: 6, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "maxPoolSize", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] } ], - name: "ActorSettings", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :kind, 1, type: Eigr.Functions.Protocol.Actors.Kind, enum: true - field :stateful, 2, type: :bool + field(:kind, 1, type: Eigr.Functions.Protocol.Actors.Kind, enum: true) + field(:stateful, 2, type: :bool) - field :snapshot_strategy, 3, + field(:snapshot_strategy, 3, type: Eigr.Functions.Protocol.Actors.ActorSnapshotStrategy, json_name: "snapshotStrategy" + ) - field :deactivation_strategy, 4, + field(:deactivation_strategy, 4, type: Eigr.Functions.Protocol.Actors.ActorDeactivationStrategy, json_name: "deactivationStrategy" + ) - field :min_pool_size, 5, type: :int32, json_name: "minPoolSize" - field :max_pool_size, 6, type: :int32, json_name: "maxPoolSize" + field(:min_pool_size, 5, type: :int32, json_name: "minPoolSize") + field(:max_pool_size, 6, type: :int32, json_name: "maxPoolSize") end + defmodule Eigr.Functions.Protocol.Actors.ActorId do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorId", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "name", - label: :LABEL_OPTIONAL, name: "name", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "name", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "system", - label: :LABEL_OPTIONAL, name: "system", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "system", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "parent", - label: :LABEL_OPTIONAL, name: "parent", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "parent", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "ActorId", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :name, 1, type: :string - field :system, 2, type: :string - field :parent, 3, type: :string + field(:name, 1, type: :string) + field(:system, 2, type: :string) + field(:parent, 3, type: :string) end + defmodule Eigr.Functions.Protocol.Actors.Actor do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Actor", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "id", - label: :LABEL_OPTIONAL, name: "id", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "id", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "state", - label: :LABEL_OPTIONAL, name: "state", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "state", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "metadata", - label: :LABEL_OPTIONAL, name: "metadata", + extendee: nil, number: 6, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Metadata", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "metadata", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Metadata" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "settings", - label: :LABEL_OPTIONAL, name: "settings", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSettings", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "settings", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSettings" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actions", - label: :LABEL_REPEATED, name: "actions", + extendee: nil, number: 4, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Action", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actions", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Action" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "timerActions", - label: :LABEL_REPEATED, name: "timer_actions", + extendee: nil, number: 5, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.FixedTimerAction", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "timerActions", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.FixedTimerAction" + __unknown_fields__: [] } ], - name: "Actor", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :id, 1, type: Eigr.Functions.Protocol.Actors.ActorId - field :state, 2, type: Eigr.Functions.Protocol.Actors.ActorState - field :metadata, 6, type: Eigr.Functions.Protocol.Actors.Metadata - field :settings, 3, type: Eigr.Functions.Protocol.Actors.ActorSettings - field :actions, 4, repeated: true, type: Eigr.Functions.Protocol.Actors.Action + field(:id, 1, type: Eigr.Functions.Protocol.Actors.ActorId) + field(:state, 2, type: Eigr.Functions.Protocol.Actors.ActorState) + field(:metadata, 6, type: Eigr.Functions.Protocol.Actors.Metadata) + field(:settings, 3, type: Eigr.Functions.Protocol.Actors.ActorSettings) + field(:actions, 4, repeated: true, type: Eigr.Functions.Protocol.Actors.Action) - field :timer_actions, 5, + field(:timer_actions, 5, repeated: true, type: Eigr.Functions.Protocol.Actors.FixedTimerAction, json_name: "timerActions" + ) end diff --git a/lib/spawn/eigr/functions/protocol/actors/extensions.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex similarity index 54% rename from lib/spawn/eigr/functions/protocol/actors/extensions.pb.ex rename to lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex index 662f3381..2f02de63 100644 --- a/lib/spawn/eigr/functions/protocol/actors/extensions.pb.ex +++ b/lib/spawn/actors/eigr/functions/protocol/actors/extensions.pb.ex @@ -1,9 +1,10 @@ defmodule Eigr.Functions.Protocol.Actors.PbExtension do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 - extend Google.Protobuf.FieldOptions, :actor_id, 9999, + extend(Google.Protobuf.FieldOptions, :actor_id, 9999, optional: true, type: :bool, json_name: "actorId" + ) end diff --git a/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex similarity index 99% rename from lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex rename to lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex index 346eaa9a..d95c85a5 100644 --- a/lib/spawn/eigr/functions/protocol/actors/healthcheck.pb.ex +++ b/lib/spawn/actors/eigr/functions/protocol/actors/healthcheck.pb.ex @@ -115,7 +115,7 @@ defmodule Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.Service do def descriptor do # credo:disable-for-next-line %Google.Protobuf.FileDescriptorProto{ - name: "healthcheck.proto", + name: "eigr/functions/protocol/actors/healthcheck.proto", package: "eigr.functions.protocol.actors.healthcheck", dependency: [ "google/api/annotations.proto", diff --git a/lib/spawn/eigr/functions/protocol/actors/protocol.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex similarity index 73% rename from lib/spawn/eigr/functions/protocol/actors/protocol.pb.ex rename to lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex index 6348af8b..7bc475d8 100644 --- a/lib/spawn/eigr/functions/protocol/actors/protocol.pb.ex +++ b/lib/spawn/actors/eigr/functions/protocol/actors/protocol.pb.ex @@ -1,1867 +1,1904 @@ defmodule Eigr.Functions.Protocol.Status do @moduledoc false - use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, enum: true, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.EnumDescriptorProto{ - __unknown_fields__: [], name: "Status", - options: nil, - reserved_name: [], - reserved_range: [], value: [ %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "UNKNOWN", number: 0, - options: nil + options: nil, + __unknown_fields__: [] }, %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "OK", number: 1, - options: nil + options: nil, + __unknown_fields__: [] }, %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "ACTOR_NOT_FOUND", number: 2, - options: nil + options: nil, + __unknown_fields__: [] }, %Google.Protobuf.EnumValueDescriptorProto{ - __unknown_fields__: [], name: "ERROR", number: 3, - options: nil + options: nil, + __unknown_fields__: [] } - ] + ], + options: nil, + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] } end - field :UNKNOWN, 0 - field :OK, 1 - field :ACTOR_NOT_FOUND, 2 - field :ERROR, 3 + field(:UNKNOWN, 0) + field(:OK, 1) + field(:ACTOR_NOT_FOUND, 2) + field(:ERROR, 3) end + defmodule Eigr.Functions.Protocol.Context.MetadataEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "MetadataEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "MetadataEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Context.TagsEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "TagsEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "TagsEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.Context do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Context", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "state", - label: :LABEL_OPTIONAL, name: "state", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "state", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "metadata", - label: :LABEL_REPEATED, name: "metadata", + extendee: nil, number: 4, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context.MetadataEntry", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "metadata", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context.MetadataEntry" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "tags", - label: :LABEL_REPEATED, name: "tags", + extendee: nil, number: 5, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context.TagsEntry", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "tags", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context.TagsEntry" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "caller", - label: :LABEL_OPTIONAL, name: "caller", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "caller", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "self", - label: :LABEL_OPTIONAL, name: "self", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "self", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" + __unknown_fields__: [] } ], - name: "Context", nested_type: [ %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "MetadataEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "MetadataEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] }, %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "TagsEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "TagsEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } ], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :state, 1, type: Google.Protobuf.Any + field(:state, 1, type: Google.Protobuf.Any) - field :metadata, 4, + field(:metadata, 4, repeated: true, type: Eigr.Functions.Protocol.Context.MetadataEntry, map: true + ) - field :tags, 5, repeated: true, type: Eigr.Functions.Protocol.Context.TagsEntry, map: true - field :caller, 2, type: Eigr.Functions.Protocol.Actors.ActorId - field :self, 3, type: Eigr.Functions.Protocol.Actors.ActorId + field(:tags, 5, repeated: true, type: Eigr.Functions.Protocol.Context.TagsEntry, map: true) + field(:caller, 2, type: Eigr.Functions.Protocol.Actors.ActorId) + field(:self, 3, type: Eigr.Functions.Protocol.Actors.ActorId) end + defmodule Eigr.Functions.Protocol.Noop do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], - field: [], name: "Noop", + field: [], nested_type: [], - oneof_decl: [], - options: nil, - reserved_name: [], - reserved_range: [] + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] } end end + defmodule Eigr.Functions.Protocol.JSONType do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "JSONType", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "content", - label: :LABEL_OPTIONAL, name: "content", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "content", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "JSONType", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :content, 1, type: :string + field(:content, 1, type: :string) end + defmodule Eigr.Functions.Protocol.RegistrationRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "RegistrationRequest", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceInfo", - label: :LABEL_OPTIONAL, name: "service_info", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.ServiceInfo", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "serviceInfo", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.ServiceInfo" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actorSystem", - label: :LABEL_OPTIONAL, name: "actor_system", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actorSystem", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem" + __unknown_fields__: [] } ], - name: "RegistrationRequest", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :service_info, 1, type: Eigr.Functions.Protocol.ServiceInfo, json_name: "serviceInfo" + field(:service_info, 1, type: Eigr.Functions.Protocol.ServiceInfo, json_name: "serviceInfo") - field :actor_system, 2, + field(:actor_system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem, json_name: "actorSystem" + ) end + defmodule Eigr.Functions.Protocol.RegistrationResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "RegistrationResponse", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, name: "status", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "status", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "proxyInfo", - label: :LABEL_OPTIONAL, name: "proxy_info", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.ProxyInfo", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "proxyInfo", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.ProxyInfo" + __unknown_fields__: [] } ], - name: "RegistrationResponse", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :status, 1, type: Eigr.Functions.Protocol.RequestStatus - field :proxy_info, 2, type: Eigr.Functions.Protocol.ProxyInfo, json_name: "proxyInfo" + field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) + field(:proxy_info, 2, type: Eigr.Functions.Protocol.ProxyInfo, json_name: "proxyInfo") end + defmodule Eigr.Functions.Protocol.ServiceInfo do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ServiceInfo", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceName", - label: :LABEL_OPTIONAL, name: "service_name", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "serviceName", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceVersion", - label: :LABEL_OPTIONAL, name: "service_version", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "serviceVersion", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "serviceRuntime", - label: :LABEL_OPTIONAL, name: "service_runtime", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "serviceRuntime", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "supportLibraryName", - label: :LABEL_OPTIONAL, name: "support_library_name", + extendee: nil, number: 4, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "supportLibraryName", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "supportLibraryVersion", - label: :LABEL_OPTIONAL, name: "support_library_version", + extendee: nil, number: 5, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "supportLibraryVersion", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "protocolMajorVersion", - label: :LABEL_OPTIONAL, name: "protocol_major_version", + extendee: nil, number: 6, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "protocolMajorVersion", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "protocolMinorVersion", - label: :LABEL_OPTIONAL, name: "protocol_minor_version", + extendee: nil, number: 7, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "protocolMinorVersion", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] } ], - name: "ServiceInfo", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :service_name, 1, type: :string, json_name: "serviceName" - field :service_version, 2, type: :string, json_name: "serviceVersion" - field :service_runtime, 3, type: :string, json_name: "serviceRuntime" - field :support_library_name, 4, type: :string, json_name: "supportLibraryName" - field :support_library_version, 5, type: :string, json_name: "supportLibraryVersion" - field :protocol_major_version, 6, type: :int32, json_name: "protocolMajorVersion" - field :protocol_minor_version, 7, type: :int32, json_name: "protocolMinorVersion" + field(:service_name, 1, type: :string, json_name: "serviceName") + field(:service_version, 2, type: :string, json_name: "serviceVersion") + field(:service_runtime, 3, type: :string, json_name: "serviceRuntime") + field(:support_library_name, 4, type: :string, json_name: "supportLibraryName") + field(:support_library_version, 5, type: :string, json_name: "supportLibraryVersion") + field(:protocol_major_version, 6, type: :int32, json_name: "protocolMajorVersion") + field(:protocol_minor_version, 7, type: :int32, json_name: "protocolMinorVersion") end + defmodule Eigr.Functions.Protocol.SpawnRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "SpawnRequest", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actors", - label: :LABEL_REPEATED, name: "actors", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actors", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" + __unknown_fields__: [] } ], - name: "SpawnRequest", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorId + field(:actors, 1, repeated: true, type: Eigr.Functions.Protocol.Actors.ActorId) end + defmodule Eigr.Functions.Protocol.SpawnResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "SpawnResponse", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, name: "status", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "status", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus" + __unknown_fields__: [] } ], - name: "SpawnResponse", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :status, 1, type: Eigr.Functions.Protocol.RequestStatus + field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) end + defmodule Eigr.Functions.Protocol.ProxyInfo do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ProxyInfo", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, + name: "protocol_major_version", extendee: nil, - json_name: "protocolMajorVersion", + number: 1, label: :LABEL_OPTIONAL, - name: "protocol_major_version", - number: 1, - oneof_index: nil, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "protocolMajorVersion", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "protocolMinorVersion", - label: :LABEL_OPTIONAL, name: "protocol_minor_version", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "protocolMinorVersion", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "proxyName", - label: :LABEL_OPTIONAL, name: "proxy_name", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "proxyName", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "proxyVersion", - label: :LABEL_OPTIONAL, name: "proxy_version", + extendee: nil, number: 4, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "proxyVersion", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "ProxyInfo", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :protocol_major_version, 1, type: :int32, json_name: "protocolMajorVersion" - field :protocol_minor_version, 2, type: :int32, json_name: "protocolMinorVersion" - field :proxy_name, 3, type: :string, json_name: "proxyName" - field :proxy_version, 4, type: :string, json_name: "proxyVersion" + field(:protocol_major_version, 1, type: :int32, json_name: "protocolMajorVersion") + field(:protocol_minor_version, 2, type: :int32, json_name: "protocolMinorVersion") + field(:proxy_name, 3, type: :string, json_name: "proxyName") + field(:proxy_version, 4, type: :string, json_name: "proxyVersion") end + defmodule Eigr.Functions.Protocol.SideEffect do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "SideEffect", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "request", - label: :LABEL_OPTIONAL, name: "request", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.InvocationRequest", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "request", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.InvocationRequest" + __unknown_fields__: [] } ], - name: "SideEffect", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :request, 1, type: Eigr.Functions.Protocol.InvocationRequest + field(:request, 1, type: Eigr.Functions.Protocol.InvocationRequest) end + defmodule Eigr.Functions.Protocol.Broadcast do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Broadcast", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "channelGroup", - label: :LABEL_OPTIONAL, name: "channel_group", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "channelGroup", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 3, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "value", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, name: "noop", + extendee: nil, number: 4, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "noop", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" + __unknown_fields__: [] } ], - name: "Broadcast", nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], name: "payload", - options: nil + options: nil, + __unknown_fields__: [] } ], - options: nil, + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - oneof :payload, 0 + oneof(:payload, 0) - field :channel_group, 1, type: :string, json_name: "channelGroup" - field :value, 3, type: Google.Protobuf.Any, oneof: 0 - field :noop, 4, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field(:channel_group, 1, type: :string, json_name: "channelGroup") + field(:value, 3, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 4, type: Eigr.Functions.Protocol.Noop, oneof: 0) end + defmodule Eigr.Functions.Protocol.Pipe do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Pipe", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, name: "actor", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actor", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actionName", - label: :LABEL_OPTIONAL, name: "action_name", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actionName", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "Pipe", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :actor, 1, type: :string - field :action_name, 2, type: :string, json_name: "actionName" + field(:actor, 1, type: :string) + field(:action_name, 2, type: :string, json_name: "actionName") end + defmodule Eigr.Functions.Protocol.Forward do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Forward", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, name: "actor", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actor", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actionName", - label: :LABEL_OPTIONAL, name: "action_name", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actionName", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "Forward", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :actor, 1, type: :string - field :action_name, 2, type: :string, json_name: "actionName" + field(:actor, 1, type: :string) + field(:action_name, 2, type: :string, json_name: "actionName") end + defmodule Eigr.Functions.Protocol.Workflow do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Workflow", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "broadcast", - label: :LABEL_OPTIONAL, name: "broadcast", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Broadcast", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "broadcast", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Broadcast" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "effects", - label: :LABEL_REPEATED, name: "effects", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.SideEffect", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "effects", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.SideEffect" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "pipe", - label: :LABEL_OPTIONAL, name: "pipe", + extendee: nil, number: 3, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Pipe", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "pipe", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Pipe" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "forward", - label: :LABEL_OPTIONAL, name: "forward", + extendee: nil, number: 4, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Forward", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "forward", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Forward" + __unknown_fields__: [] } ], - name: "Workflow", nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], name: "routing", - options: nil + options: nil, + __unknown_fields__: [] } ], - options: nil, + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - oneof :routing, 0 + oneof(:routing, 0) - field :broadcast, 2, type: Eigr.Functions.Protocol.Broadcast - field :effects, 1, repeated: true, type: Eigr.Functions.Protocol.SideEffect - field :pipe, 3, type: Eigr.Functions.Protocol.Pipe, oneof: 0 - field :forward, 4, type: Eigr.Functions.Protocol.Forward, oneof: 0 + field(:broadcast, 2, type: Eigr.Functions.Protocol.Broadcast) + field(:effects, 1, repeated: true, type: Eigr.Functions.Protocol.SideEffect) + field(:pipe, 3, type: Eigr.Functions.Protocol.Pipe, oneof: 0) + field(:forward, 4, type: Eigr.Functions.Protocol.Forward, oneof: 0) end + defmodule Eigr.Functions.Protocol.InvocationRequest.MetadataEntry do @moduledoc false - use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, map: true, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "MetadataEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "MetadataEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :key, 1, type: :string - field :value, 2, type: :string + field(:key, 1, type: :string) + field(:value, 2, type: :string) end + defmodule Eigr.Functions.Protocol.InvocationRequest do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "InvocationRequest", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "system", - label: :LABEL_OPTIONAL, name: "system", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "system", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, name: "actor", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actor", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actionName", - label: :LABEL_OPTIONAL, name: "action_name", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actionName", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 4, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "value", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, name: "noop", + extendee: nil, number: 7, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "noop", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "async", - label: :LABEL_OPTIONAL, name: "async", + extendee: nil, number: 5, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_BOOL, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "async", proto3_optional: nil, - type: :TYPE_BOOL, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "caller", - label: :LABEL_OPTIONAL, name: "caller", + extendee: nil, number: 6, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "caller", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "metadata", - label: :LABEL_REPEATED, name: "metadata", + extendee: nil, number: 8, - oneof_index: nil, + label: :LABEL_REPEATED, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.InvocationRequest.MetadataEntry", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "metadata", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.InvocationRequest.MetadataEntry" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "scheduledTo", - label: :LABEL_OPTIONAL, name: "scheduled_to", + extendee: nil, number: 9, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT64, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "scheduledTo", proto3_optional: nil, - type: :TYPE_INT64, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "pooled", - label: :LABEL_OPTIONAL, name: "pooled", + extendee: nil, number: 10, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_BOOL, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "pooled", proto3_optional: nil, - type: :TYPE_BOOL, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "registerRef", - label: :LABEL_OPTIONAL, name: "register_ref", + extendee: nil, number: 11, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "registerRef", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "InvocationRequest", nested_type: [ %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "MetadataEntry", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "key", - label: :LABEL_OPTIONAL, name: "key", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "key", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "MetadataEntry", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: %Google.Protobuf.MessageOptions{ - __pb_extensions__: %{}, - __unknown_fields__: [], - deprecated: false, - map_entry: true, message_set_wire_format: false, no_standard_descriptor_accessor: false, - uninterpreted_option: [] + deprecated: false, + map_entry: true, + deprecated_legacy_json_field_conflicts: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] }, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } ], + enum_type: [], + extension_range: [], + extension: [], + options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], name: "payload", - options: nil + options: nil, + __unknown_fields__: [] } ], - options: nil, + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - oneof :payload, 0 + oneof(:payload, 0) - field :system, 1, type: Eigr.Functions.Protocol.Actors.ActorSystem - field :actor, 2, type: Eigr.Functions.Protocol.Actors.Actor - field :action_name, 3, type: :string, json_name: "actionName" - field :value, 4, type: Google.Protobuf.Any, oneof: 0 - field :noop, 7, type: Eigr.Functions.Protocol.Noop, oneof: 0 - field :async, 5, type: :bool - field :caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId + field(:system, 1, type: Eigr.Functions.Protocol.Actors.ActorSystem) + field(:actor, 2, type: Eigr.Functions.Protocol.Actors.Actor) + field(:action_name, 3, type: :string, json_name: "actionName") + field(:value, 4, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 7, type: Eigr.Functions.Protocol.Noop, oneof: 0) + field(:async, 5, type: :bool) + field(:caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId) - field :metadata, 8, + field(:metadata, 8, repeated: true, type: Eigr.Functions.Protocol.InvocationRequest.MetadataEntry, map: true + ) - field :scheduled_to, 9, type: :int64, json_name: "scheduledTo" - field :pooled, 10, type: :bool - field :register_ref, 11, type: :string, json_name: "registerRef" + field(:scheduled_to, 9, type: :int64, json_name: "scheduledTo") + field(:pooled, 10, type: :bool) + field(:register_ref, 11, type: :string, json_name: "registerRef") end + defmodule Eigr.Functions.Protocol.ActorInvocation do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorInvocation", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, name: "actor", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actor", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actionName", - label: :LABEL_OPTIONAL, name: "action_name", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actionName", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "currentContext", - label: :LABEL_OPTIONAL, name: "current_context", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "currentContext", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 4, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "value", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, name: "noop", + extendee: nil, number: 5, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "noop", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "caller", - label: :LABEL_OPTIONAL, name: "caller", + extendee: nil, number: 6, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorId", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "caller", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorId" + __unknown_fields__: [] } ], - name: "ActorInvocation", nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], name: "payload", - options: nil + options: nil, + __unknown_fields__: [] } ], - options: nil, + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - oneof :payload, 0 + oneof(:payload, 0) - field :actor, 1, type: Eigr.Functions.Protocol.Actors.ActorId - field :action_name, 2, type: :string, json_name: "actionName" - field :current_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "currentContext" - field :value, 4, type: Google.Protobuf.Any, oneof: 0 - field :noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0 - field :caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId + field(:actor, 1, type: Eigr.Functions.Protocol.Actors.ActorId) + field(:action_name, 2, type: :string, json_name: "actionName") + field(:current_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "currentContext") + field(:value, 4, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0) + field(:caller, 6, type: Eigr.Functions.Protocol.Actors.ActorId) end + defmodule Eigr.Functions.Protocol.ActorInvocationResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "ActorInvocationResponse", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actorName", - label: :LABEL_OPTIONAL, name: "actor_name", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actorName", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actorSystem", - label: :LABEL_OPTIONAL, name: "actor_system", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actorSystem", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "updatedContext", - label: :LABEL_OPTIONAL, name: "updated_context", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Context", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "updatedContext", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Context" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 4, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "value", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, name: "noop", + extendee: nil, number: 6, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "noop", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "workflow", - label: :LABEL_OPTIONAL, name: "workflow", + extendee: nil, number: 5, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Workflow", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "workflow", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Workflow" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "checkpoint", - label: :LABEL_OPTIONAL, name: "checkpoint", + extendee: nil, number: 7, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_BOOL, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "checkpoint", proto3_optional: nil, - type: :TYPE_BOOL, - type_name: nil + __unknown_fields__: [] } ], - name: "ActorInvocationResponse", nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], name: "payload", - options: nil + options: nil, + __unknown_fields__: [] } ], - options: nil, + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - oneof :payload, 0 + oneof(:payload, 0) - field :actor_name, 1, type: :string, json_name: "actorName" - field :actor_system, 2, type: :string, json_name: "actorSystem" - field :updated_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "updatedContext" - field :value, 4, type: Google.Protobuf.Any, oneof: 0 - field :noop, 6, type: Eigr.Functions.Protocol.Noop, oneof: 0 - field :workflow, 5, type: Eigr.Functions.Protocol.Workflow - field :checkpoint, 7, type: :bool + field(:actor_name, 1, type: :string, json_name: "actorName") + field(:actor_system, 2, type: :string, json_name: "actorSystem") + field(:updated_context, 3, type: Eigr.Functions.Protocol.Context, json_name: "updatedContext") + field(:value, 4, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 6, type: Eigr.Functions.Protocol.Noop, oneof: 0) + field(:workflow, 5, type: Eigr.Functions.Protocol.Workflow) + field(:checkpoint, 7, type: :bool) end + defmodule Eigr.Functions.Protocol.InvocationResponse do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "InvocationResponse", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, name: "status", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.RequestStatus", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "status", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.RequestStatus" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "system", - label: :LABEL_OPTIONAL, name: "system", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorSystem", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "system", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorSystem" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "actor", - label: :LABEL_OPTIONAL, name: "actor", + extendee: nil, number: 3, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.Actor", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "actor", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.Actor" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 4, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".google.protobuf.Any", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "value", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Any" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "noop", - label: :LABEL_OPTIONAL, name: "noop", + extendee: nil, number: 5, - oneof_index: 0, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.Noop", + default_value: nil, options: nil, + oneof_index: 0, + json_name: "noop", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.Noop" + __unknown_fields__: [] } ], - name: "InvocationResponse", nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, oneof_decl: [ %Google.Protobuf.OneofDescriptorProto{ - __unknown_fields__: [], name: "payload", - options: nil + options: nil, + __unknown_fields__: [] } ], - options: nil, + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - oneof :payload, 0 + oneof(:payload, 0) - field :status, 1, type: Eigr.Functions.Protocol.RequestStatus - field :system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem - field :actor, 3, type: Eigr.Functions.Protocol.Actors.Actor - field :value, 4, type: Google.Protobuf.Any, oneof: 0 - field :noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0 + field(:status, 1, type: Eigr.Functions.Protocol.RequestStatus) + field(:system, 2, type: Eigr.Functions.Protocol.Actors.ActorSystem) + field(:actor, 3, type: Eigr.Functions.Protocol.Actors.Actor) + field(:value, 4, type: Google.Protobuf.Any, oneof: 0) + field(:noop, 5, type: Eigr.Functions.Protocol.Noop, oneof: 0) end + defmodule Eigr.Functions.Protocol.RequestStatus do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "RequestStatus", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "status", - label: :LABEL_OPTIONAL, name: "status", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_ENUM, + type_name: ".eigr.functions.protocol.Status", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "status", proto3_optional: nil, - type: :TYPE_ENUM, - type_name: ".eigr.functions.protocol.Status" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "message", - label: :LABEL_OPTIONAL, name: "message", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_STRING, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "message", proto3_optional: nil, - type: :TYPE_STRING, - type_name: nil + __unknown_fields__: [] } ], - name: "RequestStatus", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :status, 1, type: Eigr.Functions.Protocol.Status, enum: true - field :message, 2, type: :string + field(:status, 1, type: Eigr.Functions.Protocol.Status, enum: true) + field(:message, 2, type: :string) end diff --git a/lib/spawn/eigr/functions/protocol/actors/state.pb.ex b/lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex similarity index 75% rename from lib/spawn/eigr/functions/protocol/actors/state.pb.ex rename to lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex index c79a6c38..1b3b9b94 100644 --- a/lib/spawn/eigr/functions/protocol/actors/state.pb.ex +++ b/lib/spawn/actors/eigr/functions/protocol/actors/state.pb.ex @@ -1,91 +1,92 @@ defmodule Eigr.Functions.Protocol.State.Revision do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Revision", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT64, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_INT64, - type_name: nil + __unknown_fields__: [] } ], - name: "Revision", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :value, 1, type: :int64 + field(:value, 1, type: :int64) end + defmodule Eigr.Functions.Protocol.State.Checkpoint do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "Checkpoint", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "revision", - label: :LABEL_OPTIONAL, name: "revision", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.state.Revision", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "revision", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.state.Revision" + __unknown_fields__: [] }, %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "state", - label: :LABEL_OPTIONAL, name: "state", + extendee: nil, number: 2, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_MESSAGE, + type_name: ".eigr.functions.protocol.actors.ActorState", + default_value: nil, options: nil, + oneof_index: nil, + json_name: "state", proto3_optional: nil, - type: :TYPE_MESSAGE, - type_name: ".eigr.functions.protocol.actors.ActorState" + __unknown_fields__: [] } ], - name: "Checkpoint", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end - field :revision, 1, type: Eigr.Functions.Protocol.State.Revision - field :state, 2, type: Eigr.Functions.Protocol.Actors.ActorState + field(:revision, 1, type: Eigr.Functions.Protocol.State.Revision) + field(:state, 2, type: Eigr.Functions.Protocol.Actors.ActorState) end diff --git a/lib/spawn/google/protobuf/any.pb.ex b/lib/spawn/google/protobuf/any.pb.ex index 40d471d7..2a3ef175 100644 --- a/lib/spawn/google/protobuf/any.pb.ex +++ b/lib/spawn/google/protobuf/any.pb.ex @@ -48,6 +48,6 @@ defmodule Google.Protobuf.Any do } end - field :type_url, 1, type: :string, json_name: "typeUrl" - field :value, 2, type: :bytes + field(:type_url, 1, type: :string, json_name: "typeUrl") + field(:value, 2, type: :bytes) end diff --git a/lib/spawn/google/protobuf/descriptor.pb.ex b/lib/spawn/google/protobuf/descriptor.pb.ex index ad25a221..515438c6 100644 --- a/lib/spawn/google/protobuf/descriptor.pb.ex +++ b/lib/spawn/google/protobuf/descriptor.pb.ex @@ -2,591 +2,662 @@ defmodule Google.Protobuf.Edition do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :EDITION_UNKNOWN, 0 - field :EDITION_PROTO2, 998 - field :EDITION_PROTO3, 999 - field :EDITION_2023, 1000 - field :EDITION_2024, 1001 - field :EDITION_1_TEST_ONLY, 1 - field :EDITION_2_TEST_ONLY, 2 - field :EDITION_99997_TEST_ONLY, 99997 - field :EDITION_99998_TEST_ONLY, 99998 - field :EDITION_99999_TEST_ONLY, 99999 - field :EDITION_MAX, 2_147_483_647 + field(:EDITION_UNKNOWN, 0) + field(:EDITION_PROTO2, 998) + field(:EDITION_PROTO3, 999) + field(:EDITION_2023, 1000) + field(:EDITION_2024, 1001) + field(:EDITION_1_TEST_ONLY, 1) + field(:EDITION_2_TEST_ONLY, 2) + field(:EDITION_99997_TEST_ONLY, 99997) + field(:EDITION_99998_TEST_ONLY, 99998) + field(:EDITION_99999_TEST_ONLY, 99999) + field(:EDITION_MAX, 2_147_483_647) end + defmodule Google.Protobuf.ExtensionRangeOptions.VerificationState do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :DECLARATION, 0 - field :UNVERIFIED, 1 + field(:DECLARATION, 0) + field(:UNVERIFIED, 1) end + defmodule Google.Protobuf.FieldDescriptorProto.Type do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :TYPE_DOUBLE, 1 - field :TYPE_FLOAT, 2 - field :TYPE_INT64, 3 - field :TYPE_UINT64, 4 - field :TYPE_INT32, 5 - field :TYPE_FIXED64, 6 - field :TYPE_FIXED32, 7 - field :TYPE_BOOL, 8 - field :TYPE_STRING, 9 - field :TYPE_GROUP, 10 - field :TYPE_MESSAGE, 11 - field :TYPE_BYTES, 12 - field :TYPE_UINT32, 13 - field :TYPE_ENUM, 14 - field :TYPE_SFIXED32, 15 - field :TYPE_SFIXED64, 16 - field :TYPE_SINT32, 17 - field :TYPE_SINT64, 18 + field(:TYPE_DOUBLE, 1) + field(:TYPE_FLOAT, 2) + field(:TYPE_INT64, 3) + field(:TYPE_UINT64, 4) + field(:TYPE_INT32, 5) + field(:TYPE_FIXED64, 6) + field(:TYPE_FIXED32, 7) + field(:TYPE_BOOL, 8) + field(:TYPE_STRING, 9) + field(:TYPE_GROUP, 10) + field(:TYPE_MESSAGE, 11) + field(:TYPE_BYTES, 12) + field(:TYPE_UINT32, 13) + field(:TYPE_ENUM, 14) + field(:TYPE_SFIXED32, 15) + field(:TYPE_SFIXED64, 16) + field(:TYPE_SINT32, 17) + field(:TYPE_SINT64, 18) end + defmodule Google.Protobuf.FieldDescriptorProto.Label do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :LABEL_OPTIONAL, 1 - field :LABEL_REPEATED, 3 - field :LABEL_REQUIRED, 2 + field(:LABEL_OPTIONAL, 1) + field(:LABEL_REPEATED, 3) + field(:LABEL_REQUIRED, 2) end + defmodule Google.Protobuf.FileOptions.OptimizeMode do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :SPEED, 1 - field :CODE_SIZE, 2 - field :LITE_RUNTIME, 3 + field(:SPEED, 1) + field(:CODE_SIZE, 2) + field(:LITE_RUNTIME, 3) end + defmodule Google.Protobuf.FieldOptions.CType do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :STRING, 0 - field :CORD, 1 - field :STRING_PIECE, 2 + field(:STRING, 0) + field(:CORD, 1) + field(:STRING_PIECE, 2) end + defmodule Google.Protobuf.FieldOptions.JSType do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :JS_NORMAL, 0 - field :JS_STRING, 1 - field :JS_NUMBER, 2 + field(:JS_NORMAL, 0) + field(:JS_STRING, 1) + field(:JS_NUMBER, 2) end + defmodule Google.Protobuf.FieldOptions.OptionRetention do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :RETENTION_UNKNOWN, 0 - field :RETENTION_RUNTIME, 1 - field :RETENTION_SOURCE, 2 + field(:RETENTION_UNKNOWN, 0) + field(:RETENTION_RUNTIME, 1) + field(:RETENTION_SOURCE, 2) end + defmodule Google.Protobuf.FieldOptions.OptionTargetType do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :TARGET_TYPE_UNKNOWN, 0 - field :TARGET_TYPE_FILE, 1 - field :TARGET_TYPE_EXTENSION_RANGE, 2 - field :TARGET_TYPE_MESSAGE, 3 - field :TARGET_TYPE_FIELD, 4 - field :TARGET_TYPE_ONEOF, 5 - field :TARGET_TYPE_ENUM, 6 - field :TARGET_TYPE_ENUM_ENTRY, 7 - field :TARGET_TYPE_SERVICE, 8 - field :TARGET_TYPE_METHOD, 9 + field(:TARGET_TYPE_UNKNOWN, 0) + field(:TARGET_TYPE_FILE, 1) + field(:TARGET_TYPE_EXTENSION_RANGE, 2) + field(:TARGET_TYPE_MESSAGE, 3) + field(:TARGET_TYPE_FIELD, 4) + field(:TARGET_TYPE_ONEOF, 5) + field(:TARGET_TYPE_ENUM, 6) + field(:TARGET_TYPE_ENUM_ENTRY, 7) + field(:TARGET_TYPE_SERVICE, 8) + field(:TARGET_TYPE_METHOD, 9) end + defmodule Google.Protobuf.MethodOptions.IdempotencyLevel do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :IDEMPOTENCY_UNKNOWN, 0 - field :NO_SIDE_EFFECTS, 1 - field :IDEMPOTENT, 2 + field(:IDEMPOTENCY_UNKNOWN, 0) + field(:NO_SIDE_EFFECTS, 1) + field(:IDEMPOTENT, 2) end + defmodule Google.Protobuf.FeatureSet.FieldPresence do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :FIELD_PRESENCE_UNKNOWN, 0 - field :EXPLICIT, 1 - field :IMPLICIT, 2 - field :LEGACY_REQUIRED, 3 + field(:FIELD_PRESENCE_UNKNOWN, 0) + field(:EXPLICIT, 1) + field(:IMPLICIT, 2) + field(:LEGACY_REQUIRED, 3) end + defmodule Google.Protobuf.FeatureSet.EnumType do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :ENUM_TYPE_UNKNOWN, 0 - field :OPEN, 1 - field :CLOSED, 2 + field(:ENUM_TYPE_UNKNOWN, 0) + field(:OPEN, 1) + field(:CLOSED, 2) end + defmodule Google.Protobuf.FeatureSet.RepeatedFieldEncoding do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :REPEATED_FIELD_ENCODING_UNKNOWN, 0 - field :PACKED, 1 - field :EXPANDED, 2 + field(:REPEATED_FIELD_ENCODING_UNKNOWN, 0) + field(:PACKED, 1) + field(:EXPANDED, 2) end + defmodule Google.Protobuf.FeatureSet.Utf8Validation do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :UTF8_VALIDATION_UNKNOWN, 0 - field :VERIFY, 2 - field :NONE, 3 + field(:UTF8_VALIDATION_UNKNOWN, 0) + field(:VERIFY, 2) + field(:NONE, 3) end + defmodule Google.Protobuf.FeatureSet.MessageEncoding do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :MESSAGE_ENCODING_UNKNOWN, 0 - field :LENGTH_PREFIXED, 1 - field :DELIMITED, 2 + field(:MESSAGE_ENCODING_UNKNOWN, 0) + field(:LENGTH_PREFIXED, 1) + field(:DELIMITED, 2) end + defmodule Google.Protobuf.FeatureSet.JsonFormat do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :JSON_FORMAT_UNKNOWN, 0 - field :ALLOW, 1 - field :LEGACY_BEST_EFFORT, 2 + field(:JSON_FORMAT_UNKNOWN, 0) + field(:ALLOW, 1) + field(:LEGACY_BEST_EFFORT, 2) end + defmodule Google.Protobuf.GeneratedCodeInfo.Annotation.Semantic do @moduledoc false use Protobuf, enum: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :NONE, 0 - field :SET, 1 - field :ALIAS, 2 + field(:NONE, 0) + field(:SET, 1) + field(:ALIAS, 2) end + defmodule Google.Protobuf.FileDescriptorSet do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :file, 1, repeated: true, type: Google.Protobuf.FileDescriptorProto + field(:file, 1, repeated: true, type: Google.Protobuf.FileDescriptorProto) end + defmodule Google.Protobuf.FileDescriptorProto do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 1, optional: true, type: :string - field :package, 2, optional: true, type: :string - field :dependency, 3, repeated: true, type: :string - field :public_dependency, 10, repeated: true, type: :int32 - field :weak_dependency, 11, repeated: true, type: :int32 - field :message_type, 4, repeated: true, type: Google.Protobuf.DescriptorProto - field :enum_type, 5, repeated: true, type: Google.Protobuf.EnumDescriptorProto - field :service, 6, repeated: true, type: Google.Protobuf.ServiceDescriptorProto - field :extension, 7, repeated: true, type: Google.Protobuf.FieldDescriptorProto - field :options, 8, optional: true, type: Google.Protobuf.FileOptions - field :source_code_info, 9, optional: true, type: Google.Protobuf.SourceCodeInfo - field :syntax, 12, optional: true, type: :string - field :edition, 14, optional: true, type: Google.Protobuf.Edition, enum: true + field(:name, 1, optional: true, type: :string) + field(:package, 2, optional: true, type: :string) + field(:dependency, 3, repeated: true, type: :string) + field(:public_dependency, 10, repeated: true, type: :int32) + field(:weak_dependency, 11, repeated: true, type: :int32) + field(:message_type, 4, repeated: true, type: Google.Protobuf.DescriptorProto) + field(:enum_type, 5, repeated: true, type: Google.Protobuf.EnumDescriptorProto) + field(:service, 6, repeated: true, type: Google.Protobuf.ServiceDescriptorProto) + field(:extension, 7, repeated: true, type: Google.Protobuf.FieldDescriptorProto) + field(:options, 8, optional: true, type: Google.Protobuf.FileOptions) + field(:source_code_info, 9, optional: true, type: Google.Protobuf.SourceCodeInfo) + field(:syntax, 12, optional: true, type: :string) + field(:edition, 14, optional: true, type: Google.Protobuf.Edition, enum: true) end + defmodule Google.Protobuf.DescriptorProto.ExtensionRange do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :start, 1, optional: true, type: :int32 - field :end, 2, optional: true, type: :int32 - field :options, 3, optional: true, type: Google.Protobuf.ExtensionRangeOptions + field(:start, 1, optional: true, type: :int32) + field(:end, 2, optional: true, type: :int32) + field(:options, 3, optional: true, type: Google.Protobuf.ExtensionRangeOptions) end + defmodule Google.Protobuf.DescriptorProto.ReservedRange do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :start, 1, optional: true, type: :int32 - field :end, 2, optional: true, type: :int32 + field(:start, 1, optional: true, type: :int32) + field(:end, 2, optional: true, type: :int32) end + defmodule Google.Protobuf.DescriptorProto do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 1, optional: true, type: :string - field :field, 2, repeated: true, type: Google.Protobuf.FieldDescriptorProto - field :extension, 6, repeated: true, type: Google.Protobuf.FieldDescriptorProto - field :nested_type, 3, repeated: true, type: Google.Protobuf.DescriptorProto - field :enum_type, 4, repeated: true, type: Google.Protobuf.EnumDescriptorProto - field :extension_range, 5, repeated: true, type: Google.Protobuf.DescriptorProto.ExtensionRange - field :oneof_decl, 8, repeated: true, type: Google.Protobuf.OneofDescriptorProto - field :options, 7, optional: true, type: Google.Protobuf.MessageOptions - field :reserved_range, 9, repeated: true, type: Google.Protobuf.DescriptorProto.ReservedRange - field :reserved_name, 10, repeated: true, type: :string + field(:name, 1, optional: true, type: :string) + field(:field, 2, repeated: true, type: Google.Protobuf.FieldDescriptorProto) + field(:extension, 6, repeated: true, type: Google.Protobuf.FieldDescriptorProto) + field(:nested_type, 3, repeated: true, type: Google.Protobuf.DescriptorProto) + field(:enum_type, 4, repeated: true, type: Google.Protobuf.EnumDescriptorProto) + field(:extension_range, 5, repeated: true, type: Google.Protobuf.DescriptorProto.ExtensionRange) + field(:oneof_decl, 8, repeated: true, type: Google.Protobuf.OneofDescriptorProto) + field(:options, 7, optional: true, type: Google.Protobuf.MessageOptions) + field(:reserved_range, 9, repeated: true, type: Google.Protobuf.DescriptorProto.ReservedRange) + field(:reserved_name, 10, repeated: true, type: :string) end + defmodule Google.Protobuf.ExtensionRangeOptions.Declaration do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :number, 1, optional: true, type: :int32 - field :full_name, 2, optional: true, type: :string - field :type, 3, optional: true, type: :string - field :reserved, 5, optional: true, type: :bool - field :repeated, 6, optional: true, type: :bool + field(:number, 1, optional: true, type: :int32) + field(:full_name, 2, optional: true, type: :string) + field(:type, 3, optional: true, type: :string) + field(:reserved, 5, optional: true, type: :bool) + field(:repeated, 6, optional: true, type: :bool) end + defmodule Google.Protobuf.ExtensionRangeOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) - field :declaration, 2, + field(:declaration, 2, repeated: true, type: Google.Protobuf.ExtensionRangeOptions.Declaration, deprecated: false + ) - field :features, 50, optional: true, type: Google.Protobuf.FeatureSet + field(:features, 50, optional: true, type: Google.Protobuf.FeatureSet) - field :verification, 3, + field(:verification, 3, optional: true, type: Google.Protobuf.ExtensionRangeOptions.VerificationState, default: :UNVERIFIED, enum: true, deprecated: false + ) - extensions [{1000, 536_870_912}] + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.FieldDescriptorProto do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 1, optional: true, type: :string - field :number, 3, optional: true, type: :int32 - field :label, 4, optional: true, type: Google.Protobuf.FieldDescriptorProto.Label, enum: true - field :type, 5, optional: true, type: Google.Protobuf.FieldDescriptorProto.Type, enum: true - field :type_name, 6, optional: true, type: :string - field :extendee, 2, optional: true, type: :string - field :default_value, 7, optional: true, type: :string - field :oneof_index, 9, optional: true, type: :int32 - field :json_name, 10, optional: true, type: :string - field :options, 8, optional: true, type: Google.Protobuf.FieldOptions - field :proto3_optional, 17, optional: true, type: :bool + field(:name, 1, optional: true, type: :string) + field(:number, 3, optional: true, type: :int32) + field(:label, 4, optional: true, type: Google.Protobuf.FieldDescriptorProto.Label, enum: true) + field(:type, 5, optional: true, type: Google.Protobuf.FieldDescriptorProto.Type, enum: true) + field(:type_name, 6, optional: true, type: :string) + field(:extendee, 2, optional: true, type: :string) + field(:default_value, 7, optional: true, type: :string) + field(:oneof_index, 9, optional: true, type: :int32) + field(:json_name, 10, optional: true, type: :string) + field(:options, 8, optional: true, type: Google.Protobuf.FieldOptions) + field(:proto3_optional, 17, optional: true, type: :bool) end + defmodule Google.Protobuf.OneofDescriptorProto do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 1, optional: true, type: :string - field :options, 2, optional: true, type: Google.Protobuf.OneofOptions + field(:name, 1, optional: true, type: :string) + field(:options, 2, optional: true, type: Google.Protobuf.OneofOptions) end + defmodule Google.Protobuf.EnumDescriptorProto.EnumReservedRange do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :start, 1, optional: true, type: :int32 - field :end, 2, optional: true, type: :int32 + field(:start, 1, optional: true, type: :int32) + field(:end, 2, optional: true, type: :int32) end + defmodule Google.Protobuf.EnumDescriptorProto do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 1, optional: true, type: :string - field :value, 2, repeated: true, type: Google.Protobuf.EnumValueDescriptorProto - field :options, 3, optional: true, type: Google.Protobuf.EnumOptions + field(:name, 1, optional: true, type: :string) + field(:value, 2, repeated: true, type: Google.Protobuf.EnumValueDescriptorProto) + field(:options, 3, optional: true, type: Google.Protobuf.EnumOptions) - field :reserved_range, 4, + field(:reserved_range, 4, repeated: true, type: Google.Protobuf.EnumDescriptorProto.EnumReservedRange + ) - field :reserved_name, 5, repeated: true, type: :string + field(:reserved_name, 5, repeated: true, type: :string) end + defmodule Google.Protobuf.EnumValueDescriptorProto do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 1, optional: true, type: :string - field :number, 2, optional: true, type: :int32 - field :options, 3, optional: true, type: Google.Protobuf.EnumValueOptions + field(:name, 1, optional: true, type: :string) + field(:number, 2, optional: true, type: :int32) + field(:options, 3, optional: true, type: Google.Protobuf.EnumValueOptions) end + defmodule Google.Protobuf.ServiceDescriptorProto do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 1, optional: true, type: :string - field :method, 2, repeated: true, type: Google.Protobuf.MethodDescriptorProto - field :options, 3, optional: true, type: Google.Protobuf.ServiceOptions + field(:name, 1, optional: true, type: :string) + field(:method, 2, repeated: true, type: Google.Protobuf.MethodDescriptorProto) + field(:options, 3, optional: true, type: Google.Protobuf.ServiceOptions) end + defmodule Google.Protobuf.MethodDescriptorProto do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 1, optional: true, type: :string - field :input_type, 2, optional: true, type: :string - field :output_type, 3, optional: true, type: :string - field :options, 4, optional: true, type: Google.Protobuf.MethodOptions - field :client_streaming, 5, optional: true, type: :bool, default: false - field :server_streaming, 6, optional: true, type: :bool, default: false + field(:name, 1, optional: true, type: :string) + field(:input_type, 2, optional: true, type: :string) + field(:output_type, 3, optional: true, type: :string) + field(:options, 4, optional: true, type: Google.Protobuf.MethodOptions) + field(:client_streaming, 5, optional: true, type: :bool, default: false) + field(:server_streaming, 6, optional: true, type: :bool, default: false) end + defmodule Google.Protobuf.FileOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :java_package, 1, optional: true, type: :string - field :java_outer_classname, 8, optional: true, type: :string - field :java_multiple_files, 10, optional: true, type: :bool, default: false - field :java_generate_equals_and_hash, 20, optional: true, type: :bool, deprecated: true - field :java_string_check_utf8, 27, optional: true, type: :bool, default: false + field(:java_package, 1, optional: true, type: :string) + field(:java_outer_classname, 8, optional: true, type: :string) + field(:java_multiple_files, 10, optional: true, type: :bool, default: false) + field(:java_generate_equals_and_hash, 20, optional: true, type: :bool, deprecated: true) + field(:java_string_check_utf8, 27, optional: true, type: :bool, default: false) - field :optimize_for, 9, + field(:optimize_for, 9, optional: true, type: Google.Protobuf.FileOptions.OptimizeMode, default: :SPEED, enum: true - - field :go_package, 11, optional: true, type: :string - field :cc_generic_services, 16, optional: true, type: :bool, default: false - field :java_generic_services, 17, optional: true, type: :bool, default: false - field :py_generic_services, 18, optional: true, type: :bool, default: false - field :deprecated, 23, optional: true, type: :bool, default: false - field :cc_enable_arenas, 31, optional: true, type: :bool, default: true - field :objc_class_prefix, 36, optional: true, type: :string - field :csharp_namespace, 37, optional: true, type: :string - field :swift_prefix, 39, optional: true, type: :string - field :php_class_prefix, 40, optional: true, type: :string - field :php_namespace, 41, optional: true, type: :string - field :php_metadata_namespace, 44, optional: true, type: :string - field :ruby_package, 45, optional: true, type: :string - field :features, 50, optional: true, type: Google.Protobuf.FeatureSet - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption - - extensions [{1000, 536_870_912}] + ) + + field(:go_package, 11, optional: true, type: :string) + field(:cc_generic_services, 16, optional: true, type: :bool, default: false) + field(:java_generic_services, 17, optional: true, type: :bool, default: false) + field(:py_generic_services, 18, optional: true, type: :bool, default: false) + field(:deprecated, 23, optional: true, type: :bool, default: false) + field(:cc_enable_arenas, 31, optional: true, type: :bool, default: true) + field(:objc_class_prefix, 36, optional: true, type: :string) + field(:csharp_namespace, 37, optional: true, type: :string) + field(:swift_prefix, 39, optional: true, type: :string) + field(:php_class_prefix, 40, optional: true, type: :string) + field(:php_namespace, 41, optional: true, type: :string) + field(:php_metadata_namespace, 44, optional: true, type: :string) + field(:ruby_package, 45, optional: true, type: :string) + field(:features, 50, optional: true, type: Google.Protobuf.FeatureSet) + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) + + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.MessageOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :message_set_wire_format, 1, optional: true, type: :bool, default: false - field :no_standard_descriptor_accessor, 2, optional: true, type: :bool, default: false - field :deprecated, 3, optional: true, type: :bool, default: false - field :map_entry, 7, optional: true, type: :bool - field :deprecated_legacy_json_field_conflicts, 11, optional: true, type: :bool, deprecated: true - field :features, 12, optional: true, type: Google.Protobuf.FeatureSet - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field(:message_set_wire_format, 1, optional: true, type: :bool, default: false) + field(:no_standard_descriptor_accessor, 2, optional: true, type: :bool, default: false) + field(:deprecated, 3, optional: true, type: :bool, default: false) + field(:map_entry, 7, optional: true, type: :bool) - extensions [{1000, 536_870_912}] + field(:deprecated_legacy_json_field_conflicts, 11, + optional: true, + type: :bool, + deprecated: true + ) + + field(:features, 12, optional: true, type: Google.Protobuf.FeatureSet) + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) + + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.FieldOptions.EditionDefault do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :edition, 3, optional: true, type: Google.Protobuf.Edition, enum: true - field :value, 2, optional: true, type: :string + field(:edition, 3, optional: true, type: Google.Protobuf.Edition, enum: true) + field(:value, 2, optional: true, type: :string) end + defmodule Google.Protobuf.FieldOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :ctype, 1, + field(:ctype, 1, optional: true, type: Google.Protobuf.FieldOptions.CType, default: :STRING, enum: true + ) - field :packed, 2, optional: true, type: :bool + field(:packed, 2, optional: true, type: :bool) - field :jstype, 6, + field(:jstype, 6, optional: true, type: Google.Protobuf.FieldOptions.JSType, default: :JS_NORMAL, enum: true + ) - field :lazy, 5, optional: true, type: :bool, default: false - field :unverified_lazy, 15, optional: true, type: :bool, default: false - field :deprecated, 3, optional: true, type: :bool, default: false - field :weak, 10, optional: true, type: :bool, default: false - field :debug_redact, 16, optional: true, type: :bool, default: false + field(:lazy, 5, optional: true, type: :bool, default: false) + field(:unverified_lazy, 15, optional: true, type: :bool, default: false) + field(:deprecated, 3, optional: true, type: :bool, default: false) + field(:weak, 10, optional: true, type: :bool, default: false) + field(:debug_redact, 16, optional: true, type: :bool, default: false) - field :retention, 17, + field(:retention, 17, optional: true, type: Google.Protobuf.FieldOptions.OptionRetention, enum: true + ) - field :targets, 19, + field(:targets, 19, repeated: true, type: Google.Protobuf.FieldOptions.OptionTargetType, enum: true + ) - field :edition_defaults, 20, repeated: true, type: Google.Protobuf.FieldOptions.EditionDefault - field :features, 21, optional: true, type: Google.Protobuf.FeatureSet - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field(:edition_defaults, 20, repeated: true, type: Google.Protobuf.FieldOptions.EditionDefault) + field(:features, 21, optional: true, type: Google.Protobuf.FeatureSet) + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) - extensions [{1000, 536_870_912}] + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.OneofOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :features, 1, optional: true, type: Google.Protobuf.FeatureSet - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field(:features, 1, optional: true, type: Google.Protobuf.FeatureSet) + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) - extensions [{1000, 536_870_912}] + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.EnumOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :allow_alias, 2, optional: true, type: :bool - field :deprecated, 3, optional: true, type: :bool, default: false - field :deprecated_legacy_json_field_conflicts, 6, optional: true, type: :bool, deprecated: true - field :features, 7, optional: true, type: Google.Protobuf.FeatureSet - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field(:allow_alias, 2, optional: true, type: :bool) + field(:deprecated, 3, optional: true, type: :bool, default: false) + field(:deprecated_legacy_json_field_conflicts, 6, optional: true, type: :bool, deprecated: true) + field(:features, 7, optional: true, type: Google.Protobuf.FeatureSet) + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) - extensions [{1000, 536_870_912}] + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.EnumValueOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :deprecated, 1, optional: true, type: :bool, default: false - field :features, 2, optional: true, type: Google.Protobuf.FeatureSet - field :debug_redact, 3, optional: true, type: :bool, default: false - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field(:deprecated, 1, optional: true, type: :bool, default: false) + field(:features, 2, optional: true, type: Google.Protobuf.FeatureSet) + field(:debug_redact, 3, optional: true, type: :bool, default: false) + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) - extensions [{1000, 536_870_912}] + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.ServiceOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :features, 34, optional: true, type: Google.Protobuf.FeatureSet - field :deprecated, 33, optional: true, type: :bool, default: false - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field(:features, 34, optional: true, type: Google.Protobuf.FeatureSet) + field(:deprecated, 33, optional: true, type: :bool, default: false) + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) - extensions [{1000, 536_870_912}] + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.MethodOptions do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :deprecated, 33, optional: true, type: :bool, default: false + field(:deprecated, 33, optional: true, type: :bool, default: false) - field :idempotency_level, 34, + field(:idempotency_level, 34, optional: true, type: Google.Protobuf.MethodOptions.IdempotencyLevel, default: :IDEMPOTENCY_UNKNOWN, enum: true + ) - field :features, 35, optional: true, type: Google.Protobuf.FeatureSet - field :uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption + field(:features, 35, optional: true, type: Google.Protobuf.FeatureSet) + field(:uninterpreted_option, 999, repeated: true, type: Google.Protobuf.UninterpretedOption) - extensions [{1000, 536_870_912}] + extensions([{1000, 536_870_912}]) end + defmodule Google.Protobuf.UninterpretedOption.NamePart do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name_part, 1, required: true, type: :string - field :is_extension, 2, required: true, type: :bool + field(:name_part, 1, required: true, type: :string) + field(:is_extension, 2, required: true, type: :bool) end + defmodule Google.Protobuf.UninterpretedOption do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :name, 2, repeated: true, type: Google.Protobuf.UninterpretedOption.NamePart - field :identifier_value, 3, optional: true, type: :string - field :positive_int_value, 4, optional: true, type: :uint64 - field :negative_int_value, 5, optional: true, type: :int64 - field :double_value, 6, optional: true, type: :double - field :string_value, 7, optional: true, type: :bytes - field :aggregate_value, 8, optional: true, type: :string + field(:name, 2, repeated: true, type: Google.Protobuf.UninterpretedOption.NamePart) + field(:identifier_value, 3, optional: true, type: :string) + field(:positive_int_value, 4, optional: true, type: :uint64) + field(:negative_int_value, 5, optional: true, type: :int64) + field(:double_value, 6, optional: true, type: :double) + field(:string_value, 7, optional: true, type: :bytes) + field(:aggregate_value, 8, optional: true, type: :string) end + defmodule Google.Protobuf.FeatureSet do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :field_presence, 1, + field(:field_presence, 1, optional: true, type: Google.Protobuf.FeatureSet.FieldPresence, enum: true, deprecated: false + ) - field :enum_type, 2, + field(:enum_type, 2, optional: true, type: Google.Protobuf.FeatureSet.EnumType, enum: true, deprecated: false + ) - field :repeated_field_encoding, 3, + field(:repeated_field_encoding, 3, optional: true, type: Google.Protobuf.FeatureSet.RepeatedFieldEncoding, enum: true, deprecated: false + ) - field :utf8_validation, 4, + field(:utf8_validation, 4, optional: true, type: Google.Protobuf.FeatureSet.Utf8Validation, enum: true, deprecated: false + ) - field :message_encoding, 5, + field(:message_encoding, 5, optional: true, type: Google.Protobuf.FeatureSet.MessageEncoding, enum: true, deprecated: false + ) - field :json_format, 6, + field(:json_format, 6, optional: true, type: Google.Protobuf.FeatureSet.JsonFormat, enum: true, deprecated: false + ) - extensions [{1000, 1001}, {1001, 1002}, {1002, 1003}, {9995, 10000}, {10000, 10001}] + extensions([{1000, 1001}, {1001, 1002}, {1002, 1003}, {9995, 10000}, {10000, 10001}]) end + defmodule Google.Protobuf.FeatureSetDefaults.FeatureSetEditionDefault do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :edition, 3, optional: true, type: Google.Protobuf.Edition, enum: true - field :features, 2, optional: true, type: Google.Protobuf.FeatureSet + field(:edition, 3, optional: true, type: Google.Protobuf.Edition, enum: true) + field(:features, 2, optional: true, type: Google.Protobuf.FeatureSet) end + defmodule Google.Protobuf.FeatureSetDefaults do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :defaults, 1, + field(:defaults, 1, repeated: true, type: Google.Protobuf.FeatureSetDefaults.FeatureSetEditionDefault + ) - field :minimum_edition, 4, optional: true, type: Google.Protobuf.Edition, enum: true - field :maximum_edition, 5, optional: true, type: Google.Protobuf.Edition, enum: true + field(:minimum_edition, 4, optional: true, type: Google.Protobuf.Edition, enum: true) + field(:maximum_edition, 5, optional: true, type: Google.Protobuf.Edition, enum: true) end + defmodule Google.Protobuf.SourceCodeInfo.Location do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :path, 1, repeated: true, type: :int32, packed: true, deprecated: false - field :span, 2, repeated: true, type: :int32, packed: true, deprecated: false - field :leading_comments, 3, optional: true, type: :string - field :trailing_comments, 4, optional: true, type: :string - field :leading_detached_comments, 6, repeated: true, type: :string + field(:path, 1, repeated: true, type: :int32, packed: true, deprecated: false) + field(:span, 2, repeated: true, type: :int32, packed: true, deprecated: false) + field(:leading_comments, 3, optional: true, type: :string) + field(:trailing_comments, 4, optional: true, type: :string) + field(:leading_detached_comments, 6, repeated: true, type: :string) end + defmodule Google.Protobuf.SourceCodeInfo do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :location, 1, repeated: true, type: Google.Protobuf.SourceCodeInfo.Location + field(:location, 1, repeated: true, type: Google.Protobuf.SourceCodeInfo.Location) end + defmodule Google.Protobuf.GeneratedCodeInfo.Annotation do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :path, 1, repeated: true, type: :int32, packed: true, deprecated: false - field :source_file, 2, optional: true, type: :string - field :begin, 3, optional: true, type: :int32 - field :end, 4, optional: true, type: :int32 + field(:path, 1, repeated: true, type: :int32, packed: true, deprecated: false) + field(:source_file, 2, optional: true, type: :string) + field(:begin, 3, optional: true, type: :int32) + field(:end, 4, optional: true, type: :int32) - field :semantic, 5, + field(:semantic, 5, optional: true, type: Google.Protobuf.GeneratedCodeInfo.Annotation.Semantic, enum: true + ) end + defmodule Google.Protobuf.GeneratedCodeInfo do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto2 - field :annotation, 1, repeated: true, type: Google.Protobuf.GeneratedCodeInfo.Annotation + field(:annotation, 1, repeated: true, type: Google.Protobuf.GeneratedCodeInfo.Annotation) end diff --git a/lib/spawn/google/protobuf/duration.pb.ex b/lib/spawn/google/protobuf/duration.pb.ex index 0679508f..22d30826 100644 --- a/lib/spawn/google/protobuf/duration.pb.ex +++ b/lib/spawn/google/protobuf/duration.pb.ex @@ -48,6 +48,6 @@ defmodule Google.Protobuf.Duration do } end - field :seconds, 1, type: :int64 - field :nanos, 2, type: :int32 + field(:seconds, 1, type: :int64) + field(:nanos, 2, type: :int32) end diff --git a/lib/spawn/google/protobuf/field_mask.pb.ex b/lib/spawn/google/protobuf/field_mask.pb.ex index 01097679..3d64f8ea 100644 --- a/lib/spawn/google/protobuf/field_mask.pb.ex +++ b/lib/spawn/google/protobuf/field_mask.pb.ex @@ -34,5 +34,5 @@ defmodule Google.Protobuf.FieldMask do } end - field :paths, 1, repeated: true, type: :string + field(:paths, 1, repeated: true, type: :string) end diff --git a/lib/spawn/google/protobuf/source_context.pb.ex b/lib/spawn/google/protobuf/source_context.pb.ex index 246fcc1f..0b0161e4 100644 --- a/lib/spawn/google/protobuf/source_context.pb.ex +++ b/lib/spawn/google/protobuf/source_context.pb.ex @@ -34,5 +34,5 @@ defmodule Google.Protobuf.SourceContext do } end - field :file_name, 1, type: :string, json_name: "fileName" + field(:file_name, 1, type: :string, json_name: "fileName") end diff --git a/lib/spawn/google/protobuf/struct.pb.ex b/lib/spawn/google/protobuf/struct.pb.ex index 050ddc84..7e671f29 100644 --- a/lib/spawn/google/protobuf/struct.pb.ex +++ b/lib/spawn/google/protobuf/struct.pb.ex @@ -21,8 +21,9 @@ defmodule Google.Protobuf.NullValue do } end - field :NULL_VALUE, 0 + field(:NULL_VALUE, 0) end + defmodule Google.Protobuf.Struct.FieldsEntry do @moduledoc false use Protobuf, map: true, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -81,9 +82,10 @@ defmodule Google.Protobuf.Struct.FieldsEntry do } end - field :key, 1, type: :string - field :value, 2, type: Google.Protobuf.Value + field(:key, 1, type: :string) + field(:value, 2, type: Google.Protobuf.Value) end + defmodule Google.Protobuf.Struct do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -171,8 +173,9 @@ defmodule Google.Protobuf.Struct do } end - field :fields, 1, repeated: true, type: Google.Protobuf.Struct.FieldsEntry, map: true + field(:fields, 1, repeated: true, type: Google.Protobuf.Struct.FieldsEntry, map: true) end + defmodule Google.Protobuf.Value do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -281,20 +284,22 @@ defmodule Google.Protobuf.Value do } end - oneof :kind, 0 + oneof(:kind, 0) - field :null_value, 1, + field(:null_value, 1, type: Google.Protobuf.NullValue, json_name: "nullValue", enum: true, oneof: 0 + ) - field :number_value, 2, type: :double, json_name: "numberValue", oneof: 0 - field :string_value, 3, type: :string, json_name: "stringValue", oneof: 0 - field :bool_value, 4, type: :bool, json_name: "boolValue", oneof: 0 - field :struct_value, 5, type: Google.Protobuf.Struct, json_name: "structValue", oneof: 0 - field :list_value, 6, type: Google.Protobuf.ListValue, json_name: "listValue", oneof: 0 + field(:number_value, 2, type: :double, json_name: "numberValue", oneof: 0) + field(:string_value, 3, type: :string, json_name: "stringValue", oneof: 0) + field(:bool_value, 4, type: :bool, json_name: "boolValue", oneof: 0) + field(:struct_value, 5, type: Google.Protobuf.Struct, json_name: "structValue", oneof: 0) + field(:list_value, 6, type: Google.Protobuf.ListValue, json_name: "listValue", oneof: 0) end + defmodule Google.Protobuf.ListValue do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -331,5 +336,5 @@ defmodule Google.Protobuf.ListValue do } end - field :values, 1, repeated: true, type: Google.Protobuf.Value + field(:values, 1, repeated: true, type: Google.Protobuf.Value) end diff --git a/lib/spawn/google/protobuf/timestamp.pb.ex b/lib/spawn/google/protobuf/timestamp.pb.ex index b6086b41..6c87ba0f 100644 --- a/lib/spawn/google/protobuf/timestamp.pb.ex +++ b/lib/spawn/google/protobuf/timestamp.pb.ex @@ -48,6 +48,6 @@ defmodule Google.Protobuf.Timestamp do } end - field :seconds, 1, type: :int64 - field :nanos, 2, type: :int32 + field(:seconds, 1, type: :int64) + field(:nanos, 2, type: :int32) end diff --git a/lib/spawn/google/protobuf/wrappers.pb.ex b/lib/spawn/google/protobuf/wrappers.pb.ex index 985ffe2e..0ccc40e9 100644 --- a/lib/spawn/google/protobuf/wrappers.pb.ex +++ b/lib/spawn/google/protobuf/wrappers.pb.ex @@ -34,8 +34,9 @@ defmodule Google.Protobuf.DoubleValue do } end - field :value, 1, type: :double + field(:value, 1, type: :double) end + defmodule Google.Protobuf.FloatValue do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -72,8 +73,9 @@ defmodule Google.Protobuf.FloatValue do } end - field :value, 1, type: :float + field(:value, 1, type: :float) end + defmodule Google.Protobuf.Int64Value do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -110,8 +112,9 @@ defmodule Google.Protobuf.Int64Value do } end - field :value, 1, type: :int64 + field(:value, 1, type: :int64) end + defmodule Google.Protobuf.UInt64Value do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -148,8 +151,9 @@ defmodule Google.Protobuf.UInt64Value do } end - field :value, 1, type: :uint64 + field(:value, 1, type: :uint64) end + defmodule Google.Protobuf.Int32Value do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -186,8 +190,9 @@ defmodule Google.Protobuf.Int32Value do } end - field :value, 1, type: :int32 + field(:value, 1, type: :int32) end + defmodule Google.Protobuf.UInt32Value do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -224,8 +229,9 @@ defmodule Google.Protobuf.UInt32Value do } end - field :value, 1, type: :uint32 + field(:value, 1, type: :uint32) end + defmodule Google.Protobuf.BoolValue do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -262,8 +268,9 @@ defmodule Google.Protobuf.BoolValue do } end - field :value, 1, type: :bool + field(:value, 1, type: :bool) end + defmodule Google.Protobuf.StringValue do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -300,8 +307,9 @@ defmodule Google.Protobuf.StringValue do } end - field :value, 1, type: :string + field(:value, 1, type: :string) end + defmodule Google.Protobuf.BytesValue do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -338,5 +346,5 @@ defmodule Google.Protobuf.BytesValue do } end - field :value, 1, type: :bytes + field(:value, 1, type: :bytes) end diff --git a/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex b/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex index acc59fcc..29a76e93 100644 --- a/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex +++ b/lib/spawn/grpc/reflection/v1alpha/reflection.pb.ex @@ -110,24 +110,27 @@ defmodule Grpc.Reflection.V1alpha.ServerReflectionRequest do } end - oneof :message_request, 0 + oneof(:message_request, 0) - field :host, 1, type: :string - field :file_by_filename, 3, type: :string, json_name: "fileByFilename", oneof: 0 - field :file_containing_symbol, 4, type: :string, json_name: "fileContainingSymbol", oneof: 0 + field(:host, 1, type: :string) + field(:file_by_filename, 3, type: :string, json_name: "fileByFilename", oneof: 0) + field(:file_containing_symbol, 4, type: :string, json_name: "fileContainingSymbol", oneof: 0) - field :file_containing_extension, 5, + field(:file_containing_extension, 5, type: Grpc.Reflection.V1alpha.ExtensionRequest, json_name: "fileContainingExtension", oneof: 0 + ) - field :all_extension_numbers_of_type, 6, + field(:all_extension_numbers_of_type, 6, type: :string, json_name: "allExtensionNumbersOfType", oneof: 0 + ) - field :list_services, 7, type: :string, json_name: "listServices", oneof: 0 + field(:list_services, 7, type: :string, json_name: "listServices", oneof: 0) end + defmodule Grpc.Reflection.V1alpha.ExtensionRequest do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -178,9 +181,10 @@ defmodule Grpc.Reflection.V1alpha.ExtensionRequest do } end - field :containing_type, 1, type: :string, json_name: "containingType" - field :extension_number, 2, type: :int32, json_name: "extensionNumber" + field(:containing_type, 1, type: :string, json_name: "containingType") + field(:extension_number, 2, type: :int32, json_name: "extensionNumber") end + defmodule Grpc.Reflection.V1alpha.ServerReflectionResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -293,34 +297,40 @@ defmodule Grpc.Reflection.V1alpha.ServerReflectionResponse do } end - oneof :message_response, 0 + oneof(:message_response, 0) - field :valid_host, 1, type: :string, json_name: "validHost" + field(:valid_host, 1, type: :string, json_name: "validHost") - field :original_request, 2, + field(:original_request, 2, type: Grpc.Reflection.V1alpha.ServerReflectionRequest, json_name: "originalRequest" + ) - field :file_descriptor_response, 4, + field(:file_descriptor_response, 4, type: Grpc.Reflection.V1alpha.FileDescriptorResponse, json_name: "fileDescriptorResponse", oneof: 0 + ) - field :all_extension_numbers_response, 5, + field(:all_extension_numbers_response, 5, type: Grpc.Reflection.V1alpha.ExtensionNumberResponse, json_name: "allExtensionNumbersResponse", oneof: 0 + ) - field :list_services_response, 6, + field(:list_services_response, 6, type: Grpc.Reflection.V1alpha.ListServiceResponse, json_name: "listServicesResponse", oneof: 0 + ) - field :error_response, 7, + field(:error_response, 7, type: Grpc.Reflection.V1alpha.ErrorResponse, json_name: "errorResponse", oneof: 0 + ) end + defmodule Grpc.Reflection.V1alpha.FileDescriptorResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -357,8 +367,9 @@ defmodule Grpc.Reflection.V1alpha.FileDescriptorResponse do } end - field :file_descriptor_proto, 1, repeated: true, type: :bytes, json_name: "fileDescriptorProto" + field(:file_descriptor_proto, 1, repeated: true, type: :bytes, json_name: "fileDescriptorProto") end + defmodule Grpc.Reflection.V1alpha.ExtensionNumberResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -409,9 +420,10 @@ defmodule Grpc.Reflection.V1alpha.ExtensionNumberResponse do } end - field :base_type_name, 1, type: :string, json_name: "baseTypeName" - field :extension_number, 2, repeated: true, type: :int32, json_name: "extensionNumber" + field(:base_type_name, 1, type: :string, json_name: "baseTypeName") + field(:extension_number, 2, repeated: true, type: :int32, json_name: "extensionNumber") end + defmodule Grpc.Reflection.V1alpha.ListServiceResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -448,8 +460,9 @@ defmodule Grpc.Reflection.V1alpha.ListServiceResponse do } end - field :service, 1, repeated: true, type: Grpc.Reflection.V1alpha.ServiceResponse + field(:service, 1, repeated: true, type: Grpc.Reflection.V1alpha.ServiceResponse) end + defmodule Grpc.Reflection.V1alpha.ServiceResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -486,8 +499,9 @@ defmodule Grpc.Reflection.V1alpha.ServiceResponse do } end - field :name, 1, type: :string + field(:name, 1, type: :string) end + defmodule Grpc.Reflection.V1alpha.ErrorResponse do @moduledoc false use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 @@ -538,9 +552,10 @@ defmodule Grpc.Reflection.V1alpha.ErrorResponse do } end - field :error_code, 1, type: :int32, json_name: "errorCode" - field :error_message, 2, type: :string, json_name: "errorMessage" + field(:error_code, 1, type: :int32, json_name: "errorCode") + field(:error_message, 2, type: :string, json_name: "errorMessage") end + defmodule Grpc.Reflection.V1alpha.ServerReflection.Service do @moduledoc false use GRPC.Service, @@ -567,9 +582,11 @@ defmodule Grpc.Reflection.V1alpha.ServerReflection.Service do } end - rpc :ServerReflectionInfo, - stream(Grpc.Reflection.V1alpha.ServerReflectionRequest), - stream(Grpc.Reflection.V1alpha.ServerReflectionResponse) + rpc( + :ServerReflectionInfo, + stream(Grpc.Reflection.V1alpha.ServerReflectionRequest), + stream(Grpc.Reflection.V1alpha.ServerReflectionResponse) + ) end defmodule Grpc.Reflection.V1alpha.ServerReflection.Stub do diff --git a/mix.exs b/mix.exs index ef011293..ad69168b 100644 --- a/mix.exs +++ b/mix.exs @@ -75,7 +75,7 @@ defmodule Spawn.MixProject do {:shards, "~> 1.1"}, {:telemetry, "~> 1.0"}, {:castore, "~> 1.0"}, - {:protobuf, "~> 0.11"}, + {:protobuf, "~> 0.12"}, {:protobuf_generate, "~> 0.1"}, {:grpc, "~> 0.8"}, {:grpc_reflection, "~> 0.1"}, diff --git a/priv/protos/modules/README.md b/priv/protos/modules/README.md new file mode 100644 index 00000000..129560c4 --- /dev/null +++ b/priv/protos/modules/README.md @@ -0,0 +1 @@ +# Temporary Module Files \ No newline at end of file diff --git a/priv/protos/modules/pinger.pb.ex b/priv/protos/modules/pinger.pb.ex deleted file mode 100644 index 5742391e..00000000 --- a/priv/protos/modules/pinger.pb.ex +++ /dev/null @@ -1,1015 +0,0 @@ -defmodule Pinger.PingPongState do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - name: "PingPongState", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "actual_name", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "actualName", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "previous_name", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "previousName", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "updated_at", - extendee: nil, - number: 3, - label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp", - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "updatedAt", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - end - - field :actual_name, 1, type: :string, json_name: "actualName" - field :previous_name, 2, type: :string, json_name: "previousName" - field :updated_at, 3, type: Google.Protobuf.Timestamp, json_name: "updatedAt" -end - -defmodule Pinger.PingRequest do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - name: "PingRequest", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "name", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: %Google.Protobuf.FieldOptions{ - ctype: :STRING, - packed: nil, - deprecated: false, - lazy: false, - jstype: :JS_NORMAL, - weak: false, - unverified_lazy: false, - debug_redact: false, - retention: nil, - targets: [], - edition_defaults: [], - features: nil, - uninterpreted_option: [], - __pb_extensions__: %{{Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true}, - __unknown_fields__: [] - }, - oneof_index: nil, - json_name: "name", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - end - - field :name, 1, type: :string, deprecated: false -end - -defmodule Pinger.PongReply do - @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.DescriptorProto{ - name: "PongReply", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "message", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "message", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "today", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp", - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "today", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - end - - field :message, 1, type: :string - field :today, 2, type: Google.Protobuf.Timestamp -end - -defmodule Pinger.PingPongActor.Service do - @moduledoc false - use GRPC.Service, name: "pinger.PingPongActor", protoc_gen_elixir_version: "0.12.0" - - def descriptor do - # credo:disable-for-next-line - %Google.Protobuf.FileDescriptorProto{ - name: "pinger.proto", - package: "pinger", - dependency: [ - "google/api/annotations.proto", - "google/protobuf/empty.proto", - "google/protobuf/timestamp.proto", - "eigr/functions/protocol/actors/extensions.proto" - ], - message_type: [ - %Google.Protobuf.DescriptorProto{ - name: "PingPongState", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "actual_name", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "actualName", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "previous_name", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "previousName", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "updated_at", - extendee: nil, - number: 3, - label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp", - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "updatedAt", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - }, - %Google.Protobuf.DescriptorProto{ - name: "PingRequest", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "name", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: %Google.Protobuf.FieldOptions{ - ctype: :STRING, - packed: nil, - deprecated: false, - lazy: false, - jstype: :JS_NORMAL, - weak: false, - unverified_lazy: false, - debug_redact: false, - retention: nil, - targets: [], - edition_defaults: [], - features: nil, - uninterpreted_option: [], - __pb_extensions__: %{ - {Eigr.Functions.Protocol.Actors.PbExtension, :actor_id} => true - }, - __unknown_fields__: [] - }, - oneof_index: nil, - json_name: "name", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - }, - %Google.Protobuf.DescriptorProto{ - name: "PongReply", - field: [ - %Google.Protobuf.FieldDescriptorProto{ - name: "message", - extendee: nil, - number: 1, - label: :LABEL_OPTIONAL, - type: :TYPE_STRING, - type_name: nil, - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "message", - proto3_optional: nil, - __unknown_fields__: [] - }, - %Google.Protobuf.FieldDescriptorProto{ - name: "today", - extendee: nil, - number: 2, - label: :LABEL_OPTIONAL, - type: :TYPE_MESSAGE, - type_name: ".google.protobuf.Timestamp", - default_value: nil, - options: nil, - oneof_index: nil, - json_name: "today", - proto3_optional: nil, - __unknown_fields__: [] - } - ], - nested_type: [], - enum_type: [], - extension_range: [], - extension: [], - options: nil, - oneof_decl: [], - reserved_range: [], - reserved_name: [], - __unknown_fields__: [] - } - ], - enum_type: [], - service: [ - %Google.Protobuf.ServiceDescriptorProto{ - name: "PingPongActor", - method: [ - %Google.Protobuf.MethodDescriptorProto{ - name: "Ping", - input_type: ".pinger.PingRequest", - output_type: ".pinger.PongReply", - options: %Google.Protobuf.MethodOptions{ - deprecated: false, - idempotency_level: :IDEMPOTENCY_UNKNOWN, - features: nil, - uninterpreted_option: [], - __pb_extensions__: %{ - {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ - selector: "", - body: "*", - additional_bindings: [], - response_body: "", - pattern: {:post, "/v1/ping/{name}"}, - __unknown_fields__: [] - } - }, - __unknown_fields__: [] - }, - client_streaming: false, - server_streaming: false, - __unknown_fields__: [] - }, - %Google.Protobuf.MethodDescriptorProto{ - name: "Pong", - input_type: ".google.protobuf.Empty", - output_type: ".pinger.PingPongState", - options: %Google.Protobuf.MethodOptions{ - deprecated: false, - idempotency_level: :IDEMPOTENCY_UNKNOWN, - features: nil, - uninterpreted_option: [], - __pb_extensions__: %{ - {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ - selector: "", - body: "", - additional_bindings: [], - response_body: "", - pattern: {:get, "/v1/pong/{name}"}, - __unknown_fields__: [] - } - }, - __unknown_fields__: [] - }, - client_streaming: false, - server_streaming: false, - __unknown_fields__: [] - } - ], - options: nil, - __unknown_fields__: [] - } - ], - extension: [], - options: %Google.Protobuf.FileOptions{ - java_package: nil, - java_outer_classname: nil, - optimize_for: :SPEED, - java_multiple_files: false, - go_package: nil, - cc_generic_services: false, - java_generic_services: false, - py_generic_services: false, - java_generate_equals_and_hash: nil, - deprecated: false, - java_string_check_utf8: false, - cc_enable_arenas: true, - objc_class_prefix: "HLW", - csharp_namespace: nil, - swift_prefix: nil, - php_class_prefix: nil, - php_namespace: nil, - php_metadata_namespace: nil, - ruby_package: nil, - features: nil, - uninterpreted_option: [], - __pb_extensions__: %{}, - __unknown_fields__: [] - }, - source_code_info: %Google.Protobuf.SourceCodeInfo{ - location: [ - %Google.Protobuf.SourceCodeInfo.Location{ - path: [], - span: [0, 0, 40, 1], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\f", - span: [0, 0, 18], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b", - span: [2, 0, 33], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: ~c"\b$", - span: [2, 0, 33], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 0], - span: [4, 0, 38], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 1], - span: [5, 0, 37], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 2], - span: [6, 0, 41], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [3, 3], - span: [7, 0, 57], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [2], - span: [9, 0, 15], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0], - span: [12, 0, 16, 1], - leading_comments: " The ping-pong state of PingPongActor\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 1], - span: [12, 8, 21], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0], - span: [13, 2, 25], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 5], - span: [13, 2, 8], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 1], - span: [13, 9, 20], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 0, 3], - span: [13, 23, 24], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 1], - span: [14, 2, 27], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 1, 5], - span: [14, 2, 8], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 1, 1], - span: [14, 9, 22], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 1, 3], - span: [14, 25, 26], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 2], - span: [15, 2, 43], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 2, 6], - span: [15, 2, 27], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 2, 1], - span: [15, 28, 38], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 0, 2, 2, 3], - span: [15, 41, 42], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1], - span: [19, 0, 21, 1], - leading_comments: " The request message containing the actor name.\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 1], - span: [19, 8, 19], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0], - span: [20, 2, 70], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 5], - span: [20, 2, 8], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 1], - span: [20, 9, 13], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 3], - span: [20, 16, 17], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 8], - span: [20, 18, 69], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 1, 2, 0, 8, 9999], - span: [20, 19, 68], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2], - span: [24, 0, 27, 1], - leading_comments: " The response message containing the pong\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 1], - span: [24, 8, 17], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0], - span: [25, 2, 21], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 5], - span: [25, 2, 8], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 1], - span: [25, 9, 16], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 0, 3], - span: [25, 19, 20], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1], - span: [26, 2, 38], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 6], - span: [26, 2, 27], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 1], - span: [26, 28, 33], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [4, 2, 2, 1, 3], - span: [26, 36, 37], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0], - span: [30, 0, 40, 1], - leading_comments: " The PingPong actor service definition.\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 1], - span: [30, 8, 21], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0], - span: [32, 2, 34, 3], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 1], - span: [32, 6, 10], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 2], - span: [32, 11, 22], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 3], - span: ~c" )", - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 4], - span: [33, 4, 68], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 0, 4, 72_295_728], - span: [33, 4, 68], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1], - span: [37, 2, 39, 3], - leading_comments: " Get Pong Message\n", - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 1], - span: [37, 6, 10], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 2], - span: ~c"%\v ", - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 3], - span: ~c"%*7", - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 4], - span: [38, 4, 56], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - }, - %Google.Protobuf.SourceCodeInfo.Location{ - path: [6, 0, 2, 1, 4, 72_295_728], - span: [38, 4, 56], - leading_comments: nil, - trailing_comments: nil, - leading_detached_comments: [], - __unknown_fields__: [] - } - ], - __unknown_fields__: [] - }, - public_dependency: [], - weak_dependency: [], - syntax: "proto3", - edition: nil, - __unknown_fields__: [] - } - end - - rpc(:Ping, Pinger.PingRequest, Pinger.PongReply, %{ - http: %{ - type: Google.Api.PbExtension, - value: %Google.Api.HttpRule{ - selector: "", - body: "*", - additional_bindings: [], - response_body: "", - pattern: {:post, "/v1/ping/{name}"}, - __unknown_fields__: [] - } - } - }) - - rpc(:Pong, Google.Protobuf.Empty, Pinger.PingPongState, %{ - http: %{ - type: Google.Api.PbExtension, - value: %Google.Api.HttpRule{ - selector: "", - body: "", - additional_bindings: [], - response_body: "", - pattern: {:get, "/v1/pong/{name}"}, - __unknown_fields__: [] - } - } - }) -end - -defmodule Pinger.PingPongActor.ActorDispatcher do - @moduledoc since: "1.2.1" - use GRPC.Server, service: Pinger.PingPongActor.Service, http_transcode: true - - alias Sidecar.GRPC.Dispatcher - - @spec ping(Pinger.PingRequest.t(), GRPC.Server.Stream.t()) :: Pinger.PongReply.t() - def ping(message, stream) do - request = %{ - system: "spawn-system", - actor_name: "PingPongActor", - action_name: "Ping", - input: message, - stream: stream, - descriptor: Pinger.PingPongActor.Service.descriptor() - } - - Dispatcher.dispatch(request) - end - - @spec pong(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: Pinger.PingPongState.t() - def pong(message, stream) do - request = %{ - system: "spawn-system", - actor_name: "PingPongActor", - action_name: "Pong", - input: message, - stream: stream, - descriptor: Pinger.PingPongActor.Service.descriptor() - } - - Dispatcher.dispatch(request) - end -end - -defmodule Sidecar.GRPC.ProxyEndpoint do - @moduledoc false - use GRPC.Endpoint - - intercept(GRPC.Server.Interceptors.Logger) - - services = [ - Pinger.PingPongActor.ActorDispatcher - ] - - services = - [ - Sidecar.GRPC.Reflection.Server.V1, - Sidecar.GRPC.Reflection.Server.V1Alpha, - Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher - ] ++ services - - run(services) -end - -defmodule Sidecar.GRPC.ServiceResolver do - @moduledoc since: "1.2.1" - - @actors [ - { - "PingPongActor", - %{ - service_name: "Pinger.PingPongActor", - service_module: Pinger.PingPongActor.Service - } - } - ] - - def has_actor?(actor_name) do - Enum.any?(@actors, fn {name, _} -> actor_name == name end) - end - - def get_descriptor(actor_name) do - actor_attributes = - Enum.filter(@actors, fn {name, _} -> actor_name == name end) - |> Enum.map(fn {_name, attributes} -> attributes end) - |> List.first() - - mod = Map.get(actor_attributes, :service_module) - - mod.descriptor() - |> Map.get(:service) - |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> - actor_name == name - end) - |> List.first() - end -end - -defmodule Sidecar.GRPC.Reflection.Server do - @moduledoc since: "1.2.1" - - defmodule V1 do - use GrpcReflection.Server, - version: :v1, - services: [ - Pinger.PingPongActor.Service - ] - end - - defmodule V1Alpha do - use GrpcReflection.Server, - version: :v1alpha, - services: [ - Pinger.PingPongActor.Service - ] - end -end \ No newline at end of file diff --git a/priv/protos/pinger.proto b/priv/protos/pinger.proto deleted file mode 100644 index 3c90ff5e..00000000 --- a/priv/protos/pinger.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -option objc_class_prefix = "HLW"; - -import "google/api/annotations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; -import "eigr/functions/protocol/actors/extensions.proto"; - -package pinger; - -// The ping-pong state of PingPongActor -message PingPongState { - string actual_name = 1; - string previous_name = 2; - google.protobuf.Timestamp updated_at = 3; -} - -// The request message containing the actor name. -message PingRequest { - string name = 1 [(.eigr.functions.protocol.actors.actor_id) = true]; -} - -// The response message containing the pong -message PongReply { - string message = 1; - google.protobuf.Timestamp today = 2; -} - -// The PingPong actor service definition. -service PingPongActor { - - rpc Ping(PingRequest) returns(PongReply) { - option(google.api.http) = {post : "/v1/ping/{name}" body : "*"}; - } - - // Get Pong Message - rpc Pong(google.protobuf.Empty) returns(PingPongState) { - option(google.api.http) = {get : "/v1/pong/{name}"}; - } -} diff --git a/spawn_sdk/spawn_sdk_example/compile-example-pb.sh b/spawn_sdk/spawn_sdk_example/compile-example-pb.sh index 764abab5..9f49b9b7 100755 --- a/spawn_sdk/spawn_sdk_example/compile-example-pb.sh +++ b/spawn_sdk/spawn_sdk_example/compile-example-pb.sh @@ -4,5 +4,24 @@ set -o nounset set -o errexit set -o pipefail -protoc --elixir_out=gen_descriptors=true:./lib/spawn_sdk_example --proto_path=priv/protos priv/protos/example.proto +PROTOS=(" + priv/protos/example.proto +") +BASE_PATH=`pwd` + +echo "Base protobuf path is: $BASE_PATH/priv/protos" + +for file in $PROTOS; do + echo "Compiling file $BASE_PATH/$file..." + + mix protobuf.generate \ + --output-path=./lib/spawn_sdk_example \ + --include-docs=true \ + --generate-descriptors=true \ + --include-path=$BASE_PATH/priv/protos/ \ + --include-path=./priv/protos/google/api \ + --plugins=ProtobufGenerate.Plugins.GRPCWithOptions \ + --one-file-per-module \ + $BASE_PATH/$file +done \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/actors/joe_actor.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/actors/joe_actor.ex index 7b1328a9..7b6f07f7 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/actors/joe_actor.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/actors/joe_actor.ex @@ -1,6 +1,6 @@ defmodule SpawnSdkExample.Actors.JoeActor do use SpawnSdk.Actor, - name: "joe", + name: "Joe", state_type: Io.Eigr.Spawn.Example.MyState, deactivate_timeout: 60_000, snapshot_timeout: 2_000 @@ -27,7 +27,7 @@ defmodule SpawnSdkExample.Actors.JoeActor do |> Value.reply!() end) - action("sum", fn %Context{state: state} = ctx, %MyBusinessMessage{value: value} = data -> + action("Sum", fn %Context{state: state} = ctx, %MyBusinessMessage{value: value} = data -> Logger.info("[joe] Received Request: #{inspect(data)}. Context: #{inspect(ctx)}") new_value = @@ -41,12 +41,12 @@ defmodule SpawnSdkExample.Actors.JoeActor do %Value{} |> Value.of(response, %MyState{value: new_value}) - |> Value.broadcast(Broadcast.to("external.channel", response)) + # |> Value.broadcast(Broadcast.to("external.channel", response)) # |> Value.broadcast(Broadcast.to("liveview.channel", response)) |> Value.reply!() end) - action("ping", fn %Context{state: state} = ctx -> + action("Ping", fn %Context{state: state} = ctx -> Logger.info("Received Request PING. Context: #{inspect(ctx)}") new_state = diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex index a408a7d9..7772a0b4 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex @@ -1,36 +1,36 @@ defmodule Io.Eigr.Spawn.Example.MyState do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "MyState", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] } ], - name: "MyState", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end @@ -39,39 +39,523 @@ end defmodule Io.Eigr.Spawn.Example.MyBusinessMessage do @moduledoc false - use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 def descriptor do # credo:disable-for-next-line %Google.Protobuf.DescriptorProto{ - __unknown_fields__: [], - enum_type: [], - extension: [], - extension_range: [], + name: "MyBusinessMessage", field: [ %Google.Protobuf.FieldDescriptorProto{ - __unknown_fields__: [], - default_value: nil, - extendee: nil, - json_name: "value", - label: :LABEL_OPTIONAL, name: "value", + extendee: nil, number: 1, - oneof_index: nil, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, options: nil, + oneof_index: nil, + json_name: "value", proto3_optional: nil, - type: :TYPE_INT32, - type_name: nil + __unknown_fields__: [] } ], - name: "MyBusinessMessage", nested_type: [], - oneof_decl: [], + enum_type: [], + extension_range: [], + extension: [], options: nil, + oneof_decl: [], + reserved_range: [], reserved_name: [], - reserved_range: [] + __unknown_fields__: [] } end field(:value, 1, type: :int32) end + +defmodule Io.Eigr.Spawn.Example.Joe.Service do + @moduledoc false + use GRPC.Service, name: "io.eigr.spawn.example.Joe", protoc_gen_elixir_version: "0.12.0" + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.FileDescriptorProto{ + name: "example.proto", + package: "io.eigr.spawn.example", + dependency: ["google/api/annotations.proto"], + message_type: [ + %Google.Protobuf.DescriptorProto{ + name: "MyState", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "value", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "value", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + }, + %Google.Protobuf.DescriptorProto{ + name: "MyBusinessMessage", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "value", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "value", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + ], + enum_type: [], + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "Joe", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "Ping", + input_type: ".io.eigr.spawn.example.MyBusinessMessage", + output_type: ".io.eigr.spawn.example.MyBusinessMessage", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/ping"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + }, + %Google.Protobuf.MethodDescriptorProto{ + name: "Sum", + input_type: ".io.eigr.spawn.example.MyBusinessMessage", + output_type: ".io.eigr.spawn.example.MyBusinessMessage", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/sum"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + } + ], + options: nil, + __unknown_fields__: [] + } + ], + extension: [], + options: %Google.Protobuf.FileOptions{ + java_package: "io.eigr.spawn.example", + java_outer_classname: "ExampleProtos", + optimize_for: :SPEED, + java_multiple_files: true, + go_package: nil, + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + java_generate_equals_and_hash: nil, + deprecated: false, + java_string_check_utf8: false, + cc_enable_arenas: true, + objc_class_prefix: nil, + csharp_namespace: nil, + swift_prefix: nil, + php_class_prefix: nil, + php_namespace: nil, + php_metadata_namespace: nil, + ruby_package: nil, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] + }, + source_code_info: %Google.Protobuf.SourceCodeInfo{ + location: [ + %Google.Protobuf.SourceCodeInfo.Location{ + path: [], + span: [0, 0, 28, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\f", + span: [0, 0, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [2], + span: [2, 0, 30], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [4, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\n", + span: [4, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [5, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [8, 1], + span: [5, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [6, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\b", + span: [6, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 0], + span: [8, 0, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0], + span: [10, 0, 36], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 1], + span: [10, 8, 15], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0], + span: [10, 18, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 5], + span: [10, 18, 23], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 1], + span: [10, 24, 29], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 3], + span: ~c"\n !", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1], + span: [12, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 1], + span: [12, 8, 25], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0], + span: [12, 28, 44], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 5], + span: [12, 28, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 1], + span: ~c"\f\"'", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 3], + span: ~c"\f*+", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0], + span: [14, 0, 28, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 1], + span: [14, 8, 11], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0], + span: [16, 2, 20, 3], + leading_comments: " Sends a greeting\n", + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 1], + span: [16, 6, 10], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 2], + span: [16, 11, 28], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 3], + span: [16, 39, 56], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4], + span: [17, 4, 19, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4, 72_295_728], + span: [17, 4, 19, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1], + span: [22, 2, 27, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 1], + span: [22, 6, 9], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 2], + span: [22, 10, 27], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 3], + span: [22, 38, 55], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4], + span: [23, 4, 26, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4, 72_295_728], + span: [23, 4, 26, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + } + ], + __unknown_fields__: [] + }, + public_dependency: [], + weak_dependency: [], + syntax: "proto3", + edition: nil, + __unknown_fields__: [] + } + end + + rpc(:Ping, Io.Eigr.Spawn.Example.MyBusinessMessage, Io.Eigr.Spawn.Example.MyBusinessMessage, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/ping"}, + __unknown_fields__: [] + } + } + }) + + rpc(:Sum, Io.Eigr.Spawn.Example.MyBusinessMessage, Io.Eigr.Spawn.Example.MyBusinessMessage, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/sum"}, + __unknown_fields__: [] + } + } + }) +end diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto index 27d06af5..c8afa2e4 100644 --- a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto +++ b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto @@ -12,17 +12,16 @@ message MyState { int32 value = 1; } message MyBusinessMessage { int32 value = 1; } -service PingPongService { - // Sends a greeting +service Joe { rpc Ping(MyBusinessMessage) returns (MyBusinessMessage) { option (google.api.http) = { - get : "/v1/ping/{name}" + get : "/v1/ping" }; } rpc Sum(MyBusinessMessage) returns (MyBusinessMessage) { option (google.api.http) = { - post : "/v1/sum/{name}" + post : "/v1/sum" body : "*" }; } From 3537f92614c03050afcbe4610676e8cf9269b345 Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Tue, 11 Jun 2024 12:01:37 -0300 Subject: [PATCH 41/48] fix unary type request throwing a stream error --- lib/sidecar/grpc/dispatcher.ex | 22 +++++++++++++------ .../priv/protos/example.proto | 6 +++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index acd068c3..a9dad476 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -80,9 +80,9 @@ defmodule Sidecar.GRPC.Dispatcher do input: message, stream: %GRPCStream{grpc_type: grpc_type} = stream, descriptor: _descriptor - } = request + } = _request ) do - Logger.info("Dispatching gRPC message to Actor #{system_name}:#{actor_name}.") + Logger.info("Dispatching gRPC message to Actor #{system_name}:#{actor_name}. with grpc_type: #{grpc_type}") handle_dispatch(system_name, actor_name, action_name, message, stream, grpc_type) end @@ -103,7 +103,7 @@ defmodule Sidecar.GRPC.Dispatcher do ), do: handle_bidirectional_stream(system_name, actor_name, action_name, message, stream) - defp handle_dispatch(system_name, actor_name, action_name, message, stream, _), + defp handle_dispatch(system_name, actor_name, action_name, message, stream, :unary), do: handle_unary(system_name, actor_name, action_name, message, stream) defp handle_client_stream(system_name, actor_name, action_name, message, stream) do @@ -131,7 +131,7 @@ defmodule Sidecar.GRPC.Dispatcher do defp dispatch_sync(system_name, actor_name, "Readiness", message, stream) do with {:actor_id, actor_id} <- {:actor_id, build_actor_id(system_name, actor_name, message)}, {:response, {:ok, response}} <- {:response, invoke_readiness(actor_id)} do - Server.send_reply(stream, response) + server_send_reply(stream, response) else {:actor_id, {:not_found, _}} -> log_and_raise_error( @@ -159,7 +159,7 @@ defmodule Sidecar.GRPC.Dispatcher do defp dispatch_sync(system_name, actor_name, "Liveness", message, stream) do with {:actor_id, actor_id} <- {:actor_id, build_actor_id(system_name, actor_name, message)}, {:response, {:ok, response}} <- {:response, invoke_liveness(actor_id)} do - Server.send_reply(stream, response) + server_send_reply(stream, response) else {:actor_id, {:not_found, _}} -> log_and_raise_error( @@ -189,7 +189,7 @@ defmodule Sidecar.GRPC.Dispatcher do {:request, {:ok, request}} <- {:request, build_request(actor_id, system_name, action_name, message, async: false)}, {:response, {:ok, response}} <- {:response, invoke_request(request)} do - Server.send_reply(stream, response) + server_send_reply(stream, response) else {:actor_id, {:not_found, _}} -> log_and_raise_error( @@ -226,7 +226,7 @@ defmodule Sidecar.GRPC.Dispatcher do {:request, {:ok, request}} <- {:request, build_request(actor_id, system_name, action_name, message, async: true)}, {:response, {:ok, :async}} <- {:response, invoke_request(request)} do - Server.send_reply(stream, %{}) + server_send_reply(stream, %{}) else {:actor_id, {:not_found, _}} -> log_and_raise_error( @@ -258,6 +258,14 @@ defmodule Sidecar.GRPC.Dispatcher do end end + defp server_send_reply(stream, response) do + if stream.grpc_type == :unary do + response + else + Server.send_reply(stream, response) + end + end + defp build_actor_id(system_name, actor_name, message) do with {:ok, %HostActor{actor: %Actor{settings: %ActorSettings{} = actor_settings}}} <- ActorRegistry.lookup(%ActorId{system: system_name, name: actor_name}) do diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto index c8afa2e4..ee1f0cc4 100644 --- a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto +++ b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto @@ -7,13 +7,14 @@ option java_package = "io.eigr.spawn.example"; option java_outer_classname = "ExampleProtos"; import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; message MyState { int32 value = 1; } message MyBusinessMessage { int32 value = 1; } service Joe { - rpc Ping(MyBusinessMessage) returns (MyBusinessMessage) { + rpc Ping(google.protobuf.Empty) returns (MyBusinessMessage) { option (google.api.http) = { get : "/v1/ping" }; @@ -25,4 +26,5 @@ service Joe { body : "*" }; } -} \ No newline at end of file +} + From a99107b45937984b8193a77fefd362ff81e7d7ab Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Tue, 11 Jun 2024 13:31:05 -0300 Subject: [PATCH 42/48] warning changes and config.exs getting the right env configs --- config/config.exs | 2 +- lib/sidecar/grpc/dispatcher.ex | 10 ++++------ lib/sidecar/grpc/supervisor.ex | 7 +++---- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/config/config.exs b/config/config.exs index d7ed4eb2..95113e15 100644 --- a/config/config.exs +++ b/config/config.exs @@ -73,4 +73,4 @@ config :mnesiac, schema_type: :disc_copies, table_load_timeout: 600_000 -# import_config "#{config_env()}.exs" +import_config "#{config_env()}.exs" diff --git a/lib/sidecar/grpc/dispatcher.ex b/lib/sidecar/grpc/dispatcher.ex index a9dad476..833a1792 100644 --- a/lib/sidecar/grpc/dispatcher.ex +++ b/lib/sidecar/grpc/dispatcher.ex @@ -82,7 +82,9 @@ defmodule Sidecar.GRPC.Dispatcher do descriptor: _descriptor } = _request ) do - Logger.info("Dispatching gRPC message to Actor #{system_name}:#{actor_name}. with grpc_type: #{grpc_type}") + Logger.info( + "Dispatching gRPC message to Actor #{system_name}:#{actor_name}. with grpc_type: #{grpc_type}" + ) handle_dispatch(system_name, actor_name, action_name, message, stream, grpc_type) end @@ -335,9 +337,6 @@ defmodule Sidecar.GRPC.Dispatcher do }} end - defp build_healthcheck_request(_actor_id, _actor_system, _action_name, _opts), - do: %Google.Protobuf.Empty{} - defp invoke_readiness(nil), do: {:error, :invalid_payload} defp invoke_readiness(request), do: CallerProducer.readiness(request) @@ -356,8 +355,7 @@ defmodule Sidecar.GRPC.Dispatcher do {:ok, %ActorInvocationResponse{payload: %Google.Protobuf.Any{} = response}} -> {:ok, unpack_unknown(response)} - {:ok, - %ActorInvocationResponse{payload: {:noop, %Eigr.Functions.Protocol.Noop{}} = response}} -> + {:ok, %ActorInvocationResponse{payload: {:noop, %Eigr.Functions.Protocol.Noop{}}}} -> {:ok, %Google.Protobuf.Empty{}} :async -> diff --git a/lib/sidecar/grpc/supervisor.ex b/lib/sidecar/grpc/supervisor.ex index d522c4a5..c9180bc6 100644 --- a/lib/sidecar/grpc/supervisor.ex +++ b/lib/sidecar/grpc/supervisor.ex @@ -14,10 +14,9 @@ defmodule Sidecar.GRPC.Supervisor do {:compiling_protos, Generator.compile_protos()}, {:load_modules, {:ok, modules}} <- {:load_modules, Generator.load_modules(opts)}, {:compiling_modules, :ok} <- {:compiling_modules, Generator.compile_modules(modules)} do - children = - [] - |> maybe_start_reflection(Config.get(:grpc_reflection_enabled)) - |> maybe_start_grpc_server(Config.get(:grpc_server_enabled)) + [] + |> maybe_start_reflection(Config.get(:grpc_reflection_enabled)) + |> maybe_start_grpc_server(Config.get(:grpc_server_enabled)) else {:compiling_protos, {:ok, :nothing_to_compile}} -> [] From 96399c762eee519f0610bf370c03e1ac7a2c4000 Mon Sep 17 00:00:00 2001 From: Adriano Santos Date: Tue, 11 Jun 2024 13:59:16 -0300 Subject: [PATCH 43/48] Compile all --- lib/sidecar/grpc/code_generator.ex | 13 +- mix.exs | 3 +- mix.lock | 7 +- priv/protos/modules/example.pb.ex | 680 ++++++++++++++++++ .../spawn_sdk_example/compile-example-pb.sh | 26 +- .../spawn_sdk_example/actors/clock_actor.ex | 6 +- .../lib/spawn_sdk_example/application.ex | 2 +- .../lib/spawn_sdk_example/clock.pb.ex | 338 +++++++++ .../lib/spawn_sdk_example/example.pb.ex | 30 +- spawn_sdk/spawn_sdk_example/mix.lock | 4 +- .../spawn_sdk_example/priv/protos/clock.bkp | 25 + .../priv/protos/example.proto | 2 +- 12 files changed, 1089 insertions(+), 47 deletions(-) create mode 100644 priv/protos/modules/example.pb.ex create mode 100644 spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex create mode 100644 spawn_sdk/spawn_sdk_example/priv/protos/clock.bkp diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index ab8f68c3..9389176a 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -46,12 +46,16 @@ defmodule Sidecar.GRPC.CodeGenerator do {ProtobufGenerate.Plugins.GRPC, Sidecar.GRPC.Generators.HandlerGenerator} end - user_defined_proto_files = + user_defined_proto_files_list = list_files_with_extension(include_path, ".proto") - mod_numbers = length(user_defined_proto_files) + mod_numbers = length(user_defined_proto_files_list) - user_defined_proto_files = user_defined_proto_files |> Enum.join(" ") + user_defined_proto_files = user_defined_proto_files_list |> Enum.join(" ") + + files = + Enum.map(user_defined_proto_files_list, fn file -> "#{include_path}/#{file}" end) + |> Enum.join(" ") if mod_numbers > 0 do protoc_options = [ @@ -65,10 +69,11 @@ defmodule Sidecar.GRPC.CodeGenerator do "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", "--plugins=Sidecar.GRPC.Generators.ServiceResolverGenerator", "--plugins=Sidecar.Grpc.Generators.ReflectionServerGenerator", - "#{include_path}/#{user_defined_proto_files}" + files ] _ = Generate.run(protoc_options) + :ok else {:ok, :nothing_to_compile} diff --git a/mix.exs b/mix.exs index ad69168b..cc030367 100644 --- a/mix.exs +++ b/mix.exs @@ -78,7 +78,8 @@ defmodule Spawn.MixProject do {:protobuf, "~> 0.12"}, {:protobuf_generate, "~> 0.1"}, {:grpc, "~> 0.8"}, - {:grpc_reflection, "~> 0.1"}, + #{:grpc_reflection, "~> 0.1"}, + {:grpc_reflection, github: "elixir-grpc/grpc-reflection"}, {:finch, "~> 0.16"}, {:retry, "~> 0.17"}, {:flow, "~> 1.2"}, diff --git a/mix.lock b/mix.lock index a5718bec..a2bdb183 100644 --- a/mix.lock +++ b/mix.lock @@ -30,15 +30,16 @@ "flow": {:hex, :flow, "1.2.4", "1dd58918287eb286656008777cb32714b5123d3855956f29aa141ebae456922d", [:mix], [{:gen_stage, "~> 1.0", [hex: :gen_stage, repo: "hexpm", optional: false]}], "hexpm", "874adde96368e71870f3510b91e35bc31652291858c86c0e75359cbdd35eb211"}, "gen_stage": {:hex, :gen_stage, "1.2.1", "19d8b5e9a5996d813b8245338a28246307fd8b9c99d1237de199d21efc4c76a1", [:mix], [], "hexpm", "83e8be657fa05b992ffa6ac1e3af6d57aa50aace8f691fcf696ff02f8335b001"}, "gnat": {:hex, :gnat, "1.8.3", "ee12f84b46617d4cef4c0e1ac586ec8bf80b422878866e128e2f37b7cb20a21a", [:mix], [{:connection, "~> 1.1", [hex: :connection, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.0", [hex: :cowlib, repo: "hexpm", optional: false]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 0.5 or ~> 1.0", [hex: :nimble_parsec, repo: "hexpm", optional: false]}, {:nkeys, "~> 0.2", [hex: :nkeys, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "ae88816038ccd3dfc9cfcf5b79a5a4dc52623a25062f1e9c9e7641751bf42ceb"}, + "google_protos": {:hex, :google_protos, "0.4.0", "93e1be2c1a07517ffed761f69047776caf35e4acd385aac4f5ce4fedd07f3660", [:mix], [{:protobuf, "~> 0.10", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "4c54983d78761a3643e2198adf0f5d40a5a8b08162f3fc91c50faa257f3fa19f"}, "gproc": {:hex, :gproc, "0.9.1", "f1df0364423539cf0b80e8201c8b1839e229e5f9b3ccb944c5834626998f5b8c", [:rebar3], [], "hexpm", "905088e32e72127ed9466f0bac0d8e65704ca5e73ee5a62cb073c3117916d507"}, "grpc": {:hex, :grpc, "0.8.1", "a8a5884a0d41fc30679c269d0332571cebb43cbfd6eb3d4819169778e866343e", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1cccd9fd83547a562f315cc0e1ee1879546f0a44193b5c8eb8d68dae0bb2065b"}, - "grpc_reflection": {:hex, :grpc_reflection, "0.1.0", "0c835a933c3dd3ff55527a8d491da249b76b762ae56aa43909c87a4f9f1a13ef", [:mix], [{:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "5031b94b115d8e6f66bd71ef1572aca9f2212aa765920c3285a7de382ec5d03e"}, + "grpc_reflection": {:git, "https://github.com/elixir-grpc/grpc-reflection.git", "fd4861416d05c8b772b73130f366f6f71bf4bfdc", []}, "grpcbox": {:hex, :grpcbox, "0.17.1", "6e040ab3ef16fe699ffb513b0ef8e2e896da7b18931a1ef817143037c454bcce", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.15.1", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.9.1", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "4a3b5d7111daabc569dc9cbd9b202a3237d81c80bf97212fbc676832cb0ceb17"}, "gun": {:hex, :gun, "2.1.0", "b4e4cbbf3026d21981c447e9e7ca856766046eff693720ba43114d7f5de36e87", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "52fc7fc246bfc3b00e01aea1c2854c70a366348574ab50c57dfe796d24a0101d"}, "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, "horde": {:hex, :horde, "0.9.0", "522342bd7149aeed453c97692a8bca9cf7c9368c5a489afd802e575dc8df54a6", [:mix], [{:delta_crdt, "~> 0.6.2", [hex: :delta_crdt, repo: "hexpm", optional: false]}, {:libring, "~> 1.4", [hex: :libring, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_poller, "~> 0.5.0 or ~> 1.0", [hex: :telemetry_poller, repo: "hexpm", optional: false]}], "hexpm", "fae11e5bc9c980038607d0c3338cdf7f97124a5d5382fd4b6fb6beaab8e214fe"}, "hpack": {:hex, :hpack_erl, "0.3.0", "2461899cc4ab6a0ef8e970c1661c5fc6a52d3c25580bc6dd204f84ce94669926", [:rebar3], [], "hexpm", "d6137d7079169d8c485c6962dfe261af5b9ef60fbc557344511c1e65e3d95fb0"}, - "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"}, + "hpax": {:hex, :hpax, "0.2.0", "5a58219adcb75977b2edce5eb22051de9362f08236220c9e859a47111c194ff5", [:mix], [], "hexpm", "bea06558cdae85bed075e6c036993d43cd54d447f76d8190a8db0dc5893fa2f1"}, "iter": {:hex, :iter, "0.1.2", "bd5dbba48ba67e0f134889a4a29f2b377db6cdcee0661f3c29439e7b649e317a", [:mix], [], "hexpm", "e79f53ed36105ae72582fd3ef224ca2539ccc00cdc27e6e7fe69c49119c4e39b"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, "k8s": {:hex, :k8s, "2.6.1", "ef949e268a65fc45e4481e1071b96c8aa7eae028f0f451052c301d72aae649a2", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: false]}, {:mint_web_socket, "~> 1.0", [hex: :mint_web_socket, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.8", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "a95bde29b60ea94b2ba341969f911e94ae38fc635a332549c39e726ba76ebe10"}, @@ -50,7 +51,7 @@ "makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"}, "merkle_map": {:hex, :merkle_map, "0.2.1", "01a88c87a6b9fb594c67c17ebaf047ee55ffa34e74297aa583ed87148006c4c8", [:mix], [], "hexpm", "fed4d143a5c8166eee4fa2b49564f3c4eace9cb252f0a82c1613bba905b2d04d"}, "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, - "mint": {:hex, :mint, "1.6.0", "88a4f91cd690508a04ff1c3e28952f322528934be541844d54e0ceb765f01d5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "3c5ae85d90a5aca0a49c0d8b67360bbe407f3b54f1030a111047ff988e8fefaa"}, + "mint": {:hex, :mint, "1.6.1", "065e8a5bc9bbd46a41099dfea3e0656436c5cbcb6e741c80bd2bad5cd872446f", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "4fc518dcc191d02f433393a72a7ba3f6f94b101d094cb6bf532ea54c89423780"}, "mint_web_socket": {:hex, :mint_web_socket, "1.0.3", "aab42fff792a74649916236d0b01f560a0b3f03ca5dea693c230d1c44736b50e", [:mix], [{:mint, ">= 1.4.1 and < 2.0.0-0", [hex: :mint, repo: "hexpm", optional: false]}], "hexpm", "ca3810ca44cc8532e3dce499cc17f958596695d226bb578b2fbb88c09b5954b0"}, "mnesiac": {:hex, :mnesiac, "0.3.14", "5ea3f1f3e615073629d0822bcf2297be73149beee2d1f7e482c1943894f59b53", [:mix], [{:libcluster, "~> 3.3", [hex: :libcluster, repo: "hexpm", optional: true]}], "hexpm", "e51b38bf983b9320aba56d5dce79dbf50cbff07f7495e70b89eb45461b8d32fa"}, "myxql": {:hex, :myxql, "0.6.4", "1502ea37ee23c31b79725b95d4cc3553693c2bda7421b1febc50722fd988c918", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a3307f4671f3009d3708283649adf205bfe280f7e036fc8ef7f16dbf821ab8e9"}, diff --git a/priv/protos/modules/example.pb.ex b/priv/protos/modules/example.pb.ex new file mode 100644 index 00000000..85385219 --- /dev/null +++ b/priv/protos/modules/example.pb.ex @@ -0,0 +1,680 @@ +defmodule Io.Eigr.Spawn.Example.MyState do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "MyState", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "value", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "value", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :value, 1, type: :int32 +end + +defmodule Io.Eigr.Spawn.Example.MyBusinessMessage do + @moduledoc false + use Protobuf, protoc_gen_elixir_version: "0.12.0", syntax: :proto3 + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.DescriptorProto{ + name: "MyBusinessMessage", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "value", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "value", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + end + + field :value, 1, type: :int32 +end + +defmodule Io.Eigr.Spawn.Example.Joe.Service do + @moduledoc false + use GRPC.Service, name: "io.eigr.spawn.example.Joe", protoc_gen_elixir_version: "0.12.0" + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.FileDescriptorProto{ + name: "example.proto", + package: "io.eigr.spawn.example", + dependency: ["google/api/annotations.proto", "google/protobuf/empty.proto"], + message_type: [ + %Google.Protobuf.DescriptorProto{ + name: "MyState", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "value", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "value", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + }, + %Google.Protobuf.DescriptorProto{ + name: "MyBusinessMessage", + field: [ + %Google.Protobuf.FieldDescriptorProto{ + name: "value", + extendee: nil, + number: 1, + label: :LABEL_OPTIONAL, + type: :TYPE_INT32, + type_name: nil, + default_value: nil, + options: nil, + oneof_index: nil, + json_name: "value", + proto3_optional: nil, + __unknown_fields__: [] + } + ], + nested_type: [], + enum_type: [], + extension_range: [], + extension: [], + options: nil, + oneof_decl: [], + reserved_range: [], + reserved_name: [], + __unknown_fields__: [] + } + ], + enum_type: [], + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "Joe", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "Ping", + input_type: ".google.protobuf.Empty", + output_type: ".io.eigr.spawn.example.MyBusinessMessage", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/ping"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + }, + %Google.Protobuf.MethodDescriptorProto{ + name: "Sum", + input_type: ".io.eigr.spawn.example.MyBusinessMessage", + output_type: ".io.eigr.spawn.example.MyBusinessMessage", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/sum"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + } + ], + options: nil, + __unknown_fields__: [] + } + ], + extension: [], + options: %Google.Protobuf.FileOptions{ + java_package: "io.eigr.spawn.example", + java_outer_classname: "ExampleProtos", + optimize_for: :SPEED, + java_multiple_files: true, + go_package: nil, + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + java_generate_equals_and_hash: nil, + deprecated: false, + java_string_check_utf8: false, + cc_enable_arenas: true, + objc_class_prefix: nil, + csharp_namespace: nil, + swift_prefix: nil, + php_class_prefix: nil, + php_namespace: nil, + php_metadata_namespace: nil, + ruby_package: nil, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] + }, + source_code_info: %Google.Protobuf.SourceCodeInfo{ + location: [ + %Google.Protobuf.SourceCodeInfo.Location{ + path: [], + span: [0, 0, 29, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\f", + span: [0, 0, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [2], + span: [2, 0, 30], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [4, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\n", + span: [4, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [5, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [8, 1], + span: [5, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [6, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\b", + span: [6, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 0], + span: [8, 0, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 1], + span: [9, 0, 37], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0], + span: [11, 0, 36], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 1], + span: [11, 8, 15], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0], + span: [11, 18, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 5], + span: [11, 18, 23], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 1], + span: [11, 24, 29], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 0, 2, 0, 3], + span: ~c"\v !", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1], + span: [13, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 1], + span: [13, 8, 25], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0], + span: [13, 28, 44], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 5], + span: [13, 28, 33], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 1], + span: ~c"\r\"'", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [4, 1, 2, 0, 3], + span: ~c"\r*+", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0], + span: [15, 0, 29, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 1], + span: [15, 8, 11], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0], + span: [16, 2, 21, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 1], + span: [16, 6, 10], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 2], + span: [16, 11, 32], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 3], + span: [16, 43, 60], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4], + span: [17, 4, 20, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4, 72_295_728], + span: [17, 4, 20, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1], + span: [23, 2, 28, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 1], + span: [23, 6, 9], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 2], + span: [23, 10, 27], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 3], + span: [23, 38, 55], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4], + span: [24, 4, 27, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4, 72_295_728], + span: [24, 4, 27, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + } + ], + __unknown_fields__: [] + }, + public_dependency: [], + weak_dependency: [], + syntax: "proto3", + edition: nil, + __unknown_fields__: [] + } + end + + rpc(:Ping, Google.Protobuf.Empty, Io.Eigr.Spawn.Example.MyBusinessMessage, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/ping"}, + __unknown_fields__: [] + } + } + }) + + rpc(:Sum, Io.Eigr.Spawn.Example.MyBusinessMessage, Io.Eigr.Spawn.Example.MyBusinessMessage, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/sum"}, + __unknown_fields__: [] + } + } + }) +end + +defmodule Io.Eigr.Spawn.Example.Joe.ActorDispatcher do + @moduledoc since: "1.2.1" + use GRPC.Server, service: Io.Eigr.Spawn.Example.Joe.Service, http_transcode: true + + alias Sidecar.GRPC.Dispatcher + + @spec ping(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: + Io.Eigr.Spawn.Example.MyBusinessMessage.t() + def ping(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "Joe", + action_name: "Ping", + input: message, + stream: stream, + descriptor: Io.Eigr.Spawn.Example.Joe.Service.descriptor() + } + + Dispatcher.dispatch(request) + end + + @spec sum(Io.Eigr.Spawn.Example.MyBusinessMessage.t(), GRPC.Server.Stream.t()) :: + Io.Eigr.Spawn.Example.MyBusinessMessage.t() + def sum(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "Joe", + action_name: "Sum", + input: message, + stream: stream, + descriptor: Io.Eigr.Spawn.Example.Joe.Service.descriptor() + } + + Dispatcher.dispatch(request) + end +end + +defmodule Sidecar.GRPC.ProxyEndpoint do + @moduledoc false + use GRPC.Endpoint + + intercept(GRPC.Server.Interceptors.Logger) + + services = [ + Io.Eigr.Spawn.Example.Joe.ActorDispatcher + ] + + services = + [ + Sidecar.GRPC.Reflection.Server.V1, + Sidecar.GRPC.Reflection.Server.V1Alpha, + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher + ] ++ services + + run(services) +end + +defmodule Sidecar.GRPC.ServiceResolver do + @moduledoc since: "1.2.1" + + @actors [ + { + "Joe", + %{ + service_name: "Io.Eigr.Spawn.Example.Joe", + service_module: Io.Eigr.Spawn.Example.Joe.Service + } + } + ] + + def has_actor?(actor_name) do + Enum.any?(@actors, fn {name, _} -> actor_name == name end) + end + + def get_descriptor(actor_name) do + actor_attributes = + Enum.filter(@actors, fn {name, _} -> actor_name == name end) + |> Enum.map(fn {_name, attributes} -> attributes end) + |> List.first() + + mod = Map.get(actor_attributes, :service_module) + + mod.descriptor() + |> Map.get(:service) + |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> + actor_name == name + end) + |> List.first() + end +end + +defmodule Sidecar.GRPC.Reflection.Server do + @moduledoc since: "1.2.1" + + defmodule V1 do + use GrpcReflection.Server, + version: :v1, + services: [ + Io.Eigr.Spawn.Example.Joe.Service + ] + end + + defmodule V1Alpha do + use GrpcReflection.Server, + version: :v1alpha, + services: [ + Io.Eigr.Spawn.Example.Joe.Service + ] + end +end \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/compile-example-pb.sh b/spawn_sdk/spawn_sdk_example/compile-example-pb.sh index 9f49b9b7..dfd40a2a 100755 --- a/spawn_sdk/spawn_sdk_example/compile-example-pb.sh +++ b/spawn_sdk/spawn_sdk_example/compile-example-pb.sh @@ -4,24 +4,16 @@ set -o nounset set -o errexit set -o pipefail -PROTOS=(" - priv/protos/example.proto -") - BASE_PATH=`pwd` echo "Base protobuf path is: $BASE_PATH/priv/protos" -for file in $PROTOS; do - echo "Compiling file $BASE_PATH/$file..." - - mix protobuf.generate \ - --output-path=./lib/spawn_sdk_example \ - --include-docs=true \ - --generate-descriptors=true \ - --include-path=$BASE_PATH/priv/protos/ \ - --include-path=./priv/protos/google/api \ - --plugins=ProtobufGenerate.Plugins.GRPCWithOptions \ - --one-file-per-module \ - $BASE_PATH/$file -done \ No newline at end of file +mix protobuf.generate \ + --output-path=./lib/spawn_sdk_example \ + --include-docs=true \ + --generate-descriptors=true \ + --include-path=$BASE_PATH/priv/protos/ \ + --include-path=./priv/protos/google/api \ + --plugins=ProtobufGenerate.Plugins.GRPCWithOptions \ + --one-file-per-module \ + $BASE_PATH/priv/protos/example.proto $BASE_PATH/priv/protos/clock.proto diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/actors/clock_actor.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/actors/clock_actor.ex index 2212e99b..e68abb48 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/actors/clock_actor.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/actors/clock_actor.ex @@ -1,6 +1,6 @@ defmodule SpawnSdkExample.Actors.ClockActor do use SpawnSdk.Actor, - name: "clock_actor", + name: "ClockActor", state_type: Io.Eigr.Spawn.Example.MyState, deactivate_timeout: 15_000 @@ -8,7 +8,7 @@ defmodule SpawnSdkExample.Actors.ClockActor do alias Io.Eigr.Spawn.Example.MyState - action("clock", [timer: 10_000], fn %Context{state: state} = ctx -> + action("Clock", [timer: 10_000], fn %Context{state: state} = ctx -> Logger.info("[clock] Clock Actor Received Request. Context: #{inspect(ctx)}") new_value = if is_nil(state), do: 0, else: state.value + 1 @@ -19,7 +19,7 @@ defmodule SpawnSdkExample.Actors.ClockActor do |> Value.noreply!() end) - action("second_clock", [timer: 10_000], &second_clock/1) + action("SecondClock", [timer: 10_000], &second_clock/1) defp second_clock(%Context{state: state} = ctx) do Logger.info("[SECOND_CLOCK] Second Actor Received Request. Context: #{inspect(ctx)}") diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/application.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/application.ex index d2d88dae..e38067dc 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/application.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/application.ex @@ -11,7 +11,7 @@ defmodule SpawnSdkExample.Application do actors: [ SpawnSdkExample.Actors.JoeActor, SpawnSdkExample.Actors.JsonActor, - # SpawnSdkExample.Actors.ClockActor, + SpawnSdkExample.Actors.ClockActor, SpawnSdkExample.Actors.UnnamedActor, SpawnSdkExample.Actors.PubSubActor ] diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex new file mode 100644 index 00000000..47663961 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex @@ -0,0 +1,338 @@ +defmodule Io.Eigr.Spawn.Example.ClockActor.Service do + @moduledoc false + use GRPC.Service, name: "io.eigr.spawn.example.ClockActor", protoc_gen_elixir_version: "0.12.0" + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.FileDescriptorProto{ + name: "clock.proto", + package: "io.eigr.spawn.example", + dependency: ["google/api/annotations.proto", "google/protobuf/empty.proto"], + message_type: [], + enum_type: [], + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "ClockActor", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "Clock", + input_type: ".google.protobuf.Empty", + output_type: ".google.protobuf.Empty", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/clock"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + }, + %Google.Protobuf.MethodDescriptorProto{ + name: "SecondClock", + input_type: ".google.protobuf.Empty", + output_type: ".google.protobuf.Empty", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/second_clock"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + } + ], + options: nil, + __unknown_fields__: [] + } + ], + extension: [], + options: %Google.Protobuf.FileOptions{ + java_package: "io.eigr.spawn.example", + java_outer_classname: "ExampleProtos", + optimize_for: :SPEED, + java_multiple_files: true, + go_package: nil, + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + java_generate_equals_and_hash: nil, + deprecated: false, + java_string_check_utf8: false, + cc_enable_arenas: true, + objc_class_prefix: nil, + csharp_namespace: nil, + swift_prefix: nil, + php_class_prefix: nil, + php_namespace: nil, + php_metadata_namespace: nil, + ruby_package: nil, + # features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] + }, + source_code_info: %Google.Protobuf.SourceCodeInfo{ + location: [ + %Google.Protobuf.SourceCodeInfo.Location{ + path: [], + span: [0, 0, 24, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\f", + span: [0, 0, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [2], + span: [2, 0, 30], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [4, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\n", + span: [4, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [5, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [8, 1], + span: [5, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [6, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\b", + span: [6, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 0], + span: [8, 0, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 1], + span: [9, 0, 37], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0], + span: [11, 0, 24, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 1], + span: [11, 8, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0], + span: [12, 2, 16, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 1], + span: [12, 6, 11], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 2], + span: ~c"\f\f!", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 3], + span: ~c"\f,A", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4], + span: [13, 4, 15, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4, 72_295_728], + span: [13, 4, 15, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1], + span: [18, 2, 23, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 1], + span: [18, 6, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 2], + span: [18, 18, 39], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 3], + span: [18, 50, 71], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4], + span: [19, 4, 22, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4, 72_295_728], + span: [19, 4, 22, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + } + ], + __unknown_fields__: [] + }, + public_dependency: [], + weak_dependency: [], + syntax: "proto3", + edition: nil, + __unknown_fields__: [] + } + end + + rpc(:Clock, Google.Protobuf.Empty, Google.Protobuf.Empty, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/clock"}, + __unknown_fields__: [] + } + } + }) + + rpc(:SecondClock, Google.Protobuf.Empty, Google.Protobuf.Empty, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/second_clock"}, + __unknown_fields__: [] + } + } + }) +end diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex index 7772a0b4..a4f5cbac 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex @@ -234,7 +234,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 28, 1], + span: [0, 0, 27, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -410,7 +410,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0], - span: [14, 0, 28, 1], + span: [14, 0, 27, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -426,15 +426,15 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0], - span: [16, 2, 20, 3], - leading_comments: " Sends a greeting\n", + span: [15, 2, 19, 3], + leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], __unknown_fields__: [] }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 1], - span: [16, 6, 10], + span: [15, 6, 10], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -442,7 +442,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 2], - span: [16, 11, 28], + span: [15, 11, 28], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -450,7 +450,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 3], - span: [16, 39, 56], + span: [15, 39, 56], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -458,7 +458,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4], - span: [17, 4, 19, 6], + span: [16, 4, 18, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -466,7 +466,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4, 72_295_728], - span: [17, 4, 19, 6], + span: [16, 4, 18, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -474,7 +474,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1], - span: [22, 2, 27, 3], + span: [21, 2, 26, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -482,7 +482,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 1], - span: [22, 6, 9], + span: [21, 6, 9], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -490,7 +490,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 2], - span: [22, 10, 27], + span: [21, 10, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -498,7 +498,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 3], - span: [22, 38, 55], + span: [21, 38, 55], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -506,7 +506,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4], - span: [23, 4, 26, 6], + span: [22, 4, 25, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -514,7 +514,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4, 72_295_728], - span: [23, 4, 26, 6], + span: [22, 4, 25, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], diff --git a/spawn_sdk/spawn_sdk_example/mix.lock b/spawn_sdk/spawn_sdk_example/mix.lock index c7c4878a..d0911b22 100644 --- a/spawn_sdk/spawn_sdk_example/mix.lock +++ b/spawn_sdk/spawn_sdk_example/mix.lock @@ -32,7 +32,7 @@ "google_protos": {:hex, :google_protos, "0.4.0", "93e1be2c1a07517ffed761f69047776caf35e4acd385aac4f5ce4fedd07f3660", [:mix], [{:protobuf, "~> 0.10", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "4c54983d78761a3643e2198adf0f5d40a5a8b08162f3fc91c50faa257f3fa19f"}, "gproc": {:hex, :gproc, "0.8.0", "cea02c578589c61e5341fce149ea36ccef236cc2ecac8691fba408e7ea77ec2f", [:rebar3], [], "hexpm", "580adafa56463b75263ef5a5df4c86af321f68694e7786cb057fd805d1e2a7de"}, "grpc": {:hex, :grpc, "0.8.1", "a8a5884a0d41fc30679c269d0332571cebb43cbfd6eb3d4819169778e866343e", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1cccd9fd83547a562f315cc0e1ee1879546f0a44193b5c8eb8d68dae0bb2065b"}, - "grpc_reflection": {:hex, :grpc_reflection, "0.1.3", "17bead7b3c653d65622e2984c057b781b1fc470114c010d1b68f16f8143b9183", [:mix], [{:google_protos, "~> 0.4.0", [hex: :google_protos, repo: "hexpm", optional: false]}, {:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "3c80644a6a8631de3d2c862013988f4986b0f3a987ce57d06f6176a50bb90fe2"}, + "grpc_reflection": {:git, "https://github.com/elixir-grpc/grpc-reflection.git", "fd4861416d05c8b772b73130f366f6f71bf4bfdc", []}, "grpcbox": {:hex, :grpcbox, "0.16.0", "b83f37c62d6eeca347b77f9b1ec7e9f62231690cdfeb3a31be07cd4002ba9c82", [:rebar3], [{:acceptor_pool, "~>1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~>0.13.0", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~>0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~>0.8.0", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "294df743ae20a7e030889f00644001370a4f7ce0121f3bbdaf13cf3169c62913"}, "gun": {:hex, :gun, "2.1.0", "b4e4cbbf3026d21981c447e9e7ca856766046eff693720ba43114d7f5de36e87", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "52fc7fc246bfc3b00e01aea1c2854c70a366348574ab50c57dfe796d24a0101d"}, "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, @@ -49,7 +49,7 @@ "meck": {:hex, :meck, "0.9.2", "85ccbab053f1db86c7ca240e9fc718170ee5bda03810a6292b5306bf31bae5f5", [:rebar3], [], "hexpm", "81344f561357dc40a8344afa53767c32669153355b626ea9fcbc8da6b3045826"}, "merkle_map": {:hex, :merkle_map, "0.2.1", "01a88c87a6b9fb594c67c17ebaf047ee55ffa34e74297aa583ed87148006c4c8", [:mix], [], "hexpm", "fed4d143a5c8166eee4fa2b49564f3c4eace9cb252f0a82c1613bba905b2d04d"}, "mime": {:hex, :mime, "2.0.5", "dc34c8efd439abe6ae0343edbb8556f4d63f178594894720607772a041b04b02", [:mix], [], "hexpm", "da0d64a365c45bc9935cc5c8a7fc5e49a0e0f9932a761c55d6c52b142780a05c"}, - "mint": {:hex, :mint, "1.6.0", "88a4f91cd690508a04ff1c3e28952f322528934be541844d54e0ceb765f01d5e", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "3c5ae85d90a5aca0a49c0d8b67360bbe407f3b54f1030a111047ff988e8fefaa"}, + "mint": {:hex, :mint, "1.6.1", "065e8a5bc9bbd46a41099dfea3e0656436c5cbcb6e741c80bd2bad5cd872446f", [:mix], [{:castore, "~> 0.1.0 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:hpax, "~> 0.1.1 or ~> 0.2.0", [hex: :hpax, repo: "hexpm", optional: false]}], "hexpm", "4fc518dcc191d02f433393a72a7ba3f6f94b101d094cb6bf532ea54c89423780"}, "mint_web_socket": {:hex, :mint_web_socket, "1.0.3", "aab42fff792a74649916236d0b01f560a0b3f03ca5dea693c230d1c44736b50e", [:mix], [{:mint, "~> 1.4 and >= 1.4.1", [hex: :mint, repo: "hexpm", optional: false]}], "hexpm", "ca3810ca44cc8532e3dce499cc17f958596695d226bb578b2fbb88c09b5954b0"}, "mnesiac": {:hex, :mnesiac, "0.3.14", "5ea3f1f3e615073629d0822bcf2297be73149beee2d1f7e482c1943894f59b53", [:mix], [{:libcluster, "~> 3.3", [hex: :libcluster, repo: "hexpm", optional: true]}], "hexpm", "e51b38bf983b9320aba56d5dce79dbf50cbff07f7495e70b89eb45461b8d32fa"}, "myxql": {:hex, :myxql, "0.6.4", "1502ea37ee23c31b79725b95d4cc3553693c2bda7421b1febc50722fd988c918", [:mix], [{:db_connection, "~> 2.4.1 or ~> 2.5", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.6 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:geo, "~> 3.4", [hex: :geo, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a3307f4671f3009d3708283649adf205bfe280f7e036fc8ef7f16dbf821ab8e9"}, diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/clock.bkp b/spawn_sdk/spawn_sdk_example/priv/protos/clock.bkp new file mode 100644 index 00000000..ebc414b4 --- /dev/null +++ b/spawn_sdk/spawn_sdk_example/priv/protos/clock.bkp @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package io.eigr.spawn.example; + +option java_multiple_files = true; +option java_package = "io.eigr.spawn.example"; +option java_outer_classname = "ExampleProtos"; + +import "google/api/annotations.proto"; +import "google/protobuf/empty.proto"; + +service ClockActor { + rpc Clock(google.protobuf.Empty) returns (google.protobuf.Empty) { + option (google.api.http) = { + get : "/v1/clock" + }; + } + + rpc SecondClock(google.protobuf.Empty) returns (google.protobuf.Empty) { + option (google.api.http) = { + post : "/v1/second_clock" + body : "*" + }; + } +} \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto index ee1f0cc4..2d572b2f 100644 --- a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto +++ b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto @@ -17,6 +17,7 @@ service Joe { rpc Ping(google.protobuf.Empty) returns (MyBusinessMessage) { option (google.api.http) = { get : "/v1/ping" + body : "*" }; } @@ -27,4 +28,3 @@ service Joe { }; } } - From 17bf1a176f831736ba11cbeeb34a6c4c21a0561c Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Tue, 11 Jun 2024 14:22:41 -0300 Subject: [PATCH 44/48] fix multiple proto files erroring --- lib/sidecar/grpc/code_generator.ex | 39 +- .../grpc/generators/service_generator.ex | 10 +- priv/protos/modules/clock.pb.ex | 449 ++++++++++++++++++ priv/protos/modules/example.pb.ex | 26 +- .../lib/spawn_sdk_example/clock.pb.ex | 8 +- .../lib/spawn_sdk_example/example.pb.ex | 74 +-- .../priv/protos/{clock.bkp => clock.proto} | 2 +- .../priv/protos/example.proto | 1 - 8 files changed, 534 insertions(+), 75 deletions(-) create mode 100644 priv/protos/modules/clock.pb.ex rename spawn_sdk/spawn_sdk_example/priv/protos/{clock.bkp => clock.proto} (99%) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 9389176a..3f2ae5dd 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -49,28 +49,25 @@ defmodule Sidecar.GRPC.CodeGenerator do user_defined_proto_files_list = list_files_with_extension(include_path, ".proto") - mod_numbers = length(user_defined_proto_files_list) - - user_defined_proto_files = user_defined_proto_files_list |> Enum.join(" ") - files = - Enum.map(user_defined_proto_files_list, fn file -> "#{include_path}/#{file}" end) - |> Enum.join(" ") - - if mod_numbers > 0 do - protoc_options = [ - "--include-path=#{include_path}", - "--include-path=#{File.cwd!()}/priv/protos/google/protobuf", - "--include-path=#{File.cwd!()}/priv/protos/google/api", - "--generate-descriptors=true", - "--output-path=#{output_path}", - "--plugins=#{grpc_generator_plugin}", - "--plugins=#{handler_generator_plugin}", - "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", - "--plugins=Sidecar.GRPC.Generators.ServiceResolverGenerator", - "--plugins=Sidecar.Grpc.Generators.ReflectionServerGenerator", - files - ] + user_defined_proto_files_list + |> Enum.map(fn file -> "#{include_path}/#{file}" end) + + if length(user_defined_proto_files_list) > 0 do + protoc_options = + [ + "--include-path=#{include_path}", + "--include-path=#{File.cwd!()}/priv/protos/google/protobuf", + "--include-path=#{File.cwd!()}/priv/protos/google/api", + "--generate-descriptors=true", + "--output-path=#{output_path}", + "--plugins=#{grpc_generator_plugin}", + "--plugins=#{handler_generator_plugin}", + "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", + "--plugins=Sidecar.GRPC.Generators.ServiceResolverGenerator", + "--plugins=Sidecar.Grpc.Generators.ReflectionServerGenerator" + ] ++ + files _ = Generate.run(protoc_options) diff --git a/lib/sidecar/grpc/generators/service_generator.ex b/lib/sidecar/grpc/generators/service_generator.ex index f6a45959..906f5b13 100644 --- a/lib/sidecar/grpc/generators/service_generator.ex +++ b/lib/sidecar/grpc/generators/service_generator.ex @@ -40,8 +40,14 @@ defmodule Sidecar.GRPC.Generators.ServiceGenerator do @impl true def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do - services = Enum.map(svcs, fn svc -> Util.mod_name(ctx, [Macro.camelize(svc.name)]) end) - Logger.debug("Generate follow services #{inspect(services)}") + current_services = :persistent_term.get(:grpc_services, []) + + services = + svcs + |> Enum.map(fn svc -> Util.mod_name(ctx, [Macro.camelize(svc.name)]) end) + |> Kernel.++(current_services) + + :persistent_term.put(:grpc_services, services) {List.first(services), [ diff --git a/priv/protos/modules/clock.pb.ex b/priv/protos/modules/clock.pb.ex new file mode 100644 index 00000000..fe5fba93 --- /dev/null +++ b/priv/protos/modules/clock.pb.ex @@ -0,0 +1,449 @@ +defmodule Io.Eigr.Spawn.Example.ClockActor.Service do + @moduledoc false + use GRPC.Service, name: "io.eigr.spawn.example.ClockActor", protoc_gen_elixir_version: "0.12.0" + + def descriptor do + # credo:disable-for-next-line + %Google.Protobuf.FileDescriptorProto{ + name: "clock.proto", + package: "io.eigr.spawn.example", + dependency: ["google/api/annotations.proto", "google/protobuf/empty.proto"], + message_type: [], + enum_type: [], + service: [ + %Google.Protobuf.ServiceDescriptorProto{ + name: "ClockActor", + method: [ + %Google.Protobuf.MethodDescriptorProto{ + name: "Clock", + input_type: ".google.protobuf.Empty", + output_type: ".google.protobuf.Empty", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/clock"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + }, + %Google.Protobuf.MethodDescriptorProto{ + name: "SecondClock", + input_type: ".google.protobuf.Empty", + output_type: ".google.protobuf.Empty", + options: %Google.Protobuf.MethodOptions{ + deprecated: false, + idempotency_level: :IDEMPOTENCY_UNKNOWN, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{ + {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/second_clock"}, + __unknown_fields__: [] + } + }, + __unknown_fields__: [] + }, + client_streaming: false, + server_streaming: false, + __unknown_fields__: [] + } + ], + options: nil, + __unknown_fields__: [] + } + ], + extension: [], + options: %Google.Protobuf.FileOptions{ + java_package: "io.eigr.spawn.example", + java_outer_classname: "ExampleProtos", + optimize_for: :SPEED, + java_multiple_files: true, + go_package: nil, + cc_generic_services: false, + java_generic_services: false, + py_generic_services: false, + java_generate_equals_and_hash: nil, + deprecated: false, + java_string_check_utf8: false, + cc_enable_arenas: true, + objc_class_prefix: nil, + csharp_namespace: nil, + swift_prefix: nil, + php_class_prefix: nil, + php_namespace: nil, + php_metadata_namespace: nil, + ruby_package: nil, + features: nil, + uninterpreted_option: [], + __pb_extensions__: %{}, + __unknown_fields__: [] + }, + source_code_info: %Google.Protobuf.SourceCodeInfo{ + location: [ + %Google.Protobuf.SourceCodeInfo.Location{ + path: [], + span: [0, 0, 24, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\f", + span: [0, 0, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [2], + span: [2, 0, 30], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [4, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\n", + span: [4, 0, 34], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [5, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [8, 1], + span: [5, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b", + span: [6, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: ~c"\b\b", + span: [6, 0, 46], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 0], + span: [8, 0, 38], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 1], + span: [9, 0, 37], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0], + span: [11, 0, 24, 1], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 1], + span: [11, 8, 18], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0], + span: [12, 2, 16, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 1], + span: [12, 6, 11], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 2], + span: ~c"\f\f!", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 3], + span: ~c"\f,A", + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4], + span: [13, 4, 15, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 0, 4, 72_295_728], + span: [13, 4, 15, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1], + span: [18, 2, 23, 3], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 1], + span: [18, 6, 17], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 2], + span: [18, 18, 39], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 3], + span: [18, 50, 71], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4], + span: [19, 4, 22, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [6, 0, 2, 1, 4, 72_295_728], + span: [19, 4, 22, 6], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + } + ], + __unknown_fields__: [] + }, + public_dependency: [], + weak_dependency: [], + syntax: "proto3", + edition: nil, + __unknown_fields__: [] + } + end + + rpc(:Clock, Google.Protobuf.Empty, Google.Protobuf.Empty, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "", + additional_bindings: [], + response_body: "", + pattern: {:get, "/v1/clock"}, + __unknown_fields__: [] + } + } + }) + + rpc(:SecondClock, Google.Protobuf.Empty, Google.Protobuf.Empty, %{ + http: %{ + type: Google.Api.PbExtension, + value: %Google.Api.HttpRule{ + selector: "", + body: "*", + additional_bindings: [], + response_body: "", + pattern: {:post, "/v1/second_clock"}, + __unknown_fields__: [] + } + } + }) +end + +defmodule Io.Eigr.Spawn.Example.ClockActor.ActorDispatcher do + @moduledoc since: "1.2.1" + use GRPC.Server, service: Io.Eigr.Spawn.Example.ClockActor.Service, http_transcode: true + + alias Sidecar.GRPC.Dispatcher + + @spec clock(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: Google.Protobuf.Empty.t() + def clock(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "ClockActor", + action_name: "Clock", + input: message, + stream: stream, + descriptor: Io.Eigr.Spawn.Example.ClockActor.Service.descriptor() + } + + Dispatcher.dispatch(request) + end + + @spec second_clock(Google.Protobuf.Empty.t(), GRPC.Server.Stream.t()) :: + Google.Protobuf.Empty.t() + def second_clock(message, stream) do + request = %{ + system: "spawn-system", + actor_name: "ClockActor", + action_name: "SecondClock", + input: message, + stream: stream, + descriptor: Io.Eigr.Spawn.Example.ClockActor.Service.descriptor() + } + + Dispatcher.dispatch(request) + end +end + +defmodule Sidecar.GRPC.ProxyEndpoint do + @moduledoc false + use GRPC.Endpoint + + intercept(GRPC.Server.Interceptors.Logger) + + services = [ + Io.Eigr.Spawn.Example.ClockActor.ActorDispatcher, + Io.Eigr.Spawn.Example.Joe.ActorDispatcher + ] + + services = + [ + Sidecar.GRPC.Reflection.Server.V1, + Sidecar.GRPC.Reflection.Server.V1Alpha, + Eigr.Functions.Protocol.Actors.Healthcheck.HealthCheckActor.ActorDispatcher + ] ++ services + + run(services) +end + +defmodule Sidecar.GRPC.ServiceResolver do + @moduledoc since: "1.2.1" + + @actors [ + { + "ClockActor", + %{ + service_name: "Io.Eigr.Spawn.Example.ClockActor", + service_module: Io.Eigr.Spawn.Example.ClockActor.Service + } + } + ] + + def has_actor?(actor_name) do + Enum.any?(@actors, fn {name, _} -> actor_name == name end) + end + + def get_descriptor(actor_name) do + actor_attributes = + Enum.filter(@actors, fn {name, _} -> actor_name == name end) + |> Enum.map(fn {_name, attributes} -> attributes end) + |> List.first() + + mod = Map.get(actor_attributes, :service_module) + + mod.descriptor() + |> Map.get(:service) + |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> + actor_name == name + end) + |> List.first() + end +end + +defmodule Sidecar.GRPC.Reflection.Server do + @moduledoc since: "1.2.1" + + defmodule V1 do + use GrpcReflection.Server, + version: :v1, + services: [ + Io.Eigr.Spawn.Example.ClockActor.Service + ] + end + + defmodule V1Alpha do + use GrpcReflection.Server, + version: :v1alpha, + services: [ + Io.Eigr.Spawn.Example.ClockActor.Service + ] + end +end \ No newline at end of file diff --git a/priv/protos/modules/example.pb.ex b/priv/protos/modules/example.pb.ex index 85385219..8f7b2ffe 100644 --- a/priv/protos/modules/example.pb.ex +++ b/priv/protos/modules/example.pb.ex @@ -161,7 +161,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ selector: "", - body: "*", + body: "", additional_bindings: [], response_body: "", pattern: {:get, "/v1/ping"}, @@ -234,7 +234,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 29, 1], + span: [0, 0, 28, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -418,7 +418,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0], - span: [15, 0, 29, 1], + span: [15, 0, 28, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -434,7 +434,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0], - span: [16, 2, 21, 3], + span: [16, 2, 20, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -466,7 +466,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4], - span: [17, 4, 20, 6], + span: [17, 4, 19, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -474,7 +474,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4, 72_295_728], - span: [17, 4, 20, 6], + span: [17, 4, 19, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -482,7 +482,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1], - span: [23, 2, 28, 3], + span: [22, 2, 27, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -490,7 +490,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 1], - span: [23, 6, 9], + span: [22, 6, 9], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -498,7 +498,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 2], - span: [23, 10, 27], + span: [22, 10, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -506,7 +506,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 3], - span: [23, 38, 55], + span: [22, 38, 55], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -514,7 +514,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4], - span: [24, 4, 27, 6], + span: [23, 4, 26, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -522,7 +522,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4, 72_295_728], - span: [24, 4, 27, 6], + span: [23, 4, 26, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -544,7 +544,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do type: Google.Api.PbExtension, value: %Google.Api.HttpRule{ selector: "", - body: "*", + body: "", additional_bindings: [], response_body: "", pattern: {:get, "/v1/ping"}, diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex index 47663961..bae6eda1 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex @@ -21,7 +21,7 @@ defmodule Io.Eigr.Spawn.Example.ClockActor.Service do options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, - # features: nil, + features: nil, uninterpreted_option: [], __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ @@ -46,7 +46,7 @@ defmodule Io.Eigr.Spawn.Example.ClockActor.Service do options: %Google.Protobuf.MethodOptions{ deprecated: false, idempotency_level: :IDEMPOTENCY_UNKNOWN, - # features: nil, + features: nil, uninterpreted_option: [], __pb_extensions__: %{ {Google.Api.PbExtension, :http} => %Google.Api.HttpRule{ @@ -90,7 +90,7 @@ defmodule Io.Eigr.Spawn.Example.ClockActor.Service do php_namespace: nil, php_metadata_namespace: nil, ruby_package: nil, - # features: nil, + features: nil, uninterpreted_option: [], __pb_extensions__: %{}, __unknown_fields__: [] @@ -335,4 +335,4 @@ defmodule Io.Eigr.Spawn.Example.ClockActor.Service do } } }) -end +end \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex index a4f5cbac..a463e099 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex @@ -34,7 +34,7 @@ defmodule Io.Eigr.Spawn.Example.MyState do } end - field(:value, 1, type: :int32) + field :value, 1, type: :int32 end defmodule Io.Eigr.Spawn.Example.MyBusinessMessage do @@ -73,7 +73,7 @@ defmodule Io.Eigr.Spawn.Example.MyBusinessMessage do } end - field(:value, 1, type: :int32) + field :value, 1, type: :int32 end defmodule Io.Eigr.Spawn.Example.Joe.Service do @@ -85,7 +85,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do %Google.Protobuf.FileDescriptorProto{ name: "example.proto", package: "io.eigr.spawn.example", - dependency: ["google/api/annotations.proto"], + dependency: ["google/api/annotations.proto", "google/protobuf/empty.proto"], message_type: [ %Google.Protobuf.DescriptorProto{ name: "MyState", @@ -151,7 +151,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do method: [ %Google.Protobuf.MethodDescriptorProto{ name: "Ping", - input_type: ".io.eigr.spawn.example.MyBusinessMessage", + input_type: ".google.protobuf.Empty", output_type: ".io.eigr.spawn.example.MyBusinessMessage", options: %Google.Protobuf.MethodOptions{ deprecated: false, @@ -234,7 +234,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do location: [ %Google.Protobuf.SourceCodeInfo.Location{ path: [], - span: [0, 0, 27, 1], + span: [0, 0, 28, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -312,9 +312,17 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do leading_detached_comments: [], __unknown_fields__: [] }, + %Google.Protobuf.SourceCodeInfo.Location{ + path: [3, 1], + span: [9, 0, 37], + leading_comments: nil, + trailing_comments: nil, + leading_detached_comments: [], + __unknown_fields__: [] + }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0], - span: [10, 0, 36], + span: [11, 0, 36], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -322,7 +330,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 1], - span: [10, 8, 15], + span: [11, 8, 15], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -330,7 +338,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0], - span: [10, 18, 34], + span: [11, 18, 34], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -338,7 +346,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 5], - span: [10, 18, 23], + span: [11, 18, 23], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -346,7 +354,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 1], - span: [10, 24, 29], + span: [11, 24, 29], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -354,7 +362,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 0, 2, 0, 3], - span: ~c"\n !", + span: ~c"\v !", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -362,7 +370,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1], - span: [12, 0, 46], + span: [13, 0, 46], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -370,7 +378,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 1], - span: [12, 8, 25], + span: [13, 8, 25], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -378,7 +386,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0], - span: [12, 28, 44], + span: [13, 28, 44], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -386,7 +394,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 5], - span: [12, 28, 33], + span: [13, 28, 33], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -394,7 +402,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 1], - span: ~c"\f\"'", + span: ~c"\r\"'", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -402,7 +410,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [4, 1, 2, 0, 3], - span: ~c"\f*+", + span: ~c"\r*+", leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -410,7 +418,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0], - span: [14, 0, 27, 1], + span: [15, 0, 28, 1], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -418,7 +426,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 1], - span: [14, 8, 11], + span: [15, 8, 11], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -426,7 +434,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0], - span: [15, 2, 19, 3], + span: [16, 2, 20, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -434,7 +442,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 1], - span: [15, 6, 10], + span: [16, 6, 10], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -442,7 +450,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 2], - span: [15, 11, 28], + span: [16, 11, 32], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -450,7 +458,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 3], - span: [15, 39, 56], + span: [16, 43, 60], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -458,7 +466,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4], - span: [16, 4, 18, 6], + span: [17, 4, 19, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -466,7 +474,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 0, 4, 72_295_728], - span: [16, 4, 18, 6], + span: [17, 4, 19, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -474,7 +482,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1], - span: [21, 2, 26, 3], + span: [22, 2, 27, 3], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -482,7 +490,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 1], - span: [21, 6, 9], + span: [22, 6, 9], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -490,7 +498,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 2], - span: [21, 10, 27], + span: [22, 10, 27], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -498,7 +506,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 3], - span: [21, 38, 55], + span: [22, 38, 55], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -506,7 +514,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4], - span: [22, 4, 25, 6], + span: [23, 4, 26, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -514,7 +522,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do }, %Google.Protobuf.SourceCodeInfo.Location{ path: [6, 0, 2, 1, 4, 72_295_728], - span: [22, 4, 25, 6], + span: [23, 4, 26, 6], leading_comments: nil, trailing_comments: nil, leading_detached_comments: [], @@ -531,7 +539,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do } end - rpc(:Ping, Io.Eigr.Spawn.Example.MyBusinessMessage, Io.Eigr.Spawn.Example.MyBusinessMessage, %{ + rpc(:Ping, Google.Protobuf.Empty, Io.Eigr.Spawn.Example.MyBusinessMessage, %{ http: %{ type: Google.Api.PbExtension, value: %Google.Api.HttpRule{ @@ -558,4 +566,4 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do } } }) -end +end \ No newline at end of file diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/clock.bkp b/spawn_sdk/spawn_sdk_example/priv/protos/clock.proto similarity index 99% rename from spawn_sdk/spawn_sdk_example/priv/protos/clock.bkp rename to spawn_sdk/spawn_sdk_example/priv/protos/clock.proto index ebc414b4..4f73cd83 100644 --- a/spawn_sdk/spawn_sdk_example/priv/protos/clock.bkp +++ b/spawn_sdk/spawn_sdk_example/priv/protos/clock.proto @@ -22,4 +22,4 @@ service ClockActor { body : "*" }; } -} \ No newline at end of file +} diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto index 2d572b2f..f7d2c34c 100644 --- a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto +++ b/spawn_sdk/spawn_sdk_example/priv/protos/example.proto @@ -17,7 +17,6 @@ service Joe { rpc Ping(google.protobuf.Empty) returns (MyBusinessMessage) { option (google.api.http) = { get : "/v1/ping" - body : "*" }; } From c906e2bbc75c9c54e0227d374d0a43f69ad3a2ee Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Tue, 11 Jun 2024 14:26:41 -0300 Subject: [PATCH 45/48] nested folder proto example --- .../priv/protos/{ => inside_folder/nested}/clock.proto | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename spawn_sdk/spawn_sdk_example/priv/protos/{ => inside_folder/nested}/clock.proto (100%) diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/clock.proto b/spawn_sdk/spawn_sdk_example/priv/protos/inside_folder/nested/clock.proto similarity index 100% rename from spawn_sdk/spawn_sdk_example/priv/protos/clock.proto rename to spawn_sdk/spawn_sdk_example/priv/protos/inside_folder/nested/clock.proto From bb0278400fb11bc2631b15377a5ae2de0e1cbda8 Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Tue, 11 Jun 2024 15:21:31 -0300 Subject: [PATCH 46/48] some generator fixes --- lib/actors/config/persistent_term_config.ex | 29 ++++- lib/sidecar/grpc/code_generator.ex | 56 ++++++---- .../generators/reflection_server_generator.ex | 9 +- .../generators/service_resolver_generator.ex | 102 ------------------ lib/sidecar/grpc/service_resolver.ex | 5 - priv/protos/modules/README.md | 2 +- .../lib/spawn_sdk_example/clock.pb.ex | 2 +- .../lib/spawn_sdk_example/example.pb.ex | 6 +- .../priv/protos/{ => actors}/example.proto | 0 .../inside_folder/nested/clock.proto | 0 .../priv/protos/modules/actors}/example.pb.ex | 36 +------ .../actors/inside_folder/nested}/clock.pb.ex | 42 +------- 12 files changed, 81 insertions(+), 208 deletions(-) delete mode 100644 lib/sidecar/grpc/generators/service_resolver_generator.ex delete mode 100644 lib/sidecar/grpc/service_resolver.ex rename spawn_sdk/spawn_sdk_example/priv/protos/{ => actors}/example.proto (100%) rename spawn_sdk/spawn_sdk_example/priv/protos/{ => actors}/inside_folder/nested/clock.proto (100%) rename {priv/protos/modules => spawn_sdk/spawn_sdk_example/priv/protos/modules/actors}/example.pb.ex (96%) rename {priv/protos/modules => spawn_sdk/spawn_sdk_example/priv/protos/modules/actors/inside_folder/nested}/clock.pb.ex (93%) diff --git a/lib/actors/config/persistent_term_config.ex b/lib/actors/config/persistent_term_config.ex index acbf23a4..f19e54ca 100644 --- a/lib/actors/config/persistent_term_config.ex +++ b/lib/actors/config/persistent_term_config.ex @@ -31,7 +31,10 @@ if Code.ensure_loaded?(:persistent_term) do {:grpc_server_enabled, "true"}, {:grpc_reflection_enabled, "true"}, {:grpc_http_transcoding_enabled, "true"}, - {:grpc_compiled_modules_path, "#{File.cwd!()}/priv/protos/modules"}, + # default values are evaluated at runtime. + {:grpc_compiled_modules_path, :runtime}, + {:grpc_actors_protos_path, :runtime}, + {:grpc_include_protos_path, :runtime}, {:internal_nats_hosts, "nats://127.0.0.1:4222"}, {:internal_nats_tls, "false"}, {:internal_nats_auth, "false"}, @@ -268,8 +271,28 @@ if Code.ensure_loaded?(:persistent_term) do value end - defp load_env({:grpc_compiled_modules_path, default}) do - value = env("PROXY_GRPC_COMPILED_MODULES_PATH", default) + defp load_env({:grpc_actors_protos_path, :runtime}) do + default_value = "#{File.cwd!()}/priv/protos/actors" + + value = env("PROXY_GRPC_ACTORS_PROTOS_PATH", default_value) + :persistent_term.put({__MODULE__, :grpc_actors_protos_path}, value) + + value + end + + defp load_env({:grpc_include_protos_path, :runtime}) do + default_value = "#{File.cwd!()}/priv/protos" + + value = env("PROXY_GRPC_INCLUDE_PROTOS_PATH", default_value) + :persistent_term.put({__MODULE__, :grpc_include_protos_path}, value) + + value + end + + defp load_env({:grpc_compiled_modules_path, :runtime}) do + default_value = "#{File.cwd!()}/priv/protos/modules" + + value = env("PROXY_GRPC_COMPILED_MODULES_PATH", default_value) :persistent_term.put({__MODULE__, :grpc_compiled_modules_path}, value) value diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 3f2ae5dd..99d7d328 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -21,6 +21,7 @@ defmodule Sidecar.GRPC.CodeGenerator do ### Options: + - `:protos_path` - Include path of protobufs to generate (default: "priv/protos"). - `:output_path` - Output path for generated code (default: "priv/protos/modules"). - `:http_transcoding_enabled` - Enable HTTP transcoding (default: true). @@ -32,7 +33,9 @@ defmodule Sidecar.GRPC.CodeGenerator do """ def compile_protos(opts \\ []) do Logger.debug("Compiling ActorHost Protocol Buffers...") - include_path = "#{File.cwd!()}/priv/protos" + + actors_path = Keyword.get(opts, :protos_path, Config.get(:grpc_actors_protos_path)) + include_path = Keyword.get(opts, :protos_path, Config.get(:grpc_include_protos_path)) output_path = Keyword.get(opts, :output_path, Config.get(:grpc_compiled_modules_path)) transcoding_enabled? = @@ -46,12 +49,11 @@ defmodule Sidecar.GRPC.CodeGenerator do {ProtobufGenerate.Plugins.GRPC, Sidecar.GRPC.Generators.HandlerGenerator} end - user_defined_proto_files_list = - list_files_with_extension(include_path, ".proto") + user_defined_proto_files_list = list_files_with_full_path_by_extensions(actors_path, ".proto") - files = - user_defined_proto_files_list - |> Enum.map(fn file -> "#{include_path}/#{file}" end) + Logger.info( + "Found #{length(user_defined_proto_files_list)} ActorHost Protocol Buffers to compile... (#{inspect(user_defined_proto_files_list)})" + ) if length(user_defined_proto_files_list) > 0 do protoc_options = @@ -64,10 +66,9 @@ defmodule Sidecar.GRPC.CodeGenerator do "--plugins=#{grpc_generator_plugin}", "--plugins=#{handler_generator_plugin}", "--plugins=Sidecar.GRPC.Generators.ServiceGenerator", - "--plugins=Sidecar.GRPC.Generators.ServiceResolverGenerator", "--plugins=Sidecar.Grpc.Generators.ReflectionServerGenerator" ] ++ - files + user_defined_proto_files_list _ = Generate.run(protoc_options) @@ -100,18 +101,13 @@ defmodule Sidecar.GRPC.CodeGenerator do """ def load_modules(opts \\ []) do - Logger.debug("Loading ActorHost contract modules...") path = Keyword.get(opts, :output_path, Config.get(:grpc_compiled_modules_path)) - user_defined_modules_files = list_files_with_extension(path, ".pb.ex") + user_defined_modules_files = list_files_with_full_path_by_extensions(path, ".pb.ex") - modules = - Enum.map(user_defined_modules_files, fn file -> - full_path = Path.join(path, file) - File.read!(full_path) - end) + modules = Enum.map(user_defined_modules_files, fn full_path -> File.read!(full_path) end) - Logger.debug("Found #{length(modules)} ActorHost contract modules to compiling...") + Logger.info("Found #{length(modules)} ActorHost Contract Modules to compile...") {:ok, modules} end @@ -155,10 +151,30 @@ defmodule Sidecar.GRPC.CodeGenerator do Logger.error("Error during Service compilation phase #{inspect(error)}") end - defp list_files_with_extension(directory, extension) do - {:ok, files} = File.ls(directory) + defp list_files_with_full_path_by_extensions(directory, extension) do + case ls_r(directory) do + [] -> + Logger.warning("Not found any protos on #{inspect(directory)}") + + files -> + files + |> Enum.filter(&String.ends_with?(&1, extension)) + end + end - files - |> Enum.filter(&String.ends_with?(&1, extension)) + def ls_r(path \\ ".") do + cond do + File.regular?(path) -> + [path] + + File.dir?(path) -> + File.ls!(path) + |> Enum.map(&Path.join(path, &1)) + |> Enum.map(&ls_r/1) + |> Enum.concat() + + true -> + [] + end end end diff --git a/lib/sidecar/grpc/generators/reflection_server_generator.ex b/lib/sidecar/grpc/generators/reflection_server_generator.ex index 3888af49..ae961522 100644 --- a/lib/sidecar/grpc/generators/reflection_server_generator.ex +++ b/lib/sidecar/grpc/generators/reflection_server_generator.ex @@ -37,7 +37,14 @@ defmodule Sidecar.Grpc.Generators.ReflectionServerGenerator do @impl true def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do - services = Enum.map(svcs, fn svc -> Util.mod_name(ctx, [Macro.camelize(svc.name)]) end) + current_services = :persistent_term.get(:grpc_reflection_services, []) + + services = + svcs + |> Enum.map(fn svc -> Util.mod_name(ctx, [Macro.camelize(svc.name)]) end) + |> Kernel.++(current_services) + + :persistent_term.put(:grpc_reflection_services, services) {List.first(services), [ diff --git a/lib/sidecar/grpc/generators/service_resolver_generator.ex b/lib/sidecar/grpc/generators/service_resolver_generator.ex deleted file mode 100644 index d109f1c1..00000000 --- a/lib/sidecar/grpc/generators/service_resolver_generator.ex +++ /dev/null @@ -1,102 +0,0 @@ -defmodule Sidecar.GRPC.Generators.ServiceResolverGenerator do - @moduledoc """ - Module for generating a gRPC service resolver module. - - This module implements the `ProtobufGenerate.Plugin` behaviour to generate a gRPC service resolver - module that provides methods for resolving gRPC services and their descriptors. - - """ - @behaviour ProtobufGenerate.Plugin - - alias Protobuf.Protoc.Generator.Util - - @impl true - def template do - """ - defmodule Sidecar.GRPC.ServiceResolver do - @moduledoc since: "1.2.1" - - @actors [ - <%= for {actor_name, %{service_name: service_name}} <- @actors do %> - { - <%= inspect(actor_name) %>, - %{ - service_name: <%= inspect(service_name) %>, - service_module: <%= service_name %>.Service - } - } - <% end %> - ] - - def has_actor?(actor_name) do - Enum.any?(@actors, fn {name, _} -> actor_name == name end) - end - - def get_descriptor(actor_name) do - actor_attributes = - Enum.filter(@actors, fn {name, _} -> actor_name == name end) - |> Enum.map(fn {_name, attributes} -> attributes end) - |> List.first() - - mod = Map.get(actor_attributes, :service_module) - mod.descriptor() - |> Map.get(:service) - |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> actor_name == name end) - |> List.first() - end - - end - """ - end - - @impl true - def generate(ctx, %Google.Protobuf.FileDescriptorProto{service: svcs} = _desc) do - actors = - Enum.map(svcs, fn svc -> - service_name = Util.mod_name(ctx, [Macro.camelize(svc.name)]) - actor_name = Macro.camelize(svc.name) - - methods = - for m <- svc.method do - input = service_arg(Util.type_from_type_name(ctx, m.input_type), m.client_streaming) - output = service_arg(Util.type_from_type_name(ctx, m.output_type), m.server_streaming) - - options = - m.options - |> opts() - |> inspect(limit: :infinity) - - {m.name, input, output, options, m.client_streaming, m.server_streaming} - end - - { - actor_name, - %{ - service_name: service_name, - methods: methods - } - } - end) - - {name, _} = List.first(actors) - - {name, - [ - actors: actors - ]} - end - - defp service_arg(type, _streaming? = true), do: "stream(#{type})" - defp service_arg(type, _streaming?), do: type - - defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) - when extensions == %{} do - %{} - end - - defp opts(%Google.Protobuf.MethodOptions{__pb_extensions__: extensions}) do - for {{type, field}, value} <- extensions, into: %{} do - {field, %{type: type, value: value}} - end - end -end diff --git a/lib/sidecar/grpc/service_resolver.ex b/lib/sidecar/grpc/service_resolver.ex deleted file mode 100644 index 78ac2a2a..00000000 --- a/lib/sidecar/grpc/service_resolver.ex +++ /dev/null @@ -1,5 +0,0 @@ -defmodule Sidecar.GRPC.ServiceResolver do - @moduledoc """ - This module is redefined at runtime during application start. - """ -end diff --git a/priv/protos/modules/README.md b/priv/protos/modules/README.md index 129560c4..38d26eb6 100644 --- a/priv/protos/modules/README.md +++ b/priv/protos/modules/README.md @@ -1 +1 @@ -# Temporary Module Files \ No newline at end of file +# Temporary Module Files diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex index bae6eda1..fdf29a93 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/clock.pb.ex @@ -335,4 +335,4 @@ defmodule Io.Eigr.Spawn.Example.ClockActor.Service do } } }) -end \ No newline at end of file +end diff --git a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex index a463e099..54b7885d 100644 --- a/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex +++ b/spawn_sdk/spawn_sdk_example/lib/spawn_sdk_example/example.pb.ex @@ -34,7 +34,7 @@ defmodule Io.Eigr.Spawn.Example.MyState do } end - field :value, 1, type: :int32 + field(:value, 1, type: :int32) end defmodule Io.Eigr.Spawn.Example.MyBusinessMessage do @@ -73,7 +73,7 @@ defmodule Io.Eigr.Spawn.Example.MyBusinessMessage do } end - field :value, 1, type: :int32 + field(:value, 1, type: :int32) end defmodule Io.Eigr.Spawn.Example.Joe.Service do @@ -566,4 +566,4 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do } } }) -end \ No newline at end of file +end diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/example.proto b/spawn_sdk/spawn_sdk_example/priv/protos/actors/example.proto similarity index 100% rename from spawn_sdk/spawn_sdk_example/priv/protos/example.proto rename to spawn_sdk/spawn_sdk_example/priv/protos/actors/example.proto diff --git a/spawn_sdk/spawn_sdk_example/priv/protos/inside_folder/nested/clock.proto b/spawn_sdk/spawn_sdk_example/priv/protos/actors/inside_folder/nested/clock.proto similarity index 100% rename from spawn_sdk/spawn_sdk_example/priv/protos/inside_folder/nested/clock.proto rename to spawn_sdk/spawn_sdk_example/priv/protos/actors/inside_folder/nested/clock.proto diff --git a/priv/protos/modules/example.pb.ex b/spawn_sdk/spawn_sdk_example/priv/protos/modules/actors/example.pb.ex similarity index 96% rename from priv/protos/modules/example.pb.ex rename to spawn_sdk/spawn_sdk_example/priv/protos/modules/actors/example.pb.ex index 8f7b2ffe..779ee7ea 100644 --- a/priv/protos/modules/example.pb.ex +++ b/spawn_sdk/spawn_sdk_example/priv/protos/modules/actors/example.pb.ex @@ -83,7 +83,7 @@ defmodule Io.Eigr.Spawn.Example.Joe.Service do def descriptor do # credo:disable-for-next-line %Google.Protobuf.FileDescriptorProto{ - name: "example.proto", + name: "actors/example.proto", package: "io.eigr.spawn.example", dependency: ["google/api/annotations.proto", "google/protobuf/empty.proto"], message_type: [ @@ -625,40 +625,6 @@ defmodule Sidecar.GRPC.ProxyEndpoint do run(services) end -defmodule Sidecar.GRPC.ServiceResolver do - @moduledoc since: "1.2.1" - - @actors [ - { - "Joe", - %{ - service_name: "Io.Eigr.Spawn.Example.Joe", - service_module: Io.Eigr.Spawn.Example.Joe.Service - } - } - ] - - def has_actor?(actor_name) do - Enum.any?(@actors, fn {name, _} -> actor_name == name end) - end - - def get_descriptor(actor_name) do - actor_attributes = - Enum.filter(@actors, fn {name, _} -> actor_name == name end) - |> Enum.map(fn {_name, attributes} -> attributes end) - |> List.first() - - mod = Map.get(actor_attributes, :service_module) - - mod.descriptor() - |> Map.get(:service) - |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> - actor_name == name - end) - |> List.first() - end -end - defmodule Sidecar.GRPC.Reflection.Server do @moduledoc since: "1.2.1" diff --git a/priv/protos/modules/clock.pb.ex b/spawn_sdk/spawn_sdk_example/priv/protos/modules/actors/inside_folder/nested/clock.pb.ex similarity index 93% rename from priv/protos/modules/clock.pb.ex rename to spawn_sdk/spawn_sdk_example/priv/protos/modules/actors/inside_folder/nested/clock.pb.ex index fe5fba93..31c3968b 100644 --- a/priv/protos/modules/clock.pb.ex +++ b/spawn_sdk/spawn_sdk_example/priv/protos/modules/actors/inside_folder/nested/clock.pb.ex @@ -5,7 +5,7 @@ defmodule Io.Eigr.Spawn.Example.ClockActor.Service do def descriptor do # credo:disable-for-next-line %Google.Protobuf.FileDescriptorProto{ - name: "clock.proto", + name: "actors/inside_folder/nested/clock.proto", package: "io.eigr.spawn.example", dependency: ["google/api/annotations.proto", "google/protobuf/empty.proto"], message_type: [], @@ -394,40 +394,6 @@ defmodule Sidecar.GRPC.ProxyEndpoint do run(services) end -defmodule Sidecar.GRPC.ServiceResolver do - @moduledoc since: "1.2.1" - - @actors [ - { - "ClockActor", - %{ - service_name: "Io.Eigr.Spawn.Example.ClockActor", - service_module: Io.Eigr.Spawn.Example.ClockActor.Service - } - } - ] - - def has_actor?(actor_name) do - Enum.any?(@actors, fn {name, _} -> actor_name == name end) - end - - def get_descriptor(actor_name) do - actor_attributes = - Enum.filter(@actors, fn {name, _} -> actor_name == name end) - |> Enum.map(fn {_name, attributes} -> attributes end) - |> List.first() - - mod = Map.get(actor_attributes, :service_module) - - mod.descriptor() - |> Map.get(:service) - |> Enum.filter(fn %Google.Protobuf.ServiceDescriptorProto{name: name} -> - actor_name == name - end) - |> List.first() - end -end - defmodule Sidecar.GRPC.Reflection.Server do @moduledoc since: "1.2.1" @@ -435,7 +401,8 @@ defmodule Sidecar.GRPC.Reflection.Server do use GrpcReflection.Server, version: :v1, services: [ - Io.Eigr.Spawn.Example.ClockActor.Service + Io.Eigr.Spawn.Example.ClockActor.Service, + Io.Eigr.Spawn.Example.Joe.Service ] end @@ -443,7 +410,8 @@ defmodule Sidecar.GRPC.Reflection.Server do use GrpcReflection.Server, version: :v1alpha, services: [ - Io.Eigr.Spawn.Example.ClockActor.Service + Io.Eigr.Spawn.Example.ClockActor.Service, + Io.Eigr.Spawn.Example.Joe.Service ] end end \ No newline at end of file From 02293394b5f4aa4afa8b186ff73ecefdc7d038a2 Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Tue, 11 Jun 2024 15:50:56 -0300 Subject: [PATCH 47/48] fix code generator --- lib/sidecar/grpc/code_generator.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/sidecar/grpc/code_generator.ex b/lib/sidecar/grpc/code_generator.ex index 99d7d328..3701b10e 100644 --- a/lib/sidecar/grpc/code_generator.ex +++ b/lib/sidecar/grpc/code_generator.ex @@ -155,6 +155,7 @@ defmodule Sidecar.GRPC.CodeGenerator do case ls_r(directory) do [] -> Logger.warning("Not found any protos on #{inspect(directory)}") + [] files -> files From 889517113d9e8fe967bcfa8097c389a6a71b0475 Mon Sep 17 00:00:00 2001 From: eliasdarruda Date: Tue, 11 Jun 2024 16:13:27 -0300 Subject: [PATCH 48/48] fix lock deps --- mix.exs | 7 ++++--- mix.lock | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/mix.exs b/mix.exs index cc030367..8940f6fb 100644 --- a/mix.exs +++ b/mix.exs @@ -78,9 +78,8 @@ defmodule Spawn.MixProject do {:protobuf, "~> 0.12"}, {:protobuf_generate, "~> 0.1"}, {:grpc, "~> 0.8"}, - #{:grpc_reflection, "~> 0.1"}, - {:grpc_reflection, github: "elixir-grpc/grpc-reflection"}, - {:finch, "~> 0.16"}, + {:grpc_reflection, "~> 0.1"}, + {:finch, "~> 0.18"}, {:retry, "~> 0.17"}, {:flow, "~> 1.2"}, {:libcluster, "~> 3.3"}, @@ -92,6 +91,8 @@ defmodule Spawn.MixProject do {:gnat, "~> 1.7"}, {:k8s, "~> 2.2"}, {:k8s_webhoox, "~> 0.2"}, + # temporary until bandit releases 1.5.4 + {:hpax, "~> 0.1.1"}, # Metrics & Tracing deps {:telemetry_poller, "~> 1.0"}, {:telemetry_metrics, "~> 1.0"}, diff --git a/mix.lock b/mix.lock index a2bdb183..2921f8cd 100644 --- a/mix.lock +++ b/mix.lock @@ -33,13 +33,13 @@ "google_protos": {:hex, :google_protos, "0.4.0", "93e1be2c1a07517ffed761f69047776caf35e4acd385aac4f5ce4fedd07f3660", [:mix], [{:protobuf, "~> 0.10", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "4c54983d78761a3643e2198adf0f5d40a5a8b08162f3fc91c50faa257f3fa19f"}, "gproc": {:hex, :gproc, "0.9.1", "f1df0364423539cf0b80e8201c8b1839e229e5f9b3ccb944c5834626998f5b8c", [:rebar3], [], "hexpm", "905088e32e72127ed9466f0bac0d8e65704ca5e73ee5a62cb073c3117916d507"}, "grpc": {:hex, :grpc, "0.8.1", "a8a5884a0d41fc30679c269d0332571cebb43cbfd6eb3d4819169778e866343e", [:mix], [{:castore, "~> 0.1 or ~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:cowboy, "~> 2.10", [hex: :cowboy, repo: "hexpm", optional: false]}, {:cowlib, "~> 2.12", [hex: :cowlib, repo: "hexpm", optional: false]}, {:gun, "~> 2.0", [hex: :gun, repo: "hexpm", optional: false]}, {:jason, ">= 0.0.0", [hex: :jason, repo: "hexpm", optional: true]}, {:mint, "~> 1.5", [hex: :mint, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "1cccd9fd83547a562f315cc0e1ee1879546f0a44193b5c8eb8d68dae0bb2065b"}, - "grpc_reflection": {:git, "https://github.com/elixir-grpc/grpc-reflection.git", "fd4861416d05c8b772b73130f366f6f71bf4bfdc", []}, + "grpc_reflection": {:hex, :grpc_reflection, "0.1.4", "0b3542801ff7078e53dc5dee3d79205f3b8d1fec391c6e890926a182f83d09e0", [:mix], [{:google_protos, "~> 0.4.0", [hex: :google_protos, repo: "hexpm", optional: false]}, {:grpc, "~> 0.7", [hex: :grpc, repo: "hexpm", optional: false]}, {:protobuf, "~> 0.11", [hex: :protobuf, repo: "hexpm", optional: false]}], "hexpm", "74a6148335305926b166a58c8e040f64501410d744be55ebe343a704003e994a"}, "grpcbox": {:hex, :grpcbox, "0.17.1", "6e040ab3ef16fe699ffb513b0ef8e2e896da7b18931a1ef817143037c454bcce", [:rebar3], [{:acceptor_pool, "~> 1.0.0", [hex: :acceptor_pool, repo: "hexpm", optional: false]}, {:chatterbox, "~> 0.15.1", [hex: :ts_chatterbox, repo: "hexpm", optional: false]}, {:ctx, "~> 0.6.0", [hex: :ctx, repo: "hexpm", optional: false]}, {:gproc, "~> 0.9.1", [hex: :gproc, repo: "hexpm", optional: false]}], "hexpm", "4a3b5d7111daabc569dc9cbd9b202a3237d81c80bf97212fbc676832cb0ceb17"}, "gun": {:hex, :gun, "2.1.0", "b4e4cbbf3026d21981c447e9e7ca856766046eff693720ba43114d7f5de36e87", [:make, :rebar3], [{:cowlib, "2.13.0", [hex: :cowlib, repo: "hexpm", optional: false]}], "hexpm", "52fc7fc246bfc3b00e01aea1c2854c70a366348574ab50c57dfe796d24a0101d"}, "highlander": {:hex, :highlander, "0.2.1", "e59b459f857e89daf73f2598bf2b2c0479a435481e6101ea389fd3625919b052", [:mix], [], "hexpm", "5ba19a18358803d82a923511acec8ee85fac30731c5ca056f2f934bc3d3afd9a"}, "horde": {:hex, :horde, "0.9.0", "522342bd7149aeed453c97692a8bca9cf7c9368c5a489afd802e575dc8df54a6", [:mix], [{:delta_crdt, "~> 0.6.2", [hex: :delta_crdt, repo: "hexpm", optional: false]}, {:libring, "~> 1.4", [hex: :libring, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.0 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:telemetry_poller, "~> 0.5.0 or ~> 1.0", [hex: :telemetry_poller, repo: "hexpm", optional: false]}], "hexpm", "fae11e5bc9c980038607d0c3338cdf7f97124a5d5382fd4b6fb6beaab8e214fe"}, "hpack": {:hex, :hpack_erl, "0.3.0", "2461899cc4ab6a0ef8e970c1661c5fc6a52d3c25580bc6dd204f84ce94669926", [:rebar3], [], "hexpm", "d6137d7079169d8c485c6962dfe261af5b9ef60fbc557344511c1e65e3d95fb0"}, - "hpax": {:hex, :hpax, "0.2.0", "5a58219adcb75977b2edce5eb22051de9362f08236220c9e859a47111c194ff5", [:mix], [], "hexpm", "bea06558cdae85bed075e6c036993d43cd54d447f76d8190a8db0dc5893fa2f1"}, + "hpax": {:hex, :hpax, "0.1.2", "09a75600d9d8bbd064cdd741f21fc06fc1f4cf3d0fcc335e5aa19be1a7235c84", [:mix], [], "hexpm", "2c87843d5a23f5f16748ebe77969880e29809580efdaccd615cd3bed628a8c13"}, "iter": {:hex, :iter, "0.1.2", "bd5dbba48ba67e0f134889a4a29f2b377db6cdcee0661f3c29439e7b649e317a", [:mix], [], "hexpm", "e79f53ed36105ae72582fd3ef224ca2539ccc00cdc27e6e7fe69c49119c4e39b"}, "jason": {:hex, :jason, "1.4.1", "af1504e35f629ddcdd6addb3513c3853991f694921b1b9368b0bd32beb9f1b63", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "fbb01ecdfd565b56261302f7e1fcc27c4fb8f32d56eab74db621fc154604a7a1"}, "k8s": {:hex, :k8s, "2.6.1", "ef949e268a65fc45e4481e1071b96c8aa7eae028f0f451052c301d72aae649a2", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mint, "~> 1.0", [hex: :mint, repo: "hexpm", optional: false]}, {:mint_web_socket, "~> 1.0", [hex: :mint_web_socket, repo: "hexpm", optional: false]}, {:poolboy, "~> 1.5", [hex: :poolboy, repo: "hexpm", optional: false]}, {:telemetry, "~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:yaml_elixir, "~> 2.8", [hex: :yaml_elixir, repo: "hexpm", optional: false]}], "hexpm", "a95bde29b60ea94b2ba341969f911e94ae38fc635a332549c39e726ba76ebe10"},