cache

package
v1.15.13 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cache implements tools for OCI registry caching.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Registry

type Registry struct {
	RemoteRegistry *remote.Registry
	ReferrersType  string
	RewritePull    map[string]string
	// contains filtered or unexported fields
}

Registry represents the cached registry, HTTP client and repository-specific settings defined in the configuration.

func GetRegistryFromCache

func GetRegistryFromCache(partialName string, cache *RegistryCache) Registry

GetRegistryFromCache loads a registry from a RegistryCache based on a regex match with partial name, or an empty one if no match is found.

func (*Registry) IsValid

func (r *Registry) IsValid() bool

IsValid returns true if the registry object exists (e.g. if remoteRegistry is not nil).

func (*Registry) SetSigningKeyPath

func (r *Registry) SetSigningKeyPath(keyFilePath string)

SetSigningKeyPath sets the signing key path for a registry.

func (*Registry) SignCertPath

func (r *Registry) SignCertPath() string

SignCertPath returns the signing certificate private key path for the associated registry.

type RegistryCache

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

RegistryCache represents the in-memory storage of registries to limit duplication of remote.Registry and HTTP client objects.

func NewRegistryCache

func NewRegistryCache() *RegistryCache

NewRegistryCache creates a new registry cache to store registry and client information.

func (*RegistryCache) AddRegistryToCache

func (cache *RegistryCache) AddRegistryToCache(hostname string, r Registry)

AddRegistryToCache adds an entry to the cache.

func (*RegistryCache) Exists

func (cache *RegistryCache) Exists(hostname string) (Registry, bool)

Exists checks the cache for an entry discovered by hostname.

Jump to

Keyboard shortcuts

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