Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import Crypto
import Foundation

extension ImageStore {
internal struct ExportOperation {
public struct ExportOperation: Sendable {
let name: String
let tag: String
let contentStore: ContentStore
let client: ContentClient
let progress: ProgressHandler?

init(name: String, tag: String, contentStore: ContentStore, client: ContentClient, progress: ProgressHandler? = nil) {
public init(name: String, tag: String, contentStore: ContentStore, client: ContentClient, progress: ProgressHandler? = nil) {
self.contentStore = contentStore
self.client = client
self.progress = progress
Expand All @@ -40,7 +40,7 @@ extension ImageStore {
}

@discardableResult
internal func export(index: Descriptor, platforms: (Platform) -> Bool) async throws -> Descriptor {
public func export(index: Descriptor, platforms: (Platform) -> Bool) async throws -> Descriptor {
var pushQueue: [[Descriptor]] = []
var current: [Descriptor] = [index]
while !current.isEmpty {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import ContainerizationOCI
import Foundation

extension ImageStore {
internal struct ImportOperation {
public struct ImportOperation: Sendable {
static let decoder = JSONDecoder()

let client: ContentClient
Expand All @@ -31,7 +31,7 @@ extension ImageStore {
let progress: ProgressHandler?
let name: String

init(name: String, contentStore: ContentStore, client: ContentClient, ingestDir: URL, progress: ProgressHandler? = nil) {
public init(name: String, contentStore: ContentStore, client: ContentClient, ingestDir: URL, progress: ProgressHandler? = nil) {
self.client = client
self.ingestDir = ingestDir
self.contentStore = contentStore
Expand All @@ -40,7 +40,7 @@ extension ImageStore {
}

/// 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.
internal func `import`(root: Descriptor, matcher: (ContainerizationOCI.Platform) -> Bool) async throws -> Descriptor {
public func `import`(root: Descriptor, matcher: (ContainerizationOCI.Platform) -> Bool) async throws -> Descriptor {
var toProcess = [root]
while !toProcess.isEmpty {
// Count the total number of blobs and their size
Expand Down Expand Up @@ -123,14 +123,14 @@ extension ImageStore {
for _ in 0..<8 {
if let desc = iterator.next() {
group.addTask {
try await fetch(desc)
try await self.fetch(desc)
}
}
}
for try await _ in group {
if let desc = iterator.next() {
group.addTask {
try await fetch(desc)
try await self.fetch(desc)
}
}
}
Expand Down