google-cloud-redis 1.6.1 → 1.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +32 -1
- data/lib/google/cloud/redis/version.rb +1 -1
- data/lib/google/cloud/redis.rb +36 -0
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02a97cd52fc48a4eed8de294717b2d26a56600fc0e5f9e273ca286ef1ec4367d
|
4
|
+
data.tar.gz: 45b3cea0852a73e7416dee14dfe16b41f46bfa50a1847ee4c0793d82beb3bf61
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae52113b6eefabfe7b9e8c71ae6d4a443b4cb7bd1b032f615bb09914986a96a7554fb4556c39274ffe3a806cb5d355a09a6cdf49199ccaec9406f0f270660e05
|
7
|
+
data.tar.gz: 6c8d00e05e6307052ddf223525cb816fe0802edcfa524a10664e9f2b7e1ffdaa0bd483030739ff7c9eb8b0b45e8c013bd3430ec33e66138da2d2f3708fd27434
|
data/README.md
CHANGED
@@ -43,9 +43,40 @@ and includes substantial interface changes. Existing code written for earlier
|
|
43
43
|
versions of this library will likely require updates to use this version.
|
44
44
|
See the {file:MIGRATING.md MIGRATING.md} document for more information.
|
45
45
|
|
46
|
+
## Debug Logging
|
47
|
+
|
48
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
49
|
+
your application's integration with the API. When logging is activated, key
|
50
|
+
events such as requests and responses, along with data payloads and metadata
|
51
|
+
such as headers and client configuration, are logged to the standard error
|
52
|
+
stream.
|
53
|
+
|
54
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
55
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
56
|
+
customers, private keys, or other security data that could be compromising if
|
57
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
58
|
+
the principle of least access. Google also recommends that Client Library Debug
|
59
|
+
Logging be enabled only temporarily during active debugging, and not used
|
60
|
+
permanently in production.
|
61
|
+
|
62
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
63
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
64
|
+
list of client library gem names. This will select the default logging behavior,
|
65
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
66
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
67
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
68
|
+
results in logs appearing alongside your application logs in the
|
69
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
70
|
+
|
71
|
+
Debug logging also requires that the versioned clients for this service be
|
72
|
+
sufficiently recent, released after about Dec 10, 2024. If logging is not
|
73
|
+
working, try updating the versioned clients in your bundle or installed gems:
|
74
|
+
[google-cloud-redis-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1/latest),
|
75
|
+
[google-cloud-redis-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-redis-v1beta1/latest).
|
76
|
+
|
46
77
|
## Supported Ruby Versions
|
47
78
|
|
48
|
-
This library is supported on Ruby
|
79
|
+
This library is supported on Ruby 3.0+.
|
49
80
|
|
50
81
|
Google provides official support for Ruby versions that are actively supported
|
51
82
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
data/lib/google/cloud/redis.rb
CHANGED
@@ -58,6 +58,11 @@ module Google
|
|
58
58
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
59
|
# the `transport` parameter.
|
60
60
|
#
|
61
|
+
# Raises an exception if the currently installed versioned client gem for the
|
62
|
+
# given API version does not support the given transport of the CloudRedis service.
|
63
|
+
# You can determine whether the method will succeed by calling
|
64
|
+
# {Google::Cloud::Redis.cloud_redis_available?}.
|
65
|
+
#
|
61
66
|
# ## About CloudRedis
|
62
67
|
#
|
63
68
|
# Configures and manages Cloud Memorystore for Redis instances
|
@@ -93,6 +98,37 @@ module Google
|
|
93
98
|
service_module.const_get(:Client).new(&block)
|
94
99
|
end
|
95
100
|
|
101
|
+
##
|
102
|
+
# Determines whether the CloudRedis service is supported by the current client.
|
103
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Redis.cloud_redis}.
|
104
|
+
# If false, that method will raise an exception. This could happen if the given
|
105
|
+
# API version does not exist or does not support the CloudRedis service,
|
106
|
+
# or if the versioned client gem needs an update to support the CloudRedis service.
|
107
|
+
#
|
108
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
109
|
+
# Defaults to `:v1`.
|
110
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
111
|
+
# @return [boolean] Whether the service is available.
|
112
|
+
#
|
113
|
+
def self.cloud_redis_available? version: :v1, transport: :grpc
|
114
|
+
require "google/cloud/redis/#{version.to_s.downcase}"
|
115
|
+
package_name = Google::Cloud::Redis
|
116
|
+
.constants
|
117
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
118
|
+
.first
|
119
|
+
return false unless package_name
|
120
|
+
service_module = Google::Cloud::Redis.const_get package_name
|
121
|
+
return false unless service_module.const_defined? :CloudRedis
|
122
|
+
service_module = service_module.const_get :CloudRedis
|
123
|
+
if transport == :rest
|
124
|
+
return false unless service_module.const_defined? :Rest
|
125
|
+
service_module = service_module.const_get :Rest
|
126
|
+
end
|
127
|
+
service_module.const_defined? :Client
|
128
|
+
rescue ::LoadError
|
129
|
+
false
|
130
|
+
end
|
131
|
+
|
96
132
|
##
|
97
133
|
# Configure the google-cloud-redis library.
|
98
134
|
#
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-01-29 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-core
|
@@ -82,7 +81,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
82
81
|
licenses:
|
83
82
|
- Apache-2.0
|
84
83
|
metadata: {}
|
85
|
-
post_install_message:
|
86
84
|
rdoc_options: []
|
87
85
|
require_paths:
|
88
86
|
- lib
|
@@ -90,15 +88,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
90
88
|
requirements:
|
91
89
|
- - ">="
|
92
90
|
- !ruby/object:Gem::Version
|
93
|
-
version: '
|
91
|
+
version: '3.0'
|
94
92
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
95
93
|
requirements:
|
96
94
|
- - ">="
|
97
95
|
- !ruby/object:Gem::Version
|
98
96
|
version: '0'
|
99
97
|
requirements: []
|
100
|
-
rubygems_version: 3.
|
101
|
-
signing_key:
|
98
|
+
rubygems_version: 3.6.2
|
102
99
|
specification_version: 4
|
103
100
|
summary: API Client library for the Google Cloud Memorystore for Redis API
|
104
101
|
test_files: []
|