krz/hutch

an ios client for sourcehut

clone: git clone https://gitbay.org/krz/hutch.git

v2.3.0: Hutch/Models/ArtifactInfo.swift · raw

 1import Foundation
 2
 3/// An artifact with its parent reference name, used in the artifacts tab.
 4struct ArtifactInfo: Codable, Sendable, Identifiable {
 5    let id: Int
 6    let filename: String
 7    let checksum: String
 8    let size: Int
 9    let url: URL
10}
11
12struct ArtifactPage: Codable, Sendable {
13    let results: [ArtifactInfo]
14    let cursor: String?
15}
16
17/// A reference (tag) that has associated artifacts.
18struct ReferenceWithArtifacts: Codable, Sendable, Identifiable {
19    var id: String { name }
20    let name: String
21    let artifacts: [ArtifactInfo]
22}