Index | Files

package proxycache

import ""

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


Package Files


type Storage Uses

type Storage struct {
    // contains filtered or unexported fields

Storage implements the "proxycache" blob storage.

func New Uses

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 Uses

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

func (*Storage) Fetch Uses

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

func (*Storage) ReceiveBlob Uses

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

func (*Storage) RemoveBlobs Uses

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

func (*Storage) StatBlobs Uses

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

func (*Storage) SubFetch Uses

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

Package proxycache imports 14 packages (graph) and is imported by 2 packages. Updated 2019-06-30. Refresh now. Tools for package owners.