mirror of
https://github.com/hanzoai/swift-sdk.git
synced 2026-10-30 18:20:19 +00:00
The forge tree held the package scaffolding and none of the generated sources — 2,435 files of APIs, Models and Infrastructure, including BaseAPI, were simply absent, so anything depending on this copy had a package that compiled to nothing usable. Generated from the current API document rather than reconciled with the other copy: a client is a function of the spec, so regenerating answers "which history wins" without anyone having to choose. .spec-lock records which document, so the next reader can tell.
61 lines
3.1 KiB
Swift
61 lines
3.1 KiB
Swift
//
|
|
// BinarySpec.swift
|
|
//
|
|
// Generated by openapi-generator
|
|
// https://openapi-generator.tech
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct BinarySpec: Sendable, Codable, ParameterConvertible, Hashable {
|
|
|
|
/** Image is the toolchain image the recipe runs in, a Go bookworm image by default. It is the one field the GitHub lane ignores: there the runner IS the toolchain, and a cluster has to be told what a runner already is. */
|
|
public var image: String?
|
|
/** Ldflags are the Go linker flags, `-s -w` when the recipe names none, on one line. Go lane only. */
|
|
public var ldflags: String?
|
|
/** Main is the Go package to build, repo-relative (`.` or `./cmd/x`), and it selects the GO LANE. Defaults to `.` when neither lane is named; declaring it together with `run` is refused. */
|
|
public var main: String?
|
|
/** Name is the artifact's base name: the prefix of every file published for this entry, and the name a host later asks for. It must match `^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$`, which is what makes it safe as both a filename and a URL path segment. */
|
|
public var name: String?
|
|
/** Out is the glob of files `run` produced, relative to the repo root; matching nothing FAILS the build rather than publishing an empty entry. It expands unquoted, so it is bounded to path and glob characters. The Go lane names its own files and ignores this. */
|
|
public var out: String?
|
|
/** Platforms are the `<os>/<arch>` pairs the Go lane cross-compiles, [linux/amd64] by default. Each one publishes as `<name>-<os>-<arch>`, which is the shape a host resolves a binary BY — so the list is what a caller can ask for later. */
|
|
public var platforms: [String]?
|
|
/** Run is any other toolchain's build command, run by `sh -c` in this entry's image, and it selects the OTHER LANE. Arbitrary shell is the point — it is the same trust as a Dockerfile RUN — which is why it executes with no object-store credential and no service-account token. It requires `out`. */
|
|
public var run: String?
|
|
|
|
public init(image: String? = nil, ldflags: String? = nil, main: String? = nil, name: String? = nil, out: String? = nil, platforms: [String]? = nil, run: String? = nil) {
|
|
self.image = image
|
|
self.ldflags = ldflags
|
|
self.main = main
|
|
self.name = name
|
|
self.out = out
|
|
self.platforms = platforms
|
|
self.run = run
|
|
}
|
|
|
|
public enum CodingKeys: String, CodingKey, CaseIterable {
|
|
case image
|
|
case ldflags
|
|
case main
|
|
case name
|
|
case out
|
|
case platforms
|
|
case run
|
|
}
|
|
|
|
// Encodable protocol methods
|
|
|
|
public func encode(to encoder: Encoder) throws {
|
|
var container = encoder.container(keyedBy: CodingKeys.self)
|
|
try container.encodeIfPresent(image, forKey: .image)
|
|
try container.encodeIfPresent(ldflags, forKey: .ldflags)
|
|
try container.encodeIfPresent(main, forKey: .main)
|
|
try container.encodeIfPresent(name, forKey: .name)
|
|
try container.encodeIfPresent(out, forKey: .out)
|
|
try container.encodeIfPresent(platforms, forKey: .platforms)
|
|
try container.encodeIfPresent(run, forKey: .run)
|
|
}
|
|
}
|
|
|