cache

package
v0.13.0-alpha.25 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 14 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) 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) 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) ([]byte, 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) (int64, string, 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, ip string) (string, error)

func (*Cache) RedirectBlob

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

func (*Cache) Stat

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

func (*Cache) StatBlob

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

type Option

type Option func(c *Cache)

func WithLinkExpires

func WithLinkExpires(d time.Duration) Option
func WithRedirectLinks(l *url.URL) Option

func WithStorageDriver

func WithStorageDriver(storageDriver storagedriver.StorageDriver) Option

Jump to

Keyboard shortcuts

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