stream

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: Apache-2.0 Imports: 10 Imported by: 23

Documentation

Overview

Package stream models a CoreOS "stream", which is a description of the recommended set of binary images for CoreOS. Use this API to find cloud images, bare metal disk images, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arch

type Arch struct {
	Artifacts map[string]PlatformArtifacts `json:"artifacts"`
	Images    Images                       `json:"images,omitempty"`
	// RHELCoreOSExtensions is data specific to Red Hat Enterprise Linux CoreOS
	RHELCoreOSExtensions *rhcos.Extensions `json:"rhel-coreos-extensions,omitempty"`
}

Arch contains release details for a particular hardware architecture

type Artifact

type Artifact struct {
	Location           string `json:"location"`
	Signature          string `json:"signature,omitempty"`
	Sha256             string `json:"sha256"`
	UncompressedSha256 string `json:"uncompressed-sha256,omitempty"`
}

Artifact represents one image file, plus its metadata

func (*Artifact) Download

func (a *Artifact) Download(destdir string) (string, error)

/ Download fetches the specified artifact and saves it to the target / directory. The full file path will be returned as a string. / If the target file path exists, it will be overwritten. / If the download fails, the temporary file will be deleted.

func (*Artifact) Fetch

func (a *Artifact) Fetch(w io.Writer) error

Fetch an artifact, validating its checksum. If applicable, the artifact will not be decompressed. Does not validate GPG signature.

func (*Artifact) Name

func (a *Artifact) Name() (string, error)

/ Name returns the "basename" of the artifact, i.e. the contents / after the last `/`. This can be useful when downloading to a file.

type AwsImage

type AwsImage = ReplicatedImage

AwsImage is a typedef for backwards compatibility.

type AwsRegionImage

type AwsRegionImage = SingleImage

AwsRegionImage is a typedef for backwards compatibility.

type GcpImage

type GcpImage struct {
	Release string `json:"release"`
	Project string `json:"project"`
	Family  string `json:"family,omitempty"`
	Name    string `json:"name"`
}

GcpImage represents a GCP cloud image

type ImageFormat

type ImageFormat struct {
	Disk      *Artifact `json:"disk,omitempty"`
	Kernel    *Artifact `json:"kernel,omitempty"`
	Initramfs *Artifact `json:"initramfs,omitempty"`
	Rootfs    *Artifact `json:"rootfs,omitempty"`
}

ImageFormat contains all artifacts for a single OS image

type Images

type Images struct {
	Aliyun   *ReplicatedImage  `json:"aliyun,omitempty"`
	Aws      *AwsImage         `json:"aws,omitempty"`
	Gcp      *GcpImage         `json:"gcp,omitempty"`
	Ibmcloud *ReplicatedObject `json:"ibmcloud,omitempty"`
	KubeVirt *SingleImage      `json:"kubevirt,omitempty"`
	PowerVS  *ReplicatedObject `json:"powervs,omitempty"`
}

Images contains images available in cloud providers

type Metadata

type Metadata struct {
	LastModified string `json:"last-modified"`
	Generator    string `json:"generator,omitempty"`
}

Metadata for a release or stream

type PlatformArtifacts

type PlatformArtifacts struct {
	Release string                 `json:"release"`
	Formats map[string]ImageFormat `json:"formats"`
}

PlatformArtifacts contains images for a platform

type RegionImage added in v0.1.2

type RegionImage = SingleImage

RegionImage is a typedef for backwards compatibility.

type RegionObject added in v0.1.5

type RegionObject = SingleObject

RegionObject is a typedef for backwards compatibility.

type ReplicatedImage added in v0.1.2

type ReplicatedImage struct {
	Regions map[string]SingleImage `json:"regions,omitempty"`
}

ReplicatedImage represents an image in all regions of an AWS-like cloud

type ReplicatedObject added in v0.1.5

type ReplicatedObject struct {
	Regions map[string]SingleObject `json:"regions,omitempty"`
}

ReplicatedObject represents an object in all regions of an IBMCloud-like cloud

type SingleImage added in v0.2.0

type SingleImage struct {
	Release string `json:"release"`
	Image   string `json:"image"`
}

SingleImage represents a globally-accessible image or an image in a single region of an AWS-like cloud

type SingleObject added in v0.2.0

type SingleObject struct {
	Release string `json:"release"`
	Object  string `json:"object"`
	Bucket  string `json:"bucket"`
	Url     string `json:"url"`
}

SingleObject represents a globally-accessible cloud storage object, or an object in a single region of an IBMCloud-like cloud

type Stream

type Stream struct {
	Stream        string          `json:"stream"`
	Metadata      Metadata        `json:"metadata"`
	Architectures map[string]Arch `json:"architectures"`
}

Stream contains artifacts available in a stream

func (*Stream) FormatPrefix

func (st *Stream) FormatPrefix(archname string) string

FormatPrefix describes a stream+architecture combination, intended for prepending to error messages

func (*Stream) GetAMI

func (st *Stream) GetAMI(archname, region string) (string, error)

GetAMI returns the AWS machine image for a particular architecture and region.

func (*Stream) GetAliyunImage added in v0.1.2

func (st *Stream) GetAliyunImage(archname, region string) (string, error)

GetAliyunImage returns the Aliyun image for a particular architecture and region.

func (*Stream) GetAliyunRegionImage added in v0.1.2

func (st *Stream) GetAliyunRegionImage(archname, region string) (*SingleImage, error)

GetAliyunRegionImage returns the release data (Image ID and release ID) for a particular architecture and region.

func (*Stream) GetArchitecture

func (st *Stream) GetArchitecture(archname string) (*Arch, error)

GetArchitecture loads the architecture-specific builds from a stream, with a useful descriptive error message if the architecture is not found.

func (*Stream) GetAwsRegionImage

func (st *Stream) GetAwsRegionImage(archname, region string) (*SingleImage, error)

GetAwsRegionImage returns the release data (AMI and release ID) for a particular architecture and region.

func (*Stream) QueryDisk

func (st *Stream) QueryDisk(architectureName, artifactName, formatName string) (*Artifact, error)

QueryDisk finds the singleton disk artifact for a given format and architecture.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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