You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ This will install all the required dependencies.
14
14
15
15
## Modifying/Adding code
16
16
17
-
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/docker_engine/helpers/` and `examples/` directory.
17
+
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may result in merge conflicts between manual patches and changes from the generator. The generator will never modify the contents of `lib/docker_engine_api/helpers/` and `examples/` directory.
18
18
19
19
## Adding and running examples
20
20
@@ -24,7 +24,7 @@ All files in the `examples/` directory are not modified by the generator and can
24
24
#!/usr/bin/env ruby
25
25
# frozen_string_literal: true
26
26
27
-
require_relative"../lib/docker_engine"
27
+
require_relative"../lib/docker_engine_api"
28
28
29
29
# ...
30
30
```
@@ -43,7 +43,7 @@ If you’d like to use the repository from source, you can either install from g
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `DockerEngine::Errors::APIError` will be thrown:
40
+
When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `DockerEngineAPI::Errors::APIError` will be thrown:
41
41
42
42
```ruby
43
43
begin
44
44
container = docker.containers.list
45
-
rescueDockerEngine::Errors::APIConnectionError => e
45
+
rescueDockerEngineAPI::Errors::APIConnectionError => e
46
46
puts("The server could not be reached")
47
47
puts(e.cause) # an underlying Exception, likely raised within `net/http`
48
-
rescueDockerEngine::Errors::RateLimitError => e
48
+
rescueDockerEngineAPI::Errors::RateLimitError => e
49
49
puts("A 429 status code was received; we should back off a bit.")
50
-
rescueDockerEngine::Errors::APIStatusError => e
50
+
rescueDockerEngineAPI::Errors::APIStatusError => e
51
51
puts("Another non-200-range status code was received")
52
52
puts(e.status)
53
53
end
@@ -79,7 +79,7 @@ You can use the `max_retries` option to configure or disable this:
79
79
80
80
```ruby
81
81
# Configure the default for all requests:
82
-
docker =DockerEngine::Client.new(
82
+
docker =DockerEngineAPI::Client.new(
83
83
max_retries:0# default is 2
84
84
)
85
85
@@ -93,23 +93,23 @@ By default, requests will time out after 60 seconds. You can use the timeout opt
On timeout, `DockerEngine::Errors::APITimeoutError` is raised.
104
+
On timeout, `DockerEngineAPI::Errors::APITimeoutError` is raised.
105
105
106
106
Note that requests that time out are retried by default.
107
107
108
108
## Advanced concepts
109
109
110
110
### BaseModel
111
111
112
-
All parameter and response objects inherit from `DockerEngine::Internal::Type::BaseModel`, which provides several conveniences, including:
112
+
All parameter and response objects inherit from `DockerEngineAPI::Internal::Type::BaseModel`, which provides several conveniences, including:
113
113
114
114
1. All fields, including unknown ones, are accessible with `obj[:prop]` syntax, and can be destructured with `obj => {prop: prop}` or pattern-matching syntax.
115
115
@@ -160,9 +160,9 @@ response = client.request(
160
160
161
161
### Concurrency & connection pooling
162
162
163
-
The `DockerEngine::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.
163
+
The `DockerEngineAPI::Client` instances are threadsafe, but are only are fork-safe when there are no in-flight HTTP requests.
164
164
165
-
Each instance of `DockerEngine::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
165
+
Each instance of `DockerEngineAPI::Client` has its own HTTP connection pool with a default size of 99. As such, we recommend instantiating the client once per application in most settings.
166
166
167
167
When all available connections from the pool are checked out, requests wait for a new connection to become available, with queue time counting towards the request timeout.
0 commit comments