spec

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArchEmulation

type ArchEmulation struct {
	Rosetta2 bool `yaml:"rosetta2,omitempty"` // If true, use amd64 as ARCH instead of arm64 if Rosetta2 is available
}

ArchEmulation controls options of arch emulation.

type AssetConfig

type AssetConfig struct {
	Template         string            `yaml:"template"` // Filename template
	DefaultExtension string            `yaml:"default_extension,omitempty"`
	Binaries         []Binary          `yaml:"binaries,omitempty"` // binary name and path
	Rules            []AssetRule       `yaml:"rules,omitempty"`
	NamingConvention *NamingConvention `yaml:"naming_convention,omitempty"`
	ArchEmulation    *ArchEmulation    `yaml:"arch_emulation,omitempty"`
}

AssetConfig describes how to construct download URLs and names.

type AssetRule

type AssetRule struct {
	When     PlatformCondition `yaml:"when"`
	Template string            `yaml:"template,omitempty"` // Optional override template
	OS       string            `yaml:"os,omitempty"`       // Optional override OS
	Arch     string            `yaml:"arch,omitempty"`     // Optional override ARCH
	Ext      string            `yaml:"ext,omitempty"`      // Optional override extension
	Binaries []Binary          `yaml:"binaries,omitempty"` // Optional override binary name and path
}

AssetRule defines overrides for specific platforms.

type AttestationConfig

type AttestationConfig struct {
	Enabled     *bool  `yaml:"enabled,omitempty"`      // Default: false
	Require     *bool  `yaml:"require,omitempty"`      // Default: false
	VerifyFlags string `yaml:"verify_flags,omitempty"` // Additional flags for 'gh attestation verify'
}

AttestationConfig defines settings for attestation verification.

type Binary

type Binary struct {
	Name string `yaml:"name"`
	Path string `yaml:"path"`
}

Binary defines overrides for specific binary namd and path to binary from extracted directory

type ChecksumConfig

type ChecksumConfig struct {
	Algorithm         string                        `yaml:"algorithm,omitempty"`          // Default: "sha256"
	Template          string                        `yaml:"template,omitempty"`           // Checksum filename template
	EmbeddedChecksums map[string][]EmbeddedChecksum `yaml:"embedded_checksums,omitempty"` // Keyed by version string
}

ChecksumConfig defines how to verify checksums.

type EmbeddedChecksum

type EmbeddedChecksum struct {
	Filename string `yaml:"filename"` // Asset filename
	Hash     string `yaml:"hash"`     // Checksum hash
}

EmbeddedChecksum holds pre-verified checksum information.

type InstallSpec

type InstallSpec struct {
	Schema             string             `yaml:"schema,omitempty"`          // Default: "v1"
	Name               string             `yaml:"name,omitempty"`            // Optiona. Binary name
	Repo               string             `yaml:"repo"`                      // GitHub owner/repo (e.g., "owner/repo")
	DefaultVersion     string             `yaml:"default_version,omitempty"` // Default: "latest"
	DefaultBinDir      string             `yaml:"default_bin_dir,omitempty"` // Default: "${BINSTALLER_BIN} or ${HOME}/.local/bin"
	Asset              AssetConfig        `yaml:"asset"`
	Checksums          *ChecksumConfig    `yaml:"checksums,omitempty"`
	Attestation        *AttestationConfig `yaml:"attestation,omitempty"`
	Unpack             *UnpackConfig      `yaml:"unpack,omitempty"`
	SupportedPlatforms []Platform         `yaml:"supported_platforms,omitempty"`
}

InstallSpec defines the v1 configuration schema for binstaller.

func (*InstallSpec) SetDefaults

func (s *InstallSpec) SetDefaults()

Default values for pointers

type NamingConvention

type NamingConvention struct {
	OS   string `yaml:"os,omitempty"`   // "lowercase" | "titlecase", Default: "lowercase"
	Arch string `yaml:"arch,omitempty"` // "lowercase", Default: "lowercase"
}

NamingConvention controls the casing of placeholders.

type Platform

type Platform struct {
	OS   string `yaml:"os"`
	Arch string `yaml:"arch"`
}

Platform defines a supported OS/Arch combination.

type PlatformCondition

type PlatformCondition struct {
	OS   string `yaml:"os,omitempty"`
	Arch string `yaml:"arch,omitempty"`
}

PlatformCondition specifies conditions for an AssetRule.

type UnpackConfig

type UnpackConfig struct {
	StripComponents *int `yaml:"strip_components,omitempty"` // Default: 0
}

UnpackConfig controls how archives are extracted.

Jump to

Keyboard shortcuts

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