Skip to content

Commit 753aa08

Browse files
make Import and Export public types (#284)
Signed-off-by: crosbymichael <[email protected]>
1 parent 1b1cfdb commit 753aa08

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sources/Containerization/Image/ImageStore/ImageStore+Export.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ import Crypto
2424
import Foundation
2525

2626
extension ImageStore {
27-
internal struct ExportOperation {
27+
public struct ExportOperation: Sendable {
2828
let name: String
2929
let tag: String
3030
let contentStore: ContentStore
3131
let client: ContentClient
3232
let progress: ProgressHandler?
3333

34-
init(name: String, tag: String, contentStore: ContentStore, client: ContentClient, progress: ProgressHandler? = nil) {
34+
public init(name: String, tag: String, contentStore: ContentStore, client: ContentClient, progress: ProgressHandler? = nil) {
3535
self.contentStore = contentStore
3636
self.client = client
3737
self.progress = progress
@@ -40,7 +40,7 @@ extension ImageStore {
4040
}
4141

4242
@discardableResult
43-
internal func export(index: Descriptor, platforms: (Platform) -> Bool) async throws -> Descriptor {
43+
public func export(index: Descriptor, platforms: (Platform) -> Bool) async throws -> Descriptor {
4444
var pushQueue: [[Descriptor]] = []
4545
var current: [Descriptor] = [index]
4646
while !current.isEmpty {

Sources/Containerization/Image/ImageStore/ImageStore+Import.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import ContainerizationOCI
2222
import Foundation
2323

2424
extension ImageStore {
25-
internal struct ImportOperation {
25+
public struct ImportOperation: Sendable {
2626
static let decoder = JSONDecoder()
2727

2828
let client: ContentClient
@@ -31,7 +31,7 @@ extension ImageStore {
3131
let progress: ProgressHandler?
3232
let name: String
3333

34-
init(name: String, contentStore: ContentStore, client: ContentClient, ingestDir: URL, progress: ProgressHandler? = nil) {
34+
public init(name: String, contentStore: ContentStore, client: ContentClient, ingestDir: URL, progress: ProgressHandler? = nil) {
3535
self.client = client
3636
self.ingestDir = ingestDir
3737
self.contentStore = contentStore
@@ -40,7 +40,7 @@ extension ImageStore {
4040
}
4141

4242
/// Pull the required image layers for the provided descriptor and platform(s) into the given directory using the provided client. Returns a descriptor to the Index manifest.
43-
internal func `import`(root: Descriptor, matcher: (ContainerizationOCI.Platform) -> Bool) async throws -> Descriptor {
43+
public func `import`(root: Descriptor, matcher: (ContainerizationOCI.Platform) -> Bool) async throws -> Descriptor {
4444
var toProcess = [root]
4545
while !toProcess.isEmpty {
4646
// Count the total number of blobs and their size
@@ -123,14 +123,14 @@ extension ImageStore {
123123
for _ in 0..<8 {
124124
if let desc = iterator.next() {
125125
group.addTask {
126-
try await fetch(desc)
126+
try await self.fetch(desc)
127127
}
128128
}
129129
}
130130
for try await _ in group {
131131
if let desc = iterator.next() {
132132
group.addTask {
133-
try await fetch(desc)
133+
try await self.fetch(desc)
134134
}
135135
}
136136
}

0 commit comments

Comments
 (0)