imagecache

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package imagecache manages local image records: reusable rootfs baselines addressable by name and digest, backing "microagent images".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanonicalRootfsStorePath

func CanonicalRootfsStorePath(stateDir, path string) (string, bool)

func IndexPath

func IndexPath(stateDir string) string

func MatchesRef

func MatchesRef(image Record, ref string) bool

func PathInRootfsStore

func PathInRootfsStore(stateDir, path string) bool

func Provenance

func Provenance(record Record, outputPath string) rootfs.Provenance

func RecordProvenance

func RecordProvenance(stateDir string, provenance rootfs.Provenance) error

func RootfsPath

func RootfsPath(stateDir, imageRef string, platform rootfs.Platform) string

func Sort

func Sort(images []Record)

func Upsert

func Upsert(stateDir string, record Record) error

func WriteIndex

func WriteIndex(stateDir string, idx Index) error

Types

type Index

type Index struct {
	Images []Record `json:"images"`
}

func ReadIndex

func ReadIndex(stateDir string) (Index, error)

type PruneResult

type PruneResult struct {
	Removed []Record `json:"removed"`
	Deleted []Record `json:"deleted,omitempty"`
	Kept    []Record `json:"kept"`
}

func Prune

func Prune(stateDir string, deleteFiles bool) (PruneResult, error)

func Remove

func Remove(stateDir, ref string, deleteFiles bool) (PruneResult, error)

type PullOptions

type PullOptions struct {
	StateDir      string
	ImageRef      string
	Architecture  string
	SizeMiB       int64
	Mke2fsPath    string
	GuestInitPath string
}

type Record

type Record struct {
	ImageRef    string          `json:"image_ref"`
	ResolvedRef string          `json:"resolved_ref,omitempty"`
	Digest      string          `json:"digest,omitempty"`
	Platform    rootfs.Platform `json:"platform"`
	OutputPath  string          `json:"output_path,omitempty"`
	SizeBytes   int64           `json:"size_bytes,omitempty"`
	LastUsedAt  string          `json:"last_used_at"`
}

func Find

func Find(stateDir, ref string, platform rootfs.Platform) (Record, error)

func FromProvenance

func FromProvenance(provenance rootfs.Provenance) Record

func List

func List(stateDir string) ([]Record, error)

func Pull

func Pull(ctx context.Context, opts PullOptions) (Record, error)

func Tag

func Tag(stateDir, source, target string) (Record, error)

Jump to

Keyboard shortcuts

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