grpc_server_template 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/grpc_server_template/client.rb +3 -4
- data/lib/grpc_server_template/handler.rb +2 -2
- data/lib/grpc_server_template/messages.rb +3 -1
- data/lib/grpc_server_template/server.rb +2 -3
- data/lib/grpc_server_template/service.rb +6 -4
- data/lib/grpc_server_template/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5bab622599c9f63443fa0f557e81b34cd86d605779adf6645a9612d4123fa079
|
4
|
+
data.tar.gz: 3773e6dff35ab2e1dd8e6020f1431b5734816258f5602deec7fab4463539cb39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1392f376410ec37f3058549052c8a7f6f071ac0e6dba59cfc92424b8cbd57c71bd8ef9ab344e188798f3dbe59fd1b599cd3528854427a58d4e5ba9939bd4af4
|
7
|
+
data.tar.gz: d40bcaa2f22452c9b28f3162ad4938f07931e1af4fa0cc5bf6a687cb90cbd66d706f2e6df32bb315b4a094c213fb4ce837c0236fe79c773c0c50bc9a75facf01
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
4
|
-
require_relative
|
3
|
+
require_relative "messages"
|
4
|
+
require_relative "service"
|
5
5
|
|
6
6
|
module GrpcServerTemplate
|
7
7
|
# Client
|
8
8
|
class Client
|
9
9
|
class << self
|
10
10
|
def say_hello(name: "server")
|
11
|
-
stub = GrpcServerTemplate::Stub.new(
|
11
|
+
stub = GrpcServerTemplate::Stub.new("0.0.0.0:50052", :this_channel_is_insecure)
|
12
12
|
req = GrpcServerTemplate::Messages::HelloRequest.new(name: name)
|
13
13
|
resp_obj = stub.say_hello(req)
|
14
14
|
puts "Response: #{resp_obj}"
|
@@ -16,4 +16,3 @@ module GrpcServerTemplate
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
end
|
19
|
-
|
@@ -1,7 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
4
|
# source: grpc_server_template.proto
|
3
5
|
|
4
|
-
require
|
6
|
+
require "google/protobuf"
|
5
7
|
|
6
8
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
7
9
|
add_file("grpc_server_template.proto", :syntax => :proto3) do
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative
|
3
|
+
require_relative "handler"
|
4
4
|
|
5
5
|
module GrpcServerTemplate
|
6
6
|
# Server
|
7
7
|
class Server
|
8
8
|
class << self
|
9
|
-
def start(port:
|
9
|
+
def start(port: 50_052)
|
10
10
|
@server = GRPC::RpcServer.new
|
11
11
|
@server.add_http2_port("0.0.0.0:#{port}", :this_port_is_insecure)
|
12
12
|
@server.handle(GrpcServerTemplate::Handler)
|
@@ -15,4 +15,3 @@ module GrpcServerTemplate
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
18
|
-
|
@@ -1,8 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
-
# Source: grpc_server_template.proto for package
|
4
|
+
# Source: grpc_server_template.proto for package ""
|
3
5
|
|
4
|
-
require
|
5
|
-
require_relative
|
6
|
+
require "grpc"
|
7
|
+
require_relative "messages"
|
6
8
|
|
7
9
|
module GrpcServerTemplate
|
8
10
|
# The greeting service definition.
|
@@ -12,7 +14,7 @@ module GrpcServerTemplate
|
|
12
14
|
|
13
15
|
self.marshal_class_method = :encode
|
14
16
|
self.unmarshal_class_method = :decode
|
15
|
-
self.service_name =
|
17
|
+
self.service_name = "GrpcServerTemplate"
|
16
18
|
|
17
19
|
rpc :SayHello, GrpcServerTemplate::Messages::HelloRequest, GrpcServerTemplate::Messages::HelloReply
|
18
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grpc_server_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sylvance
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A template for the ruby grpc server.
|
14
14
|
email:
|