Skip to content

Commit 2eeacd9

Browse files
committed
ContainerRegistry: Rename other RegistryClient extensions consistently
1 parent 429235b commit 2eeacd9

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

Sources/ContainerRegistry/CheckAPI.swift renamed to Sources/ContainerRegistry/RegistryClient+CheckAPI.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import Foundation
15+
import struct Foundation.URL
1616

17-
public extension RegistryClient {
17+
extension RegistryClient {
1818
/// Checks whether the registry supports v2 of the distribution specification.
1919
/// - Returns: an `true` if the registry supports the distribution specification.
2020
/// - Throws: if the registry does not support the distribution specification.
21-
static func checkAPI(client: HTTPClient, registryURL: URL) async throws -> AuthChallenge {
21+
public static func checkAPI(client: HTTPClient, registryURL: URL) async throws -> AuthChallenge {
2222
// See https://github.com/opencontainers/distribution-spec/blob/main/spec.md#determining-support
2323

2424
// The registry indicates that it supports the v2 protocol by returning a 200 OK response.

Sources/ContainerRegistry/Tags.swift renamed to Sources/ContainerRegistry/RegistryClient+Tags.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,14 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
public extension RegistryClient {
16-
func getTags(repository: ImageReference.Repository) async throws -> Tags {
15+
extension RegistryClient {
16+
/// Fetches all tags defined on a particular repository.
17+
///
18+
/// - Parameters:
19+
/// - repository: Name of the repository to list.
20+
/// - Returns: a list of tags.
21+
/// - Throws: If the tag request fails or the response cannot be decoded.
22+
public func getTags(repository: ImageReference.Repository) async throws -> Tags {
1723
// See https://github.com/opencontainers/distribution-spec/blob/main/spec.md#listing-tags
1824
let (data, _) = try await executeRequestThrowing(
1925
.get(repository, path: "tags/list"),

0 commit comments

Comments
 (0)