registryutil

package
v2.0.0-...-9cac419 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithScopeHint

func WithScopeHint(ctx context.Context, ref registry.Reference, actions ...string) context.Context

WithScopeHint adds a hinted scope to the context.

Types

type Proxy

type Proxy struct {
	registry.ReferenceFetcher
	*cas.Proxy
}

Proxy is a caching proxy dedicated for registry.ReferenceFetcher. The first fetch call of a described content will read from the remote and cache the fetched content. The subsequent fetch call will read from the local cache.

func NewProxy

func NewProxy(base ReferenceStorage, cache content.Storage) *Proxy

NewProxy creates a proxy for the `base` ReferenceStorage, using the `cache` storage as the cache.

func (*Proxy) FetchReference

func (p *Proxy) FetchReference(ctx context.Context, reference string) (ocispec.Descriptor, io.ReadCloser, error)

FetchReference fetches the content identified by the reference from the remote and cache the fetched content.

type ReferenceStorage

type ReferenceStorage interface {
	content.ReadOnlyStorage
	registry.ReferenceFetcher
}

ReferenceStorage represents a CAS that supports registry.ReferenceFetcher.

Jump to

Keyboard shortcuts

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