Skip to content

Commit 8abdebb

Browse files
committed
Import HTTP resumable upload sample code
1 parent 798c962 commit 8abdebb

9 files changed

+1347
-1
lines changed

.spi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
version: 1
22
builder:
33
configs:
4-
- documentation_targets: [NIOExtras, NIOHTTPCompression, NIOSOCKS, NIOHTTPTypes, NIOHTTPTypesHTTP1, NIOHTTPTypesHTTP2]
4+
- documentation_targets: [NIOExtras, NIOHTTPCompression, NIOSOCKS, NIOHTTPTypes, NIOHTTPTypesHTTP1, NIOHTTPTypesHTTP2, NIOResumableUpload]

Package.swift

+18
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,21 @@ var targets: [PackageDescription.Target] = [
151151
dependencies: [
152152
"NIOHTTPTypesHTTP2",
153153
]),
154+
.target(
155+
name: "NIOResumableUpload",
156+
dependencies: [
157+
"NIOHTTPTypes",
158+
.product(name: "HTTPTypes", package: "swift-http-types"),
159+
.product(name: "NIOCore", package: "swift-nio"),
160+
.product(name: "StructuredFieldValues", package: "swift-http-structured-headers"),
161+
.product(name: "Atomics", package: "swift-atomics"),
162+
]),
163+
.testTarget(
164+
name: "NIOResumableUploadTests",
165+
dependencies: [
166+
"NIOResumableUpload",
167+
.product(name: "NIOEmbedded", package: "swift-nio"),
168+
]),
154169
]
155170

156171
let package = Package(
@@ -162,12 +177,15 @@ let package = Package(
162177
.library(name: "NIOHTTPTypes", targets: ["NIOHTTPTypes"]),
163178
.library(name: "NIOHTTPTypesHTTP1", targets: ["NIOHTTPTypesHTTP1"]),
164179
.library(name: "NIOHTTPTypesHTTP2", targets: ["NIOHTTPTypesHTTP2"]),
180+
.library(name: "NIOResumableUpload", targets: ["NIOResumableUpload"]),
165181
],
166182
dependencies: [
167183
.package(url: "https://github.com/apple/swift-nio.git", from: "2.42.0"),
168184
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.27.0"),
169185
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
170186
.package(url: "https://github.com/apple/swift-http-types", from: "1.0.0"),
187+
.package(url: "https://github.com/apple/swift-http-structured-headers.git", from: "1.0.0"),
188+
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.2.0"),
171189
],
172190
targets: targets
173191
)

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,4 @@ On the [`nio-extras-0.1`](https://github.com/apple/swift-nio-extras/tree/nio-ext
5757
- [`HTTPToHTTP1ServerCodec`](Sources/NIOHTTPTypesHTTP1/HTTPToHTTP1Codec.swift) A `ChannelHandler` that translates shared HTTP types into HTTP/1 messages for the server side for compatibility purposes.
5858
- [`HTTP2FramePayloadToHTTPClientCodec`](Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift) A `ChannelHandler` that translates HTTP/2 concepts into shared HTTP types for the client side.
5959
- [`HTTP2FramePayloadToHTTPServerCodec`](Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift) A `ChannelHandler` that translates HTTP/2 concepts into shared HTTP types for the server side.
60+
- [`HTTPResumableUploadHandler`](Sources/NIOResumableUpload/HTTPResumableUploadHandler.swift) A `ChannelHandler` that translates HTTP resumable uploads to regular uploads.

0 commit comments

Comments
 (0)