fetch

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertPlatformV1ToCtrd

func ConvertPlatformV1ToCtrd(v1Platform *v1.Platform) platforms.Platform

func DescribePlatform

func DescribePlatform(platform platforms.Platform) string

func DescribePlatforms

func DescribePlatforms(plats ...platforms.Platform) string

func FindManifestForPlatform

func FindManifestForPlatform(findFor platforms.Platform, manifests []v1.Descriptor) *v1.Descriptor

func FindManifestForPlatforms

func FindManifestForPlatforms(findFor []platforms.Platform, manifests []v1.Descriptor, logger *slog.Logger) *v1.Descriptor

func ParseNamedReference added in v0.21.0

func ParseNamedReference(registry, repository, tag string) (name.Reference, error)

func WithLookupEnv added in v0.21.0

func WithLookupEnv(lookupEnv internal.LookupValue) func(*RemoteImageStore)

func WithPlatforms added in v0.21.0

func WithPlatforms(v1Platforms ...*v1.Platform) func(*RemoteImageStore)

Types

type CachedImageStore

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

CachedImageStore caches complete OCI images (not individual layers), and does so only for fully qualified image references. A fully qualified image reference has either a digest or a tag with major.minor.patch (and optionally release) components. Image refs with only major, major.minor, or `latest` tags are not cached. Note: there is no cache expiration/eviction yet.

func NewCachedImageStore

func NewCachedImageStore(remote ImageStore, storePath string, logger *slog.Logger) *CachedImageStore

func (*CachedImageStore) Fetch

func (cis *CachedImageStore) Fetch(ctx context.Context, ref name.Reference) (string, error)

type Client

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

func NewClient

func NewClient(imageStore ImageStore, versionLookup VersionLookup) *Client

func (*Client) Pull

func (c *Client) Pull(ctx context.Context, ref name.Reference) (string, error)

type DiskLayerWriter

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

func NewDiskLayerWriter

func NewDiskLayerWriter(logger *slog.Logger) *DiskLayerWriter

func (*DiskLayerWriter) Write

func (w *DiskLayerWriter) Write(layers []v1.Layer, outputDir string) error

type ImageStore

type ImageStore interface {
	Fetch(context.Context, name.Reference) (string, error)
}

type Inputs

type Inputs struct {
	RemoteImageRef name.Reference
	StepPath       string
	LogLevel       slog.Level
	OutputFile     string
}

type LayerWriter

type LayerWriter interface {
	Write(layers []v1.Layer, dir string) error
}

type OutputValue

type OutputValue struct {
	Name  string `json:"name"`
	Value any    `json:"value"`
}

type Outputs

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

func NewOutputs

func NewOutputs(outputFile string) *Outputs

func (*Outputs) Write

func (o *Outputs) Write(downloadDir string, imgRef name.Reference, stepPath string) error

type RemoteImageStore

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

RemoteImageStore downloads and extract OCI images. The path is composed from the image reference and is rooted at `storePath`. There's no caching or cleanup.

func NewRemoteImageStore

func NewRemoteImageStore(storePath string, logger *slog.Logger, options ...func(*RemoteImageStore)) *RemoteImageStore

func (*RemoteImageStore) Fetch

func (ris *RemoteImageStore) Fetch(ctx context.Context, ref name.Reference) (string, error)

func (*RemoteImageStore) Version

func (ris *RemoteImageStore) Version(ctx context.Context, ref name.Reference) (*internal.Version, error)

type VersionLookup

type VersionLookup interface {
	Version(context.Context, name.Reference) (*internal.Version, error)
}

Jump to

Keyboard shortcuts

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