cache

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 22 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache allows us to keep state for repositories, rather than querying them every time.

Cache Structure: <cacheDir>/git/ * Caches bare git repositories in directories named based on the repository address. <cacheDir>/oci/ * Caches oci images with further hierarchy underneath * We Cache image layers in <cacheDir>/oci/layers/ (this might be obsolete with the flattened Cache) * We Cache flattened tar files in <cacheDir>/oci/ (so we don't need to pull to read resources) * We poll the repositories (every minute) and Cache the discovered images in memory.

func NewCache

func NewCache(cacheDir string, repoSyncFrequency time.Duration, opts CacheOptions) *Cache

func (*Cache) CloseRepository

func (c *Cache) CloseRepository(repositorySpec *configapi.Repository) error

func (*Cache) OpenRepository

func (c *Cache) OpenRepository(ctx context.Context, repositorySpec *configapi.Repository) (*cachedRepository, error)

type CacheOptions

type CacheOptions struct {
	CredentialResolver repository.CredentialResolver
	UserInfoProvider   repository.UserInfoProvider
	MetadataStore      meta.MetadataStore
	ObjectNotifier     objectNotifier
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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