protocol-grpc 0.13.0 → 0.13.1
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/lib/protocol/grpc/version.rb +1 -1
- data/lib/protocol/grpc.rb +0 -1
- data/readme.md +4 -0
- data/releases.md +4 -0
- data.tar.gz.sig +0 -0
- metadata +1 -2
- metadata.gz.sig +0 -0
- data/lib/protocol/grpc/methods.rb +0 -81
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 034feb2e3b17d2cdf00697215d48a3d62d328c37df11f437b410ac6a0878b16f
|
|
4
|
+
data.tar.gz: 3a94f6c1431029e2449383ef0f51196cc4aa7dd5e60f33d938270ffa05e877a8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 141ad27dd57585879827d433964c3e8de3895cd41347b49b909bc5d33bc92bc87f5825bfd46bc167b01c99d3d7a37cd83741b2f3e473391af2148b25d427993c
|
|
7
|
+
data.tar.gz: 8997edac6e081b1681cc8bbee2b5d4ea49de5f6af12dacd55946353a301f32d9446ab9487bf6ec27df15209303b264afa231ef5f7fbc67e7fb2bf2f03d440761
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/lib/protocol/grpc.rb
CHANGED
|
@@ -10,7 +10,6 @@ require_relative "grpc/error"
|
|
|
10
10
|
require_relative "grpc/route"
|
|
11
11
|
require_relative "grpc/header"
|
|
12
12
|
require_relative "grpc/metadata"
|
|
13
|
-
require_relative "grpc/methods"
|
|
14
13
|
require_relative "grpc/call"
|
|
15
14
|
require_relative "grpc/body/readable"
|
|
16
15
|
require_relative "grpc/body/writable"
|
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.13.1
|
|
32
|
+
|
|
33
|
+
- **Breaking**: Removed the deprecated `Protocol::GRPC::Methods` module. Use `Protocol::GRPC::Route`, `Protocol::GRPC::Metadata`, and `Protocol::GRPC::Header::Timeout` instead.
|
|
34
|
+
|
|
31
35
|
### v0.13.0
|
|
32
36
|
|
|
33
37
|
- Added `Protocol::GRPC::Route` for building and parsing gRPC request paths.
|
data/releases.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.13.1
|
|
4
|
+
|
|
5
|
+
- **Breaking**: Removed the deprecated `Protocol::GRPC::Methods` module. Use `Protocol::GRPC::Route`, `Protocol::GRPC::Metadata`, and `Protocol::GRPC::Header::Timeout` instead.
|
|
6
|
+
|
|
3
7
|
## v0.13.0
|
|
4
8
|
|
|
5
9
|
- Added `Protocol::GRPC::Route` for building and parsing gRPC request paths.
|
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.13.
|
|
4
|
+
version: 0.13.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Williams
|
|
@@ -116,7 +116,6 @@ files:
|
|
|
116
116
|
- lib/protocol/grpc/health_check.rb
|
|
117
117
|
- lib/protocol/grpc/interface.rb
|
|
118
118
|
- lib/protocol/grpc/metadata.rb
|
|
119
|
-
- lib/protocol/grpc/methods.rb
|
|
120
119
|
- lib/protocol/grpc/middleware.rb
|
|
121
120
|
- lib/protocol/grpc/route.rb
|
|
122
121
|
- lib/protocol/grpc/status.rb
|
metadata.gz.sig
CHANGED
|
Binary file
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Released under the MIT License.
|
|
4
|
-
# Copyright, 2025-2026, by Samuel Williams.
|
|
5
|
-
|
|
6
|
-
require_relative "metadata"
|
|
7
|
-
require_relative "route"
|
|
8
|
-
|
|
9
|
-
module Protocol
|
|
10
|
-
module GRPC
|
|
11
|
-
# Provides utility methods for building and parsing gRPC-compatible HTTP requests.
|
|
12
|
-
module Methods
|
|
13
|
-
# Build gRPC path from service and method.
|
|
14
|
-
# @parameter service [String] e.g., "my_service.Greeter"
|
|
15
|
-
# @parameter method [String] e.g., "SayHello"
|
|
16
|
-
# @returns [String] e.g., "/my_service.Greeter/SayHello"
|
|
17
|
-
# @deprecated Use {Route.build} instead.
|
|
18
|
-
def self.build_path(service, method)
|
|
19
|
-
Kernel.warn("`Protocol::GRPC::Methods.build_path` is deprecated; use `Protocol::GRPC::Route.build` instead.", uplevel: 1, category: :deprecated) if $VERBOSE
|
|
20
|
-
|
|
21
|
-
Route.build(service, method)
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
# Parse service and method from gRPC path.
|
|
25
|
-
# @parameter path [String] e.g., "/my_service.Greeter/SayHello"
|
|
26
|
-
# @returns [Array(String | String)] [service, method]
|
|
27
|
-
# @deprecated Use {Route.parse} instead.
|
|
28
|
-
def self.parse_path(path)
|
|
29
|
-
Kernel.warn("`Protocol::GRPC::Methods.parse_path` is deprecated; use `Protocol::GRPC::Route.parse` instead.", uplevel: 1, category: :deprecated) if $VERBOSE
|
|
30
|
-
|
|
31
|
-
Route.parse(path)
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
# Build gRPC request headers.
|
|
35
|
-
# @parameter metadata [Hash] Custom metadata key-value pairs
|
|
36
|
-
# @parameter timeout [Numeric | Nil] Optional timeout in seconds
|
|
37
|
-
# @parameter content_type [String] Content type (default: "application/grpc+proto")
|
|
38
|
-
# @returns [Protocol::HTTP::Headers]
|
|
39
|
-
# @deprecated Use {Metadata.build} instead.
|
|
40
|
-
def self.build_headers(metadata: {}, timeout: nil, content_type: "application/grpc+proto")
|
|
41
|
-
Kernel.warn("`Protocol::GRPC::Methods.build_headers` is deprecated; use `Protocol::GRPC::Metadata.build` instead.", uplevel: 1, category: :deprecated) if $VERBOSE
|
|
42
|
-
|
|
43
|
-
Metadata.build(metadata: metadata, timeout: timeout, content_type: content_type)
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
# Extract metadata from gRPC headers.
|
|
47
|
-
# @parameter headers [Protocol::HTTP::Headers]
|
|
48
|
-
# @returns [Hash] Metadata key-value pairs
|
|
49
|
-
# @deprecated Use {Metadata.extract} instead.
|
|
50
|
-
def self.extract_metadata(headers)
|
|
51
|
-
Kernel.warn("`Protocol::GRPC::Methods.extract_metadata` is deprecated; use `Protocol::GRPC::Metadata.extract` instead.", uplevel: 1, category: :deprecated) if $VERBOSE
|
|
52
|
-
|
|
53
|
-
Metadata.extract(headers)
|
|
54
|
-
end
|
|
55
|
-
|
|
56
|
-
# Format timeout for grpc-timeout header.
|
|
57
|
-
# @parameter timeout [Numeric] Timeout in seconds
|
|
58
|
-
# @returns [String] e.g., "1000m" for 1 second
|
|
59
|
-
# @deprecated Use {Protocol::GRPC::Header::Timeout.format} instead.
|
|
60
|
-
def self.format_timeout(timeout)
|
|
61
|
-
Kernel.warn("`Protocol::GRPC::Methods.format_timeout` is deprecated; use `Protocol::GRPC::Header::Timeout.format` instead.", uplevel: 1, category: :deprecated) if $VERBOSE
|
|
62
|
-
|
|
63
|
-
Header::Timeout.format(timeout)
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
# Parse grpc-timeout header value.
|
|
67
|
-
# @parameter value [String] e.g., "1000m"
|
|
68
|
-
# @returns [Numeric | Nil] Timeout in seconds, or `Nil` if value is invalid
|
|
69
|
-
# @deprecated Use {Protocol::GRPC::Header::Timeout#to_seconds} instead.
|
|
70
|
-
def self.parse_timeout(value)
|
|
71
|
-
Kernel.warn("`Protocol::GRPC::Methods.parse_timeout` is deprecated; use `Protocol::GRPC::Header::Timeout#to_seconds` instead.", uplevel: 1, category: :deprecated) if $VERBOSE
|
|
72
|
-
|
|
73
|
-
return nil unless value
|
|
74
|
-
|
|
75
|
-
Header::Timeout.parse(value).to_seconds
|
|
76
|
-
rescue ArgumentError
|
|
77
|
-
return nil
|
|
78
|
-
end
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
end
|