cache

package
v4.2.24+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cache provides facilities to speed up access to the storage backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobStatter

type BlobStatter struct {
	Svc   distribution.BlobStatter
	Cache DigestCache
}

func (*BlobStatter) Stat

func (bs *BlobStatter) Stat(ctx context.Context, dgst digest.Digest) (distribution.Descriptor, error)

Stat provides metadata about a blob identified by the digest.

type DigestCache

type DigestCache interface {
	Get(dgst digest.Digest) (distribution.Descriptor, error)
	ScopedGet(dgst digest.Digest, repository string) (distribution.Descriptor, error)
	Repositories(dgst digest.Digest) []string
	Remove(dgst digest.Digest) error
	ScopedRemove(dgst digest.Digest, repository string) error
	Add(dgst digest.Digest, value *DigestValue) error
}

func NewBlobDigest

func NewBlobDigest(digestSize, repoSize int, itemTTL time.Duration, metrics metrics.DigestCache) (DigestCache, error)

type DigestItem

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

type DigestValue

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

type Provider

type Provider struct {
	Cache DigestCache
}

func (*Provider) Clear

func (c *Provider) Clear(ctx context.Context, dgst digest.Digest) error

func (*Provider) RepositoryScoped

func (c *Provider) RepositoryScoped(repo string) (distribution.BlobDescriptorService, error)

func (*Provider) SetDescriptor

func (c *Provider) SetDescriptor(ctx context.Context, dgst digest.Digest, desc distribution.Descriptor) error

func (*Provider) Stat

func (c *Provider) Stat(ctx context.Context, dgst digest.Digest) (distribution.Descriptor, error)

type RepositoryDigest

type RepositoryDigest interface {
	AddDigest(dgst digest.Digest, repository string) error
	ContainsRepository(dgst digest.Digest, repository string) bool
	Repositories(dgst digest.Digest) []string
}

func NewRepositoryDigest

func NewRepositoryDigest(cache DigestCache) RepositoryDigest

type RepositoryScopedBlobDescriptor

type RepositoryScopedBlobDescriptor struct {
	Repo  string
	Cache DigestCache
	Svc   distribution.BlobDescriptorService
}

func (*RepositoryScopedBlobDescriptor) Clear

func (rbd *RepositoryScopedBlobDescriptor) Clear(ctx context.Context, dgst digest.Digest) error

Clear removes digest from the repository cache

func (*RepositoryScopedBlobDescriptor) SetDescriptor

func (rbd *RepositoryScopedBlobDescriptor) SetDescriptor(ctx context.Context, dgst digest.Digest, desc distribution.Descriptor) error

SetDescriptor assigns the descriptor to the digest for repository

func (*RepositoryScopedBlobDescriptor) Stat

func (rbd *RepositoryScopedBlobDescriptor) Stat(ctx context.Context, dgst digest.Digest) (distribution.Descriptor, error)

Stat provides metadata about a blob identified by the digest.

Jump to

Keyboard shortcuts

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