image

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Overview

Package image validates and models the V1 split Incus virtual-machine input.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Architecture

type Architecture string

Architecture is a supported Incus and Simple Streams architecture identity.

const (
	// ArchitectureAMD64 is the 64-bit x86 architecture.
	ArchitectureAMD64 Architecture = "amd64"
	// ArchitectureARM64 is the 64-bit Arm architecture.
	ArchitectureARM64 Architecture = "arm64"
)

func (Architecture) String

func (architecture Architecture) String() string

String returns the Simple Streams architecture value.

type Artifact

type Artifact struct {
	// contains filtered or unexported fields
}

Artifact is one validated, reopenable local input and its content identities.

func (Artifact) CRC64NVME

func (artifact Artifact) CRC64NVME() object.CRC64NVME

CRC64NVME returns the full-object S3 checksum.

func (Artifact) Kind

func (artifact Artifact) Kind() ArtifactKind

Kind returns the closed artifact class.

func (Artifact) Open

func (artifact Artifact) Open() (*os.File, error)

Open returns a fresh reader for the validated local path.

func (Artifact) SHA256

func (artifact Artifact) SHA256() object.SHA256Digest

SHA256 returns the artifact content identity.

func (Artifact) Size

func (artifact Artifact) Size() object.ByteSize

Size returns the validated local byte size.

type ArtifactKind

type ArtifactKind string

ArtifactKind is a closed V1 artifact class.

const (
	// ArtifactMetadata is the Incus metadata tarball.
	ArtifactMetadata ArtifactKind = "incus.tar.xz"
	// ArtifactDisk is the QCOW2 virtual-machine disk.
	ArtifactDisk ArtifactKind = "disk-kvm.img"
)

func (ArtifactKind) String

func (kind ArtifactKind) String() string

String returns the protocol file type for kind.

type OperatingSystem

type OperatingSystem string

OperatingSystem is the non-empty operating-system catalog identity.

func (OperatingSystem) String

func (name OperatingSystem) String() string

String returns the catalog operating-system value.

type Release

type Release string

Release is the non-empty operating-system release identity.

func (Release) String

func (release Release) String() string

String returns the catalog release value.

type VMImage

type VMImage struct {
	// contains filtered or unexported fields
}

VMImage structurally contains exactly the two artifacts supported by V1.

func Inspect

func Inspect(metadataPath string, diskPath string) (VMImage, error)

Inspect validates both input files and calculates their streaming identities.

func (VMImage) Architecture

func (image VMImage) Architecture() Architecture

Architecture returns the normalized Simple Streams architecture.

func (VMImage) Created

func (image VMImage) Created() time.Time

Created returns the UTC image creation time.

func (VMImage) Disk

func (image VMImage) Disk() Artifact

Disk returns the validated QCOW2 disk artifact.

func (VMImage) Fingerprint

func (image VMImage) Fingerprint() (object.SHA256Digest, error)

Fingerprint calculates the Incus metadata-first combined SHA-256 identity.

func (VMImage) Metadata

func (image VMImage) Metadata() Artifact

Metadata returns the validated Incus metadata artifact.

func (VMImage) OperatingSystem

func (image VMImage) OperatingSystem() OperatingSystem

OperatingSystem returns the catalog operating-system identity.

func (VMImage) Release

func (image VMImage) Release() Release

Release returns the catalog release identity.

func (VMImage) Variant

func (image VMImage) Variant() Variant

Variant returns the catalog variant identity.

type Variant

type Variant string

Variant is the non-empty image variant identity.

func (Variant) String

func (variant Variant) String() string

String returns the catalog variant value.

Jump to

Keyboard shortcuts

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