sysimage

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sysimage loads the platform images a release carries (the managed PostgreSQL images) into the built-in registry the first time something needs them. Releases are self-contained: no public registry is involved, and an air-gapped host can drop the archives in place.

Index

Constants

View Source
const RegistryPrefix = "@registry/"

RegistryPrefix marks an image in the built-in registry ("@registry/…").

Variables

This section is empty.

Functions

func Archive

func Archive(repo, tag, arch string) string

Archive is the release file of repo:tag: "syncloud-<base of repo>-<tag>-linux-<arch>.tar.gz".

Types

type Preparing

type Preparing struct{ Phase string }

Preparing means the image is being loaded; Phase says how far it got.

func (*Preparing) Error

func (p *Preparing) Error() string

type Registry

type Registry interface {
	HasImage(ctx context.Context, repo, ref string) (bool, error)
	PushLayout(ctx context.Context, repo, tag, dir string) error
}

Registry is what the seeder needs from the built-in registry.

type Seeder

type Seeder struct {
	Registry Registry
	// Source and Version locate this controller's release, which carries
	// the archives.
	Source  upgrade.Source
	Version string
	// Dir holds archives placed by hand (air-gapped hosts): <Dir>/<archive>
	// is used before anything is downloaded. It may be read-only.
	Dir string
	// WorkDir is where archives are downloaded and unpacked: under the data
	// directory, the one place the installed service may write
	// (ProtectSystem=strict). An archive placed here is used too.
	WorkDir string
	// Arch is the archives' CPU architecture (default: the controller's).
	Arch string
	Log  *slog.Logger
	// contains filtered or unexported fields
}

Seeder loads release images into the registry on demand.

func (*Seeder) Ensure

func (s *Seeder) Ensure(ctx context.Context, image string) error

Ensure returns nil once image is in the registry. Images outside the built-in registry are always ready. Otherwise it starts loading the image in the background and returns *Preparing, or the last error while a failed attempt waits to be retried.

Jump to

Keyboard shortcuts

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