Skip to content

Commit 9faba85

Browse files
committed
deamon => daemon
1 parent 869ea27 commit 9faba85

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

README.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This means that it will work with Docker >= 20.10.
2121
| | HTTP || |
2222
| | HTTPS || |
2323
| | | | |
24-
| Docker deamon & System info | Ping || |
24+
| Docker daemon & System info | Ping || |
2525
| | Info || |
2626
| | Version || |
2727
| | Events || |
@@ -158,7 +158,7 @@ Enter `https://github.com/m-barthelemy/DockerSwift.git` for the URL.
158158

159159
## Usage Examples
160160

161-
### Connect to a Docker deamon
161+
### Connect to a Docker daemon
162162

163163
Local socket (defaults to `/var/run/docker.sock`):
164164
```swift
@@ -172,7 +172,7 @@ Remote daemon over HTTP:
172172
```swift
173173
import DockerSwift
174174

175-
let docker = DockerClient(deamonURL: .init(string: "http://127.0.0.1:2375")!)
175+
let docker = DockerClient(daemonURL: .init(string: "http://127.0.0.1:2375")!)
176176
defer {try! docker.syncShutdown()}
177177
```
178178

@@ -187,7 +187,7 @@ tlsConfig.additionalTrustRoots.append(.file("docker-daemon-ca.pem"))
187187
tlsConfig.certificateVerification = .noHostnameVerification
188188

189189
let docker = DockerClient(
190-
deamonURL: .init(string: "https://your.docker.daemon:2376")!,
190+
daemonURL: .init(string: "https://your.docker.daemon:2376")!,
191191
tlsConfig: tlsConfig
192192
)
193193
defer {try! docker.syncShutdown()}
@@ -447,7 +447,7 @@ defer {try! docker.syncShutdown()}
447447
<details>
448448
<summary>Push an image</summary>
449449

450-
Supposing that the Docker deamon has an image named "my-private-image:latest":
450+
Supposing that the Docker daemon has an image named "my-private-image:latest":
451451
```swift
452452
var credentials = RegistryAuth(username: "myUsername", password: "....")
453453
try await docker.registries.login(credentials: &credentials)
@@ -615,7 +615,7 @@ defer {try! docker.syncShutdown()}
615615
</details>
616616

617617
<details>
618-
<summary>Make the Docker deamon to join an existing Swarm cluster</summary>
618+
<summary>Make the Docker daemon to join an existing Swarm cluster</summary>
619619

620620
```swift
621621
// This first client points to an existing Swarm cluster manager

Sources/DockerSwift/APIs/DockerClient.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class DockerClient {
1515
])
1616
private let decoder: JSONDecoder
1717

18-
internal let deamonURL: URL
18+
internal let daemonURL: URL
1919
internal let tlsConfig: TLSConfiguration?
2020
internal let client: HTTPClient
2121
private let logger: Logger
@@ -30,15 +30,15 @@ public class DockerClient {
3030
/// - timeout: Pass custom connect and read timeouts via a `HTTPClient.Configuration.Timeout` instance
3131
/// - proxy: Proxy settings, defaults to `nil`.
3232
public init(
33-
deamonURL: URL = URL(httpURLWithSocketPath: "/var/run/docker.sock")!,
33+
daemonURL: URL = URL(httpURLWithSocketPath: "/var/run/docker.sock")!,
3434
tlsConfig: TLSConfiguration? = nil,
3535
logger: Logger = .init(label: "docker-client"),
3636
clientThreads: Int = 2,
3737
timeout: HTTPClient.Configuration.Timeout = .init(),
3838
proxy: HTTPClient.Configuration.Proxy? = nil
3939
) {
4040

41-
self.deamonURL = deamonURL
41+
self.daemonURL = daemonURL
4242
self.tlsConfig = tlsConfig
4343
let clientConfig = HTTPClient.Configuration(
4444
tlsConfiguration: tlsConfig,
@@ -88,7 +88,7 @@ public class DockerClient {
8888
}
8989
return try await client.execute(
9090
endpoint.method,
91-
daemonURL: self.deamonURL,
91+
daemonURL: self.daemonURL,
9292
urlPath: "/\(apiVersion)/\(endpoint.path)",
9393
body: endpoint.body.map {HTTPClient.Body.data( try! $0.encode())},
9494
logger: logger,
@@ -109,7 +109,7 @@ public class DockerClient {
109109
logger.debug("\(Self.self) execute PipelineEndpoint: \(endpoint.method) \(endpoint.path)")
110110
return try await client.execute(
111111
endpoint.method,
112-
daemonURL: self.deamonURL,
112+
daemonURL: self.daemonURL,
113113
urlPath: "/\(apiVersion)/\(endpoint.path)",
114114
body: endpoint.body.map {HTTPClient.Body.data( try! $0.encode())},
115115
logger: logger,
@@ -125,7 +125,7 @@ public class DockerClient {
125125
logger.debug("\(Self.self) execute StreamingEndpoint: \(endpoint.method) \(endpoint.path)")
126126
let stream = try await client.executeStream(
127127
endpoint.method,
128-
daemonURL: self.deamonURL,
128+
daemonURL: self.daemonURL,
129129
urlPath: "/\(apiVersion)/\(endpoint.path)",
130130
body: endpoint.body.map {
131131
HTTPClientRequest.Body.bytes( try! $0.encode())
@@ -144,7 +144,7 @@ public class DockerClient {
144144
logger.debug("\(Self.self) execute \(T.self): \(endpoint.path)")
145145
let stream = try await client.executeStream(
146146
endpoint.method,
147-
daemonURL: self.deamonURL,
147+
daemonURL: self.daemonURL,
148148
urlPath: "/\(apiVersion)/\(endpoint.path)",
149149
body: endpoint.body == nil ? nil : .bytes(endpoint.body!),
150150
timeout: timeout,

Sources/DockerSwift/Endpoints/Containers/ContainerAttachEndpoint.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ final class ContainerAttachEndpoint {
6262
func connect() async throws -> ContainerAttach {
6363
let config = WebSocketClient.Configuration(tlsConfiguration: self.dockerClient.tlsConfig)
6464

65-
let scheme = self.dockerClient.deamonURL.scheme
65+
let scheme = self.dockerClient.daemonURL.scheme
6666
guard scheme == "http" || scheme == "https" else {
6767
throw DockerError.unsupportedScheme("Attach only supports connecting to docker daemons via HTTP or HTTPS")
6868
}
@@ -71,9 +71,9 @@ final class ContainerAttachEndpoint {
7171
Task {
7272
try await WebSocket.connect(
7373
scheme: scheme == "https" ? "wss" : "ws",
74-
host: self.dockerClient.deamonURL.host ?? self.dockerClient.deamonURL.path,
75-
port: self.dockerClient.deamonURL.port ?? (self.dockerClient.deamonURL.scheme == "https" ? 2376 : 2375),
76-
path: "\(self.dockerClient.deamonURL.path)/\(self.dockerClient.apiVersion)/\(self.path)",
74+
host: self.dockerClient.daemonURL.host ?? self.dockerClient.daemonURL.path,
75+
port: self.dockerClient.daemonURL.port ?? (self.dockerClient.daemonURL.scheme == "https" ? 2376 : 2375),
76+
path: "\(self.dockerClient.daemonURL.path)/\(self.dockerClient.apiVersion)/\(self.path)",
7777
query: self.query,
7878
headers: [:],
7979
configuration: config,

Sources/DockerSwift/Models/System/SystemInformation.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public struct SystemInformation: Codable {
129129
/// Note: Containers do not automatically inherit this configuration.
130130
public let noProxy: String
131131

132-
/// Hostname of the host where the Docker deamon is running.
132+
/// Hostname of the host where the Docker daemon is running.
133133
public let name: String
134134

135135
public let labels: [String]

Tests/DockerSwiftTests/Utils/DockerClient+Testable.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ extension DockerClient {
1414
return DockerClient(logger: logger)
1515

1616
// Remote via simple HTTP
17-
//return DockerClient(deamonURL: .init(string: "http://127.0.0.1:2375")!, logger: logger)
17+
//return DockerClient(daemonURL: .init(string: "http://127.0.0.1:2375")!, logger: logger)
1818

1919
// Remote daemon, using HTTPS and client certs authentication
2020
/*var tlsConfig = TLSConfiguration.makeClientConfiguration()
@@ -23,7 +23,7 @@ extension DockerClient {
2323
tlsConfig.additionalTrustRoots.append(.file("ca-public.pem"))
2424
tlsConfig.certificateVerification = .noHostnameVerification
2525
return DockerClient(
26-
deamonURL: .init(string: "https://51.15.19.7:2376")!,
26+
daemonURL: .init(string: "https://51.15.19.7:2376")!,
2727
tlsConfig: tlsConfig,
2828
logger: logger
2929
)*/

0 commit comments

Comments
 (0)