grpc_kit 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/grpc.rb +0 -5
- data/lib/grpc_kit/errors.rb +106 -15
- data/lib/grpc_kit/grpc/core.rb +1 -1
- data/lib/grpc_kit/version.rb +1 -1
- data/lib/grpc_kit.rb +5 -0
- 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: 6934bf16ccf69b6ba90fcbb6047a742a6f8650f983a6a63decc1a8d23663905b
|
4
|
+
data.tar.gz: 72afafb9a4ab33b2902e7cc224493317bd59590623a6c7de7db18adddf048505
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cf73c55066c743b74cff8fa179a8cc3546fefdbe18e86b965a2cdb5bcf3db14c8dd75eeb8f9f771bb001cc1d099b3c4b04118e9bbccbffc69d1ebe49cb5bce2
|
7
|
+
data.tar.gz: 5dd4e03dd79f6b226a55a8255e957788823310e1e7697735d450e9fda50e9aaaa4b34f347eba6df6ad2fcdc8392d83168e152c59c061001adaf4fb9905000926
|
data/lib/grpc.rb
CHANGED
@@ -2,10 +2,5 @@
|
|
2
2
|
|
3
3
|
# Compatible file for xx_services_pb.rb and xx_pb.rb which are created by grpc-tools gem
|
4
4
|
require 'grpc_kit'
|
5
|
-
require 'grpc_kit/grpc/core'
|
6
|
-
require 'grpc_kit/grpc/errors'
|
7
|
-
require 'grpc_kit/grpc/generic_service'
|
8
|
-
require 'grpc_kit/grpc/interceptor'
|
9
|
-
require 'grpc_kit/grpc/logger'
|
10
5
|
|
11
6
|
GRPC = GrpcKit::GRPC
|
data/lib/grpc_kit/errors.rb
CHANGED
@@ -29,6 +29,20 @@ module GrpcKit
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
class Ok < BadStatus
|
33
|
+
# @param message [String]
|
34
|
+
def initialize(message)
|
35
|
+
super(GrpcKit::StatusCodes::OK, message)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class Cancelled < BadStatus
|
40
|
+
# @param message [String]
|
41
|
+
def initialize(message)
|
42
|
+
super(GrpcKit::StatusCodes::CANCELLED, message)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
32
46
|
class Unknown < BadStatus
|
33
47
|
# @param message [String]
|
34
48
|
def initialize(message)
|
@@ -36,6 +50,13 @@ module GrpcKit
|
|
36
50
|
end
|
37
51
|
end
|
38
52
|
|
53
|
+
class InvalidArgument < BadStatus
|
54
|
+
# @param message [String]
|
55
|
+
def initialize(message)
|
56
|
+
super(GrpcKit::StatusCodes::INVALID_ARGUMENT, message)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
39
60
|
class DeadlineExceeded < BadStatus
|
40
61
|
# @param message [String]
|
41
62
|
def initialize(message)
|
@@ -43,10 +64,24 @@ module GrpcKit
|
|
43
64
|
end
|
44
65
|
end
|
45
66
|
|
46
|
-
class
|
67
|
+
class NotFound < BadStatus
|
47
68
|
# @param message [String]
|
48
69
|
def initialize(message)
|
49
|
-
super(GrpcKit::StatusCodes::
|
70
|
+
super(GrpcKit::StatusCodes::NOT_FOUND, message)
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
class AlreadyExists < BadStatus
|
75
|
+
# @param message [String]
|
76
|
+
def initialize(message)
|
77
|
+
super(GrpcKit::StatusCodes::ALREADY_EXISTS, message)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
class PermissionDenied < BadStatus
|
82
|
+
# @param message [String]
|
83
|
+
def initialize(message)
|
84
|
+
super(GrpcKit::StatusCodes::PERMISSION_DENIED, message)
|
50
85
|
end
|
51
86
|
end
|
52
87
|
|
@@ -57,6 +92,34 @@ module GrpcKit
|
|
57
92
|
end
|
58
93
|
end
|
59
94
|
|
95
|
+
class FailedPrecondition < BadStatus
|
96
|
+
# @param message [String]
|
97
|
+
def initialize(message)
|
98
|
+
super(GrpcKit::StatusCodes::FAILED_PRECONDITION, message)
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
class Aborted < BadStatus
|
103
|
+
# @param message [String]
|
104
|
+
def initialize(message)
|
105
|
+
super(GrpcKit::StatusCodes::ABORTED, message)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
class OutOfRange < BadStatus
|
110
|
+
# @param message [String]
|
111
|
+
def initialize(message)
|
112
|
+
super(GrpcKit::StatusCodes::OUT_OF_RANGE, message)
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
class Unimplemented < BadStatus
|
117
|
+
# @param message [String]
|
118
|
+
def initialize(message)
|
119
|
+
super(GrpcKit::StatusCodes::UNIMPLEMENTED, message)
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
60
123
|
class Internal < BadStatus
|
61
124
|
# @param message [String]
|
62
125
|
def initialize(message)
|
@@ -64,25 +127,53 @@ module GrpcKit
|
|
64
127
|
end
|
65
128
|
end
|
66
129
|
|
130
|
+
class Unavailable < BadStatus
|
131
|
+
# @param message [String]
|
132
|
+
def initialize(message)
|
133
|
+
super(GrpcKit::StatusCodes::UNAVAILABLE, message)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
class DataLoss < BadStatus
|
138
|
+
# @param message [String]
|
139
|
+
def initialize(message)
|
140
|
+
super(GrpcKit::StatusCodes::DATA_LOSS, message)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
class Unauthenticated < BadStatus
|
145
|
+
# @param message [String]
|
146
|
+
def initialize(message)
|
147
|
+
super(GrpcKit::StatusCodes::UNAUTHENTICATED, message)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
class DoNotUse < BadStatus
|
152
|
+
# @param message [String]
|
153
|
+
def initialize(message)
|
154
|
+
super(GrpcKit::StatusCodes::DO_NOT_USE, message)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
67
158
|
CODES = {
|
68
|
-
|
69
|
-
|
159
|
+
GrpcKit::StatusCodes::OK => Ok,
|
160
|
+
GrpcKit::StatusCodes::CANCELLED => Cancelled,
|
70
161
|
GrpcKit::StatusCodes::UNKNOWN => Unknown,
|
71
|
-
|
162
|
+
GrpcKit::StatusCodes::INVALID_ARGUMENT => InvalidArgument,
|
72
163
|
GrpcKit::StatusCodes::DEADLINE_EXCEEDED => DeadlineExceeded,
|
73
|
-
|
74
|
-
|
75
|
-
|
164
|
+
GrpcKit::StatusCodes::NOT_FOUND => NotFound,
|
165
|
+
GrpcKit::StatusCodes::ALREADY_EXISTS => AlreadyExists,
|
166
|
+
GrpcKit::StatusCodes::PERMISSION_DENIED => PermissionDenied,
|
76
167
|
GrpcKit::StatusCodes::RESOURCE_EXHAUSTED => ResourceExhausted,
|
77
|
-
|
78
|
-
|
79
|
-
|
168
|
+
GrpcKit::StatusCodes::FAILED_PRECONDITION => FailedPrecondition,
|
169
|
+
GrpcKit::StatusCodes::ABORTED => Aborted,
|
170
|
+
GrpcKit::StatusCodes::OUT_OF_RANGE => OutOfRange,
|
80
171
|
GrpcKit::StatusCodes::UNIMPLEMENTED => Unimplemented,
|
81
172
|
GrpcKit::StatusCodes::INTERNAL => Internal,
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
173
|
+
GrpcKit::StatusCodes::UNAVAILABLE => Unavailable,
|
174
|
+
GrpcKit::StatusCodes::DATA_LOSS => DataLoss,
|
175
|
+
GrpcKit::StatusCodes::UNAUTHENTICATED => Unauthenticated,
|
176
|
+
GrpcKit::StatusCodes::DO_NOT_USE => DoNotUse,
|
86
177
|
}.freeze
|
87
178
|
end
|
88
179
|
end
|
data/lib/grpc_kit/grpc/core.rb
CHANGED
data/lib/grpc_kit/version.rb
CHANGED
data/lib/grpc_kit.rb
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
require 'logger'
|
4
4
|
|
5
|
+
require 'grpc_kit/grpc/core'
|
6
|
+
require 'grpc_kit/grpc/errors'
|
7
|
+
require 'grpc_kit/grpc/generic_service'
|
8
|
+
require 'grpc_kit/grpc/interceptor'
|
9
|
+
require 'grpc_kit/grpc/logger'
|
5
10
|
require 'grpc_kit/version'
|
6
11
|
require 'grpc_kit/server'
|
7
12
|
require 'grpc_kit/client'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grpc_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ganmacs
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-11-
|
11
|
+
date: 2018-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ds9
|