cache

package
v0.2.22 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2025 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

View Source
const LayerAnnotationCacheVersion = "containerd.io/snapshot/nydus-cache-version"

Variables

This section is empty.

Functions

func Set

func Set(ctx context.Context, source, target ocispec.Descriptor)

Types

type Item

type Item struct {
	Source ocispec.Descriptor
	Target ocispec.Descriptor
}

type Provider

type Provider interface {
	Resolver(ref string) (remotes.Resolver, error)
	Pull(ctx context.Context, ref string) error
	Push(ctx context.Context, desc ocispec.Descriptor, ref string) error
	ContentStore() content.Store
}

type RemoteCache

type RemoteCache struct {
	// ref is the reference of cache manifest in remote registry.
	Ref string
	// contains filtered or unexported fields
}

RemoteCache manages the map of source and target layer after conversion, it's local records of the remote cache manifest.

func Get

func New

func New(ctx context.Context, ref, version string, size int, pvd Provider) (context.Context, *RemoteCache)

func Update

func Update(ctx context.Context, dgst digest.Digest, labels map[string]string) (*RemoteCache, *ocispec.Descriptor)

func (*RemoteCache) Fetch

func (rc *RemoteCache) Fetch(ctx context.Context, platformMC platforms.MatchComparer) (*ocispec.Descriptor, error)

Fetch fetchs cache manifest from remote registry.

func (*RemoteCache) HitCount added in v0.2.12

func (rc *RemoteCache) HitCount(ctx context.Context, desc ocispec.Descriptor, platform platforms.MatchComparer) (uint, uint, error)

HitCount returns the hitted and total count of cache layers in a conversion.

func (*RemoteCache) Push

func (rc *RemoteCache) Push(ctx context.Context, orgDesc, newDesc *ocispec.Descriptor, platformMC platforms.MatchComparer) error

Push merges local and remote cache records, then push cache manifest to remote registry.

Jump to

Keyboard shortcuts

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