protocol-grpc 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/context/getting-started.md +4 -1
- data/design.md +19 -19
- data/lib/protocol/grpc/error.rb +1 -1
- data/lib/protocol/grpc/status.rb +19 -19
- data/lib/protocol/grpc/version.rb +1 -1
- data/readme.md +4 -4
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2195318192e11fc3cafc54e82ccb65b4111e1e5ab9d1772ec8e4e002e6251136
|
|
4
|
+
data.tar.gz: 9916efb3e3966c9242cbefca5534d233f82d079d363a4ecec86c4808dd707bcf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8236e53f25377fc556da30e47e36e8828a20fb7b2064d7a2b8046309f23ab26e98f3a8338842fb429f47fb510e58361ebcc1e06f24d097f4d37507159eb050b6
|
|
7
|
+
data.tar.gz: 2941d6b8edb774e16c6530b20cc76d330fccc05021564a32bb5bf8b4e5448c4e664001d3a59bd71cf584d4c276688b84749c6096582ff2661be6e761ca729650
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/context/getting-started.md
CHANGED
|
@@ -19,7 +19,7 @@ $ bundle add protocol-grpc
|
|
|
19
19
|
- A {ruby Protocol::GRPC::Body::Writable} class which handles writing gRPC messages to HTTP request/response bodies with automatic framing and encoding.
|
|
20
20
|
- A {ruby Protocol::GRPC::Middleware} abstract base class for building gRPC server applications.
|
|
21
21
|
- A {ruby Protocol::GRPC::Call} class which represents the request, response, metadata, and deadline for a single gRPC RPC call.
|
|
22
|
-
- A {ruby Protocol::GRPC::Status} module with gRPC status code constants.
|
|
22
|
+
- A {ruby Protocol::GRPC::Status} module with gRPC status code constants and names.
|
|
23
23
|
- A {ruby Protocol::GRPC::Error} hierarchy for gRPC-specific error handling.
|
|
24
24
|
|
|
25
25
|
## Integration
|
|
@@ -103,6 +103,9 @@ if status != Protocol::GRPC::Status::OK
|
|
|
103
103
|
message = Protocol::GRPC::Metadata.extract_message(response.headers)
|
|
104
104
|
raise Protocol::GRPC::Error.for(status, message)
|
|
105
105
|
end
|
|
106
|
+
|
|
107
|
+
# Use canonical gRPC status names for logging, metrics, or serialization:
|
|
108
|
+
Protocol::GRPC::Status::NAMES[status] # => "OK"
|
|
106
109
|
```
|
|
107
110
|
|
|
108
111
|
### Server Middleware
|
data/design.md
CHANGED
|
@@ -496,25 +496,25 @@ module Protocol
|
|
|
496
496
|
DATA_LOSS = 15
|
|
497
497
|
UNAUTHENTICATED = 16
|
|
498
498
|
|
|
499
|
-
# Status code
|
|
500
|
-
|
|
499
|
+
# Status code names
|
|
500
|
+
NAMES = {
|
|
501
501
|
OK => "OK",
|
|
502
|
-
CANCELLED => "
|
|
503
|
-
UNKNOWN => "
|
|
504
|
-
INVALID_ARGUMENT => "
|
|
505
|
-
DEADLINE_EXCEEDED => "
|
|
506
|
-
NOT_FOUND => "
|
|
507
|
-
ALREADY_EXISTS => "
|
|
508
|
-
PERMISSION_DENIED => "
|
|
509
|
-
RESOURCE_EXHAUSTED => "
|
|
510
|
-
FAILED_PRECONDITION => "
|
|
511
|
-
ABORTED => "
|
|
512
|
-
OUT_OF_RANGE => "
|
|
513
|
-
UNIMPLEMENTED => "
|
|
514
|
-
INTERNAL => "
|
|
515
|
-
UNAVAILABLE => "
|
|
516
|
-
DATA_LOSS => "
|
|
517
|
-
UNAUTHENTICATED => "
|
|
502
|
+
CANCELLED => "CANCELLED",
|
|
503
|
+
UNKNOWN => "UNKNOWN",
|
|
504
|
+
INVALID_ARGUMENT => "INVALID_ARGUMENT",
|
|
505
|
+
DEADLINE_EXCEEDED => "DEADLINE_EXCEEDED",
|
|
506
|
+
NOT_FOUND => "NOT_FOUND",
|
|
507
|
+
ALREADY_EXISTS => "ALREADY_EXISTS",
|
|
508
|
+
PERMISSION_DENIED => "PERMISSION_DENIED",
|
|
509
|
+
RESOURCE_EXHAUSTED => "RESOURCE_EXHAUSTED",
|
|
510
|
+
FAILED_PRECONDITION => "FAILED_PRECONDITION",
|
|
511
|
+
ABORTED => "ABORTED",
|
|
512
|
+
OUT_OF_RANGE => "OUT_OF_RANGE",
|
|
513
|
+
UNIMPLEMENTED => "UNIMPLEMENTED",
|
|
514
|
+
INTERNAL => "INTERNAL",
|
|
515
|
+
UNAVAILABLE => "UNAVAILABLE",
|
|
516
|
+
DATA_LOSS => "DATA_LOSS",
|
|
517
|
+
UNAUTHENTICATED => "UNAUTHENTICATED"
|
|
518
518
|
}.freeze
|
|
519
519
|
end
|
|
520
520
|
end
|
|
@@ -585,7 +585,7 @@ module Protocol
|
|
|
585
585
|
@status_code = status_code
|
|
586
586
|
@details = details
|
|
587
587
|
@metadata = metadata
|
|
588
|
-
super(message || Status::
|
|
588
|
+
super(message || Status::NAMES[status_code])
|
|
589
589
|
end
|
|
590
590
|
end
|
|
591
591
|
|
data/lib/protocol/grpc/error.rb
CHANGED
data/lib/protocol/grpc/status.rb
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
module Protocol
|
|
7
7
|
module GRPC
|
|
8
|
-
# Provides gRPC status codes and their
|
|
8
|
+
# Provides gRPC status codes and their names.
|
|
9
9
|
module Status
|
|
10
10
|
OK = 0
|
|
11
11
|
CANCELLED = 1
|
|
@@ -25,25 +25,25 @@ module Protocol
|
|
|
25
25
|
DATA_LOSS = 15
|
|
26
26
|
UNAUTHENTICATED = 16
|
|
27
27
|
|
|
28
|
-
# Status code
|
|
29
|
-
|
|
28
|
+
# Status code names, as defined by the gRPC specification.
|
|
29
|
+
NAMES = {
|
|
30
30
|
OK => "OK",
|
|
31
|
-
CANCELLED => "
|
|
32
|
-
UNKNOWN => "
|
|
33
|
-
INVALID_ARGUMENT => "
|
|
34
|
-
DEADLINE_EXCEEDED => "
|
|
35
|
-
NOT_FOUND => "
|
|
36
|
-
ALREADY_EXISTS => "
|
|
37
|
-
PERMISSION_DENIED => "
|
|
38
|
-
RESOURCE_EXHAUSTED => "
|
|
39
|
-
FAILED_PRECONDITION => "
|
|
40
|
-
ABORTED => "
|
|
41
|
-
OUT_OF_RANGE => "
|
|
42
|
-
UNIMPLEMENTED => "
|
|
43
|
-
INTERNAL => "
|
|
44
|
-
UNAVAILABLE => "
|
|
45
|
-
DATA_LOSS => "
|
|
46
|
-
UNAUTHENTICATED => "
|
|
31
|
+
CANCELLED => "CANCELLED",
|
|
32
|
+
UNKNOWN => "UNKNOWN",
|
|
33
|
+
INVALID_ARGUMENT => "INVALID_ARGUMENT",
|
|
34
|
+
DEADLINE_EXCEEDED => "DEADLINE_EXCEEDED",
|
|
35
|
+
NOT_FOUND => "NOT_FOUND",
|
|
36
|
+
ALREADY_EXISTS => "ALREADY_EXISTS",
|
|
37
|
+
PERMISSION_DENIED => "PERMISSION_DENIED",
|
|
38
|
+
RESOURCE_EXHAUSTED => "RESOURCE_EXHAUSTED",
|
|
39
|
+
FAILED_PRECONDITION => "FAILED_PRECONDITION",
|
|
40
|
+
ABORTED => "ABORTED",
|
|
41
|
+
OUT_OF_RANGE => "OUT_OF_RANGE",
|
|
42
|
+
UNIMPLEMENTED => "UNIMPLEMENTED",
|
|
43
|
+
INTERNAL => "INTERNAL",
|
|
44
|
+
UNAVAILABLE => "UNAVAILABLE",
|
|
45
|
+
DATA_LOSS => "DATA_LOSS",
|
|
46
|
+
UNAUTHENTICATED => "UNAUTHENTICATED"
|
|
47
47
|
}.freeze
|
|
48
48
|
end
|
|
49
49
|
end
|
data/readme.md
CHANGED
|
@@ -28,6 +28,10 @@ Please see the [project documentation](https://socketry.github.io/protocol-grpc/
|
|
|
28
28
|
|
|
29
29
|
Please see the [project releases](https://socketry.github.io/protocol-grpc/releases/index) for all releases.
|
|
30
30
|
|
|
31
|
+
### v0.15.0
|
|
32
|
+
|
|
33
|
+
- **Breaking**: Removed `Protocol::GRPC::Status::DESCRIPTIONS`. Use `Protocol::GRPC::Status::NAMES` for canonical gRPC status names.
|
|
34
|
+
|
|
31
35
|
### v0.14.0
|
|
32
36
|
|
|
33
37
|
- **Breaking**: Removed the unused `Protocol::GRPC::Call#cancel!` and `Protocol::GRPC::Call#cancelled?` methods.
|
|
@@ -71,10 +75,6 @@ Please see the [project releases](https://socketry.github.io/protocol-grpc/relea
|
|
|
71
75
|
|
|
72
76
|
- `RPC#method` is always defined (snake case).
|
|
73
77
|
|
|
74
|
-
### v0.1.0
|
|
75
|
-
|
|
76
|
-
- Initial design.
|
|
77
|
-
|
|
78
78
|
## See Also
|
|
79
79
|
|
|
80
80
|
- [async-grpc](https://github.com/socketry/async-grpc) — Asynchronous gRPC client and server implementation using this interface.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.15.0
|
|
4
|
+
|
|
5
|
+
- **Breaking**: Removed `Protocol::GRPC::Status::DESCRIPTIONS`. Use `Protocol::GRPC::Status::NAMES` for canonical gRPC status names.
|
|
6
|
+
|
|
3
7
|
## v0.14.0
|
|
4
8
|
|
|
5
9
|
- **Breaking**: Removed the unused `Protocol::GRPC::Call#cancel!` and `Protocol::GRPC::Call#cancelled?` methods.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|