Version: v0.0.0-...-0f53db2 Latest Latest

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

Go to latest
Published: Sep 4, 2021 License: Apache-2.0 Imports: 12 Imported by: 0



Package proxycache registers the "proxycache" blobserver storage type, which uses a provided blobserver as a cache for a second origin blobserver.

If the provided maxCacheBytes is unspecified, the default is 512MB.

Example config:

      "/cache/": {
          "handler": "storage-proxycache",
          "handlerArgs": {
		  "origin": "/cloud-blobs/",
		  "cache": "/local-ssd/",
		  "maxCacheBytes": 536870912



This section is empty.


This section is empty.


This section is empty.


type Storage

type Storage struct {
	// contains filtered or unexported fields

Storage implements the "proxycache" blob storage.

func New

func New(maxBytes int64, cache, origin blobserver.Storage) *Storage

New returns a proxycache blob storage that reads from cache, then origin, populating cache as needed, up to a total of maxBytes.

func (*Storage) EnumerateBlobs

func (sto *Storage) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) error

func (*Storage) Fetch

func (sto *Storage) Fetch(ctx context.Context, b blob.Ref) (rc io.ReadCloser, size uint32, err error)

func (*Storage) ReceiveBlob

func (sto *Storage) ReceiveBlob(ctx context.Context, br blob.Ref, src io.Reader) (blob.SizedRef, error)

func (*Storage) RemoveBlobs

func (sto *Storage) RemoveBlobs(ctx context.Context, blobs []blob.Ref) error

func (*Storage) StatBlobs

func (sto *Storage) StatBlobs(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error) error

func (*Storage) SubFetch

func (sto *Storage) SubFetch(ctx context.Context, ref blob.Ref, offset, length int64) (io.ReadCloser, error)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL