-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d284d36
commit a3e85f5
Showing
6 changed files
with
39 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,59 @@ | ||
defmodule Routeguide.Point do | ||
use Protobuf | ||
@moduledoc false | ||
use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 | ||
|
||
@type t :: %__MODULE__{ | ||
latitude: integer, | ||
longitude: integer | ||
} | ||
defstruct [:latitude, :longitude] | ||
|
||
field :latitude, 1, optional: true, type: :int32 | ||
field :longitude, 2, optional: true, type: :int32 | ||
field :latitude, 1, type: :int32 | ||
field :longitude, 2, type: :int32 | ||
end | ||
|
||
defmodule Routeguide.Rectangle do | ||
use Protobuf | ||
|
||
@type t :: %__MODULE__{ | ||
lo: Routeguide.Point.t(), | ||
hi: Routeguide.Point.t() | ||
} | ||
defstruct [:lo, :hi] | ||
@moduledoc false | ||
use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 | ||
|
||
field :lo, 1, optional: true, type: Routeguide.Point | ||
field :hi, 2, optional: true, type: Routeguide.Point | ||
field :lo, 1, type: Routeguide.Point | ||
field :hi, 2, type: Routeguide.Point | ||
end | ||
|
||
defmodule Routeguide.Feature do | ||
use Protobuf | ||
@moduledoc false | ||
use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 | ||
|
||
@type t :: %__MODULE__{ | ||
name: String.t(), | ||
location: Routeguide.Point.t() | ||
} | ||
defstruct [:name, :location] | ||
|
||
field :name, 1, optional: true, type: :string | ||
field :location, 2, optional: true, type: Routeguide.Point | ||
field :name, 1, type: :string | ||
field :location, 2, type: Routeguide.Point | ||
end | ||
|
||
defmodule Routeguide.RouteNote do | ||
use Protobuf | ||
|
||
@type t :: %__MODULE__{ | ||
location: Routeguide.Point.t(), | ||
message: String.t() | ||
} | ||
defstruct [:location, :message] | ||
@moduledoc false | ||
use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 | ||
|
||
field :location, 1, optional: true, type: Routeguide.Point | ||
field :message, 2, optional: true, type: :string | ||
field :location, 1, type: Routeguide.Point | ||
field :message, 2, type: :string | ||
end | ||
|
||
defmodule Routeguide.RouteSummary do | ||
use Protobuf | ||
@moduledoc false | ||
use Protobuf, protoc_gen_elixir_version: "0.10.0", syntax: :proto3 | ||
|
||
@type t :: %__MODULE__{ | ||
point_count: integer, | ||
feature_count: integer, | ||
distance: integer, | ||
elapsed_time: integer | ||
} | ||
defstruct [:point_count, :feature_count, :distance, :elapsed_time] | ||
|
||
field :point_count, 1, optional: true, type: :int32 | ||
field :feature_count, 2, optional: true, type: :int32 | ||
field :distance, 3, optional: true, type: :int32 | ||
field :elapsed_time, 4, optional: true, type: :int32 | ||
field :point_count, 1, type: :int32, json_name: "pointCount" | ||
field :feature_count, 2, type: :int32, json_name: "featureCount" | ||
field :distance, 3, type: :int32 | ||
field :elapsed_time, 4, type: :int32, json_name: "elapsedTime" | ||
end | ||
|
||
defmodule Routeguide.RouteGuide.Service do | ||
use GRPC.Service, name: "routeguide.RouteGuide" | ||
@moduledoc false | ||
use GRPC.Service, name: "routeguide.RouteGuide", protoc_gen_elixir_version: "0.10.0" | ||
|
||
rpc :GetFeature, Routeguide.Point, Routeguide.Feature | ||
|
||
rpc :ListFeatures, Routeguide.Rectangle, stream(Routeguide.Feature) | ||
|
||
rpc :RecordRoute, stream(Routeguide.Point), Routeguide.RouteSummary | ||
|
||
rpc :RouteChat, stream(Routeguide.RouteNote), stream(Routeguide.RouteNote) | ||
rpc :AsyncRouteChat, stream(Routeguide.RouteNote), stream(Routeguide.RouteNote) | ||
end | ||
|
||
defmodule Routeguide.RouteGuide.Stub do | ||
@moduledoc false | ||
use GRPC.Stub, service: Routeguide.RouteGuide.Service | ||
end |