Skip to content

Commit

Permalink
Import HTTP resumable upload sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
guoye-zhang committed Oct 24, 2023
1 parent 798c962 commit 8abdebb
Show file tree
Hide file tree
Showing 9 changed files with 1,347 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .spi.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [NIOExtras, NIOHTTPCompression, NIOSOCKS, NIOHTTPTypes, NIOHTTPTypesHTTP1, NIOHTTPTypesHTTP2]
- documentation_targets: [NIOExtras, NIOHTTPCompression, NIOSOCKS, NIOHTTPTypes, NIOHTTPTypesHTTP1, NIOHTTPTypesHTTP2, NIOResumableUpload]
18 changes: 18 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,21 @@ var targets: [PackageDescription.Target] = [
dependencies: [
"NIOHTTPTypesHTTP2",
]),
.target(
name: "NIOResumableUpload",
dependencies: [
"NIOHTTPTypes",
.product(name: "HTTPTypes", package: "swift-http-types"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "StructuredFieldValues", package: "swift-http-structured-headers"),
.product(name: "Atomics", package: "swift-atomics"),
]),
.testTarget(
name: "NIOResumableUploadTests",
dependencies: [
"NIOResumableUpload",
.product(name: "NIOEmbedded", package: "swift-nio"),
]),
]

let package = Package(
Expand All @@ -162,12 +177,15 @@ let package = Package(
.library(name: "NIOHTTPTypes", targets: ["NIOHTTPTypes"]),
.library(name: "NIOHTTPTypesHTTP1", targets: ["NIOHTTPTypesHTTP1"]),
.library(name: "NIOHTTPTypesHTTP2", targets: ["NIOHTTPTypesHTTP2"]),
.library(name: "NIOResumableUpload", targets: ["NIOResumableUpload"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-nio.git", from: "2.42.0"),
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.27.0"),
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-http-types", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-http-structured-headers.git", from: "1.0.0"),
.package(url: "https://github.com/apple/swift-atomics.git", from: "1.2.0"),
],
targets: targets
)
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ On the [`nio-extras-0.1`](https://github.com/apple/swift-nio-extras/tree/nio-ext
- [`HTTPToHTTP1ServerCodec`](Sources/NIOHTTPTypesHTTP1/HTTPToHTTP1Codec.swift) A `ChannelHandler` that translates shared HTTP types into HTTP/1 messages for the server side for compatibility purposes.
- [`HTTP2FramePayloadToHTTPClientCodec`](Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift) A `ChannelHandler` that translates HTTP/2 concepts into shared HTTP types for the client side.
- [`HTTP2FramePayloadToHTTPServerCodec`](Sources/NIOHTTPTypesHTTP2/HTTP2ToHTTPCodec.swift) A `ChannelHandler` that translates HTTP/2 concepts into shared HTTP types for the server side.
- [`HTTPResumableUploadHandler`](Sources/NIOResumableUpload/HTTPResumableUploadHandler.swift) A `ChannelHandler` that translates HTTP resumable uploads to regular uploads.
Loading

0 comments on commit 8abdebb

Please sign in to comment.