cache

package
v0.0.45 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

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
}

func NewCache

func NewCache(opts ...Option) (*Cache, error)

func (*Cache) BlobWriter

func (c *Cache) BlobWriter(ctx context.Context, blob string, append bool) (sss.FileWriter, error)

func (*Cache) CleanCacheStatBlob added in v0.0.39

func (c *Cache) CleanCacheStatBlob(blob string)

func (*Cache) CleanCacheStatManifest added in v0.0.39

func (c *Cache) CleanCacheStatManifest(manifest string)

func (*Cache) CleanCacheStatManifestTag added in v0.0.31

func (c *Cache) CleanCacheStatManifestTag(manifest string)

func (*Cache) Delete

func (c *Cache) Delete(ctx context.Context, cachePath string) error

func (*Cache) DeleteBlob

func (c *Cache) DeleteBlob(ctx context.Context, blob string) error

func (*Cache) Get

func (c *Cache) Get(ctx context.Context, cachePath string) (io.ReadCloser, error)

func (*Cache) GetBlob

func (c *Cache) GetBlob(ctx context.Context, blob string) (io.ReadCloser, error)

func (*Cache) GetBlobContent

func (c *Cache) GetBlobContent(ctx context.Context, blob string) ([]byte, error)

func (*Cache) GetBlobWithOffset

func (c *Cache) GetBlobWithOffset(ctx context.Context, blob string, offset int64) (io.ReadCloser, error)

func (*Cache) GetContent

func (c *Cache) GetContent(ctx context.Context, cachePath string) ([]byte, error)

func (*Cache) GetManifestContent

func (c *Cache) GetManifestContent(ctx context.Context, host, image, tagOrBlob string) (manifest *Manifest, err error)

func (*Cache) GetWithOffset

func (c *Cache) GetWithOffset(ctx context.Context, cachePath string, offset int64) (io.ReadCloser, error)

func (*Cache) List

func (c *Cache) List(ctx context.Context, cachePath string) ([]string, error)

func (*Cache) ListTags

func (c *Cache) ListTags(ctx context.Context, host, image string) ([]string, error)

func (*Cache) Put

func (c *Cache) Put(ctx context.Context, cachePath string, r io.Reader) (int64, error)

func (*Cache) PutBlob

func (c *Cache) PutBlob(ctx context.Context, blob string, r io.Reader) (int64, error)

func (*Cache) PutBlobContent

func (c *Cache) PutBlobContent(ctx context.Context, blob string, content []byte) (int64, error)

func (*Cache) PutContent

func (c *Cache) PutContent(ctx context.Context, cachePath string, content []byte) error

func (*Cache) PutManifestContent

func (c *Cache) PutManifestContent(ctx context.Context, host, image, tagOrBlob string, content []byte) error

func (*Cache) PutWithHash

func (c *Cache) PutWithHash(ctx context.Context, cachePath string, r io.Reader, cacheHash string, cacheSize int64) (int64, error)

func (*Cache) Redirect

func (c *Cache) Redirect(ctx context.Context, blobPath string, referer string) (string, error)

func (*Cache) RedirectBlob

func (c *Cache) RedirectBlob(ctx context.Context, blob string, referer string) (string, error)

func (*Cache) RelinkManifest

func (c *Cache) RelinkManifest(ctx context.Context, host, image, tag string, blob string) error

func (*Cache) Stat

func (c *Cache) Stat(ctx context.Context, cachePath string) (sss.FileInfo, error)

func (*Cache) StatBlob

func (c *Cache) StatBlob(ctx context.Context, blob string) (sss.FileInfo, error)

func (*Cache) Walk

func (c *Cache) Walk(ctx context.Context, cachePath string, fun fs.WalkDirFunc) error

func (*Cache) WalkTags

func (c *Cache) WalkTags(ctx context.Context, host, image string, tagCb func(tag string) bool) error

func (*Cache) Writer

func (c *Cache) Writer(ctx context.Context, cachePath string, append bool) (sss.FileWriter, error)

type Manifest added in v0.0.31

type Manifest struct {
	Content   []byte
	Digest    string
	MediaType string
}

type Option

type Option func(c *Cache)

func WithBlobCache added in v0.0.31

func WithBlobCache(ttl time.Duration) Option

func WithLinkExpires

func WithLinkExpires(d time.Duration) Option

func WithManifestCache added in v0.0.31

func WithManifestCache(ttl time.Duration) Option
func WithRedirectLinks(l *url.URL) Option
func WithSignLink(signLink bool) Option

func WithStorageDriver

func WithStorageDriver(storageDriver *sss.SSS) Option

Jump to

Keyboard shortcuts

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