hanzo_client/models/binary_spec.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct BinarySpec {
16 /// 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.
17 #[serde(rename = "image", skip_serializing_if = "Option::is_none")]
18 pub image: Option<String>,
19 /// Ldflags are the Go linker flags, `-s -w` when the recipe names none, on one line. Go lane only.
20 #[serde(rename = "ldflags", skip_serializing_if = "Option::is_none")]
21 pub ldflags: Option<String>,
22 /// 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.
23 #[serde(rename = "main", skip_serializing_if = "Option::is_none")]
24 pub main: Option<String>,
25 /// 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.
26 #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
27 pub name: Option<String>,
28 /// 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.
29 #[serde(rename = "out", skip_serializing_if = "Option::is_none")]
30 pub out: Option<String>,
31 /// 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.
32 #[serde(rename = "platforms", skip_serializing_if = "Option::is_none")]
33 pub platforms: Option<Vec<String>>,
34 /// 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`.
35 #[serde(rename = "run", skip_serializing_if = "Option::is_none")]
36 pub run: Option<String>,
37}
38
39impl BinarySpec {
40 pub fn new() -> BinarySpec {
41 BinarySpec {
42 image: None,
43 ldflags: None,
44 main: None,
45 name: None,
46 out: None,
47 platforms: None,
48 run: None,
49 }
50 }
51}
52