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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c7aa96e69acd0574147e4c3e8c16fba62e8278d01e094267d3cb3427221d8fa0
4
- data.tar.gz: 303976d191a6b5ff5e20db644ef2f29a71c5b7c346558eac2a3e5122c1197bff
3
+ metadata.gz: 2195318192e11fc3cafc54e82ccb65b4111e1e5ab9d1772ec8e4e002e6251136
4
+ data.tar.gz: 9916efb3e3966c9242cbefca5534d233f82d079d363a4ecec86c4808dd707bcf
5
5
  SHA512:
6
- metadata.gz: 1bc1343e7e2e8e21206139992f9483a1c970b21456f90bfb124d4fdd8728eedb51b921a7d93999ece219fd4b079cb9c9e0b2433750e6ee249c234124a1dfaba3
7
- data.tar.gz: cea3a080a0cea063968a40939451b2c2f044f1e4b9068b64f231272e7f2c2d953f6f7ceabef437762700cf2d36b04a90ffb94dfd43ef76f2e5b4ed55d6e4ba29
6
+ metadata.gz: 8236e53f25377fc556da30e47e36e8828a20fb7b2064d7a2b8046309f23ab26e98f3a8338842fb429f47fb510e58361ebcc1e06f24d097f4d37507159eb050b6
7
+ data.tar.gz: 2941d6b8edb774e16c6530b20cc76d330fccc05021564a32bb5bf8b4e5448c4e664001d3a59bd71cf584d4c276688b84749c6096582ff2661be6e761ca729650
checksums.yaml.gz.sig CHANGED
Binary file
@@ -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 descriptions
500
- DESCRIPTIONS = {
499
+ # Status code names
500
+ NAMES = {
501
501
  OK => "OK",
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"
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::DESCRIPTIONS[status_code])
588
+ super(message || Status::NAMES[status_code])
589
589
  end
590
590
  end
591
591
 
@@ -17,7 +17,7 @@ module Protocol
17
17
  @status_code = status_code
18
18
  @details = details
19
19
  @metadata = metadata
20
- super(message || Status::DESCRIPTIONS[status_code])
20
+ super(message || Status::NAMES[status_code])
21
21
  end
22
22
 
23
23
  # Map status code to error class
@@ -5,7 +5,7 @@
5
5
 
6
6
  module Protocol
7
7
  module GRPC
8
- # Provides gRPC status codes and their descriptions.
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 descriptions
29
- DESCRIPTIONS = {
28
+ # Status code names, as defined by the gRPC specification.
29
+ NAMES = {
30
30
  OK => "OK",
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"
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
@@ -7,7 +7,7 @@
7
7
  module Protocol
8
8
  # @namespace
9
9
  module GRPC
10
- VERSION = "0.14.0"
10
+ VERSION = "0.15.0"
11
11
  end
12
12
  end
13
13
 
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-grpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
metadata.gz.sig CHANGED
Binary file