google-cloud-debugger 0.33.7 → 0.34.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38da00f1a12f8f7d55fdfcff126170f3ab8e47fadfcfc809c5375cbf73389ab6
4
- data.tar.gz: f721a3c9e7c7a15942c597bbe62717f4598120b83a5630d2048449c1d18395bb
3
+ metadata.gz: 30be42396dffa8707377274047c2876df1d2d06f1f70f7e32a6a0688554e009c
4
+ data.tar.gz: b0c705f41712f35d684bff7b3fe8e04d2c5e7c7c6f8f24805f9d45904240c356
5
5
  SHA512:
6
- metadata.gz: d63b203cf35e2cc0f758c00e7076d1f4784605417ba45998636a0ed1fefd7ca54b2baeaa4cbf7829fe1eb85a5935a48d3c57801ce6e358f00074c2f73ecc3cdd
7
- data.tar.gz: d10c02f85464a0bffda4aafb8115aa403911daeafd59885b5e8f578ba38b1bb975804bfd7196fcedfe2e024848a07d1cf49c2057c53784f63e304fa706c345b4
6
+ metadata.gz: 0d858eceaf2c0c92f5cc49054664655c823aca4aa9dda6229bb26bec666ca26a4479a65b58b99fa159d0438fb3eb7a46223805953683fc78b40d0e8fefa151c0
7
+ data.tar.gz: e1b1437841d2d66b910cec11f3ea2f382d3ca5b87fd06d6866192b9a0a608165863fb9136dcb6892d65d57aaf100e6a93597e02ccd9ffbf64c31a69e80bd7dfa
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release History
2
2
 
3
+ ### 0.34.0 / 2019-08-23
4
+
5
+ #### Features
6
+
7
+ * Support overriding of service endpoint
8
+
3
9
  ### 0.33.7 / 2019-07-31
4
10
 
5
11
  * Fix max threads setting in thread pools
@@ -176,6 +176,7 @@ Google::Cloud.configure.add_config! :debugger do |config|
176
176
  config.add_field! :scope, nil, match: [String, Array]
177
177
  config.add_field! :timeout, nil, match: Integer
178
178
  config.add_field! :client_config, nil, match: Hash
179
+ config.add_field! :endpoint, nil, match: String
179
180
  config.add_field! :allow_mutating_methods, false
180
181
  config.add_field! :evaluation_time_limit, 0.05, match: Numeric
181
182
  config.add_field! :on_error, nil, match: Proc
@@ -69,6 +69,8 @@ module Google
69
69
  # @param [Integer] timeout Default timeout to use in requests. Optional.
70
70
  # @param [Hash] client_config A hash of values to override the default
71
71
  # behavior of the API client. Optional.
72
+ # @param [String] endpoint Override of the endpoint host name. Optional.
73
+ # If the param is nil, uses the default endpoint.
72
74
  # @param [String] project Project identifier for the Stackdriver Debugger
73
75
  # service.
74
76
  # @param [String, Hash] keyfile Keyfile downloaded from Google Cloud:
@@ -84,13 +86,14 @@ module Google
84
86
  #
85
87
  def self.new project_id: nil, credentials: nil, service_name: nil,
86
88
  service_version: nil, scope: nil, timeout: nil,
87
- client_config: nil, project: nil, keyfile: nil
89
+ client_config: nil, endpoint: nil, project: nil, keyfile: nil
88
90
  project_id ||= (project || default_project_id)
89
91
  service_name ||= default_service_name
90
92
  service_version ||= default_service_version
91
93
  scope ||= configure.scope
92
94
  timeout ||= configure.timeout
93
95
  client_config ||= configure.client_config
96
+ endpoint ||= configure.endpoint
94
97
 
95
98
  service_name = service_name.to_s
96
99
  raise ArgumentError, "service_name is missing" if service_name.empty?
@@ -112,8 +115,10 @@ module Google
112
115
  raise ArgumentError, "project_id is missing" if project_id.empty?
113
116
 
114
117
  Debugger::Project.new(
115
- Debugger::Service.new(project_id, credentials,
116
- timeout: timeout, client_config: client_config),
118
+ Debugger::Service.new(
119
+ project_id, credentials,
120
+ host: endpoint, timeout: timeout, client_config: client_config
121
+ ),
117
122
  service_name: service_name,
118
123
  service_version: service_version
119
124
  )
@@ -144,6 +149,8 @@ module Google
144
149
  # * `timeout` - (Integer) Default timeout to use in requests.
145
150
  # * `client_config` - (Hash) A hash of values to override the default
146
151
  # behavior of the API client.
152
+ # * `endpoint` - (String) Override of the endpoint host name, or `nil`
153
+ # to use the default endpoint.
147
154
  # * `allow_mutating_methods` - (boolean) Whether expressions and
148
155
  # conditional breakpoints can call methods that could modify program
149
156
  # state. Defaults to false.
@@ -17,6 +17,7 @@ require "google/cloud/errors"
17
17
  require "google/cloud/debugger/version"
18
18
  require "google/cloud/debugger/v2"
19
19
  require "google/gax/errors"
20
+ require "uri"
20
21
 
21
22
  module Google
22
23
  module Cloud
@@ -25,15 +26,17 @@ module Google
25
26
  # @private Represents the gRPC Debugger service, including all the API
26
27
  # methods.
27
28
  class Service
28
- attr_accessor :project, :credentials, :timeout, :client_config
29
+ attr_accessor :project, :credentials, :timeout, :client_config, :host
29
30
 
30
31
  ##
31
32
  # Creates a new Service instance.
32
- def initialize project, credentials, timeout: nil, client_config: nil
33
+ def initialize project, credentials, timeout: nil, client_config: nil,
34
+ host: nil
33
35
  @project = project
34
36
  @credentials = credentials
35
37
  @timeout = timeout
36
38
  @client_config = client_config || {}
39
+ @host = host || V2::Debugger2Client::SERVICE_ADDRESS
37
40
  end
38
41
 
39
42
  def cloud_debugger
@@ -43,6 +46,8 @@ module Google
43
46
  credentials: credentials,
44
47
  timeout: timeout,
45
48
  client_config: client_config,
49
+ service_address: service_address,
50
+ service_port: service_port,
46
51
  lib_name: "gccl",
47
52
  lib_version: Google::Cloud::Debugger::VERSION
48
53
  )
@@ -56,6 +61,8 @@ module Google
56
61
  credentials: credentials,
57
62
  timeout: timeout,
58
63
  client_config: client_config,
64
+ service_address: service_address,
65
+ service_port: service_port,
59
66
  lib_name: "gccl",
60
67
  lib_version: Google::Cloud::Debugger::VERSION
61
68
  )
@@ -92,6 +99,16 @@ module Google
92
99
 
93
100
  protected
94
101
 
102
+ def service_address
103
+ return nil if host.nil?
104
+ URI.parse("//#{host}").host
105
+ end
106
+
107
+ def service_port
108
+ return nil if host.nil?
109
+ URI.parse("//#{host}").port
110
+ end
111
+
95
112
  def default_headers
96
113
  { "google-cloud-resource-prefix" => "projects/#{@project}" }
97
114
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Debugger
19
- VERSION = "0.33.7".freeze
19
+ VERSION = "0.34.0".freeze
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-debugger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.7
4
+ version: 0.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Heng Xiong
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-01 00:00:00.000000000 Z
11
+ date: 2019-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: binding_of_caller