cloudimg

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package cloudimg streams OCI-packaged cloud images out of an Epoch registry.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stream

func Stream(ctx context.Context, raw []byte, blobs BlobReader, w io.Writer) error

Stream concatenates disk layers sorted by title annotation.

func StreamParsed

func StreamParsed(ctx context.Context, m *manifest.OCIManifest, blobs BlobReader, w io.Writer) error

StreamParsed streams disk layers from an already-parsed manifest.

Types

type BlobReader

type BlobReader interface {
	ReadBlob(ctx context.Context, digest string) (io.ReadCloser, error)
}

BlobReader abstracts reading a blob by digest.

type CocoonRunner

type CocoonRunner interface {
	ImageImport(ctx context.Context, name string) (io.WriteCloser, func() error, error)
}

CocoonRunner abstracts the cocoon image import subprocess.

type Downloader

type Downloader interface {
	GetManifest(ctx context.Context, name, tag string) ([]byte, string, error)
	GetBlob(ctx context.Context, name, digest string) (io.ReadCloser, error)
}

Downloader abstracts OCI manifest and blob downloads.

type PullOptions

type PullOptions struct {
	Name      string // OCI repository name. Required.
	Tag       string // Defaults to "latest".
	LocalName string // Override the cocoon-side image name. Empty = use Name.
}

PullOptions configures a cloud-image pull operation.

type Puller

type Puller struct {
	Downloader Downloader
	Cocoon     CocoonRunner
}

Puller downloads cloud-image artifacts and pipes them into cocoon image import.

func (*Puller) Pull

func (p *Puller) Pull(ctx context.Context, opts PullOptions) error

Pull downloads a cloud-image artifact and pipes it into cocoon image import.

Jump to

Keyboard shortcuts

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