api

package
v0.28.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package api defines types shared across cargoship's API groups.

Package api holds core logic shared by the API resource packages.

Index

Constants

View Source
const BuildTimestampFormat = time.RFC1123Z

BuildTimestampFormat is the timestamp layout used in log output.

Variables

View Source
var ErrUnknownArch = fmt.Errorf("invalid platform operating system architecture")

ErrUnknownArch is returned for a CPU architecture cargoship does not support.

Functions

func FormatArches

func FormatArches(arches Arches) string

FormatArches renders architectures as a comma separated list, for error messages and logs.

Types

type Arch

type Arch string

Arch names a CPU architecture a package can target.

const (
	// ArchAMD64 is the x86-64, 64-bit AMD, architecture.
	ArchAMD64 Arch = "amd64"
	// ArchARM64 is the 64-bit ARM architecture.
	ArchARM64 Arch = "arm64"
	// ArchRISCV is the 64-bit RISC-V architecture.
	ArchRISCV Arch = "riscv64"
)

These are the CPU architectures cargoship supports targeting.

func ParseArch

func ParseArch(s string) (Arch, error)

ParseArch converts a raw architecture string into an Arch, rejecting anything cargoship does not support. Use it at the boundaries where an architecture arrives as free text, such as a command line flag or the output of uname on a remote host.

func (Arch) JSONSchemaExtend

func (Arch) JSONSchemaExtend(s *jsonschema.Schema)

JSONSchemaExtend lists the supported architectures as the enum for a single architecture, so the schema and Validate stay in step with the arches list.

func (Arch) Validate

func (a Arch) Validate() error

Validate reports whether the architecture is one cargoship supports.

type Arches

type Arches []Arch

Arches is a list of CPU architectures.

func (Arches) JSONSchemaExtend

func (Arches) JSONSchemaExtend(s *jsonschema.Schema)

JSONSchemaExtend applies the supported architecture enum to each item in the list and requires the entries to be unique.

Directories

Path Synopsis
zarf.dev
v1alpha1
Package v1alpha1 defines file types shared by the cluster and distro APIs.
Package v1alpha1 defines file types shared by the cluster and distro APIs.
v1alpha1/cluster
Package cluster defines the API types for a cluster configuration.
Package cluster defines the API types for a cluster configuration.
v1alpha1/distro
Package distro defines the API types for a distro package.
Package distro defines the API types for a distro package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL