Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to protobuf 0.11 #286

Merged
merged 9 commits into from
Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ The package can be installed as:
# We don't force protobuf as a dependency for more
# flexibility on which protobuf library is used,
# but you probably want to use it as well
{:protobuf, "~> 0.10"}
{:protobuf, "~> 0.11"}
]
end
```
Expand Down
33 changes: 6 additions & 27 deletions benchmark/lib/grpc/core/stats.pb.ex
Original file line number Diff line number Diff line change
@@ -1,53 +1,32 @@
defmodule Grpc.Core.Bucket do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
start: float(),
count: non_neg_integer()
}
defstruct [:start, :count]
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

field :start, 1, type: :double
field :count, 2, type: :uint64
end

defmodule Grpc.Core.Histogram do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
buckets: [Grpc.Core.Bucket.t()]
}
defstruct [:buckets]
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

field :buckets, 1, repeated: true, type: Grpc.Core.Bucket
end

defmodule Grpc.Core.Metric do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
value: {atom(), any()},
name: String.t()
}
defstruct [:value, :name]
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

oneof :value, 0

field :name, 1, type: :string
field :count, 10, type: :uint64, oneof: 0
field :histogram, 11, type: Grpc.Core.Histogram, oneof: 0
end

defmodule Grpc.Core.Stats do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
metrics: [Grpc.Core.Metric.t()]
}
defstruct [:metrics]
use Protobuf, protoc_gen_elixir_version: "0.11.0", syntax: :proto3

field :metrics, 1, repeated: true, type: Grpc.Core.Metric
end
end
8 changes: 6 additions & 2 deletions benchmark/lib/grpc/testing/benchmark_service.pb.ex
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
defmodule Grpc.Testing.BenchmarkService.Service do
@moduledoc false
use GRPC.Service, name: "grpc.testing.BenchmarkService"
use GRPC.Service, name: "grpc.testing.BenchmarkService", protoc_gen_elixir_version: "0.11.0"

rpc :UnaryCall, Grpc.Testing.SimpleRequest, Grpc.Testing.SimpleResponse

rpc :StreamingCall, stream(Grpc.Testing.SimpleRequest), stream(Grpc.Testing.SimpleResponse)

rpc :StreamingFromClient, stream(Grpc.Testing.SimpleRequest), Grpc.Testing.SimpleResponse

rpc :StreamingFromServer, Grpc.Testing.SimpleRequest, stream(Grpc.Testing.SimpleResponse)

rpc :StreamingBothWays, stream(Grpc.Testing.SimpleRequest), stream(Grpc.Testing.SimpleResponse)
end

defmodule Grpc.Testing.BenchmarkService.Stub do
@moduledoc false
use GRPC.Stub, service: Grpc.Testing.BenchmarkService.Service
end
end
Loading