partiarelic 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2c2f5373793a831f3d5390ab1de3504d6ac3eb4a
4
- data.tar.gz: 127b5525e4f357464fd207510b8d4b78edc37f34
2
+ SHA256:
3
+ metadata.gz: 8ded9cd7491060ad70e39ef4f2ccfdd562f6ba125d3eb8accc18206f1ec852f8
4
+ data.tar.gz: 2598839c3b6c6449f72dec577b1b00fbf8ba18d5d4eeeb0216761a3cecd79cd9
5
5
  SHA512:
6
- metadata.gz: b06fac2402031d75d01e8139910a67c7ff8eaba08b64ea5f1987b156bf4d32763a17f6dfcf3add59f7fee818e1151111618108fa01ddb4b26a38449abe21fa95
7
- data.tar.gz: 5759eb4952e652af83ebc9275a9c42b03755fb2db5adbc034d09117ce906b35d39f56d449e654ec0eec60b2c9803edb2fa2d7bc45286bd4996a3a09d34663a07
6
+ metadata.gz: 6b6d1aa76189fd51cd5c75a0d4f4a6f9e22cc18c520014bffdcc7e32af59e40edce3a6f84e9f6a4038a42cfae211c4764a644d81f003d5da4b8810eccd14e6d2
7
+ data.tar.gz: 93e8f495c71794fecaa9ca31f34bc5e3a051ee84c42f595a33c2e4b8ebbfb16b313bd4aa5385380bfee2a4b9af23c0382228c693a4670a05228a0a5429a9bc8f
data/README.md CHANGED
@@ -46,6 +46,24 @@ map '/_newrelic/manual_start' do
46
46
  end
47
47
  ```
48
48
 
49
+ ### gRPC application
50
+
51
+ ```ruby
52
+ # Gemfile
53
+ gem 'partiarelic', require 'partiarelic/grpc'
54
+
55
+ # server
56
+ s = GRPC::RpcServer.new
57
+ s.add_http2_port(host, :this_port_is_insecure)
58
+ s.handle(Partiarelic::GrpcApp)
59
+ s.run_till_terminated
60
+
61
+ # client
62
+ require 'partiarelic/grpc/partiarelic_services_pb.rb'
63
+ stub = Partiarelic::V1::App::Stub.new(host, :this_channel_is_insecure)
64
+ stub.manual_start(Partiarelic::V1::ManualStartRequest.new)
65
+ ```
66
+
49
67
  ## Development
50
68
 
51
69
  ### Test
@@ -0,0 +1,11 @@
1
+ require 'partiarelic/grpc/partiarelic_services_pb.rb'
2
+ require 'newrelic_rpm'
3
+
4
+ module Partiarelic
5
+ class GrpcApp < Partiarelic::V1::App::Service
6
+ def manual_start(reqeust_, call_)
7
+ NewRelic::Agent.manual_start
8
+ Partiarelic::V1::ManualStartResponse.new
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ syntax = "proto3";
2
+
3
+ package partiarelic.v1;
4
+
5
+ service App {
6
+ rpc ManualStart (ManualStartRequest) returns (ManualStartResponse) {}
7
+ }
8
+
9
+ message ManualStartRequest {}
10
+
11
+ message ManualStartResponse {}
@@ -0,0 +1,18 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: partiarelic/grpc/partiarelic.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message "partiarelic.v1.ManualStartRequest" do
8
+ end
9
+ add_message "partiarelic.v1.ManualStartResponse" do
10
+ end
11
+ end
12
+
13
+ module Partiarelic
14
+ module V1
15
+ ManualStartRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("partiarelic.v1.ManualStartRequest").msgclass
16
+ ManualStartResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("partiarelic.v1.ManualStartResponse").msgclass
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: partiarelic/grpc/partiarelic.proto for package 'partiarelic.v1'
3
+
4
+ require 'grpc'
5
+ require 'partiarelic/grpc/partiarelic_pb'
6
+
7
+ module Partiarelic
8
+ module V1
9
+ module App
10
+ class Service
11
+
12
+ include GRPC::GenericService
13
+
14
+ self.marshal_class_method = :encode
15
+ self.unmarshal_class_method = :decode
16
+ self.service_name = 'partiarelic.v1.App'
17
+
18
+ rpc :ManualStart, ManualStartRequest, ManualStartResponse
19
+ end
20
+
21
+ Stub = Service.rpc_stub_class
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Partiarelic
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
data/partiarelic.gemspec CHANGED
@@ -27,6 +27,8 @@ Gem::Specification.new do |spec|
27
27
  spec.add_development_dependency 'rspec', '~> 3.0'
28
28
  spec.add_development_dependency 'rack-test', '~> 0.6.3'
29
29
  spec.add_development_dependency 'pry-byebug', '~> 3.4'
30
+ spec.add_development_dependency 'grpc-tools'
31
+ spec.add_development_dependency 'grpc'
30
32
 
31
33
  spec.add_dependency 'rack'
32
34
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: partiarelic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - wata
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-23 00:00:00.000000000 Z
11
+ date: 2018-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: newrelic_rpm
@@ -94,6 +94,34 @@ dependencies:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '3.4'
97
+ - !ruby/object:Gem::Dependency
98
+ name: grpc-tools
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: grpc
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
97
125
  - !ruby/object:Gem::Dependency
98
126
  name: rack
99
127
  requirement: !ruby/object:Gem::Requirement
@@ -126,6 +154,10 @@ files:
126
154
  - bin/setup
127
155
  - lib/partiarelic.rb
128
156
  - lib/partiarelic/app.rb
157
+ - lib/partiarelic/grpc.rb
158
+ - lib/partiarelic/grpc/partiarelic.proto
159
+ - lib/partiarelic/grpc/partiarelic_pb.rb
160
+ - lib/partiarelic/grpc/partiarelic_services_pb.rb
129
161
  - lib/partiarelic/middleware.rb
130
162
  - lib/partiarelic/rails.rb
131
163
  - lib/partiarelic/version.rb
@@ -150,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
182
  version: '0'
151
183
  requirements: []
152
184
  rubyforge_project:
153
- rubygems_version: 2.6.13
185
+ rubygems_version: 2.7.6
154
186
  signing_key:
155
187
  specification_version: 4
156
188
  summary: Rack middleware and application to enable NewRelic agent.