MCPcopy Index your code
hub / github.com/perkeep/perkeep / New

Function New

pkg/blobserver/proxycache/proxycache.go:74–82  ·  view source on GitHub ↗

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

(maxBytes int64, cache, origin blobserver.Storage)

Source from the content-addressed store, hash-verified

72// New returns a proxycache blob storage that reads from cache,
73// then origin, populating cache as needed, up to a total of maxBytes.
74func New(maxBytes int64, cache, origin blobserver.Storage) *Storage {
75 sto := &Storage{
76 origin: origin,
77 cache: cache,
78 lru: lru.NewUnlocked(0),
79 maxCacheBytes: maxBytes,
80 }
81 return sto
82}
83
84func init() {
85 blobserver.RegisterStorageConstructor("proxycache", blobserver.StorageConstructor(newFromConfig))

Callers 3

NewProxiedDiskFunction · 0.70
newFromConfigFunction · 0.70

Calls 1

NewUnlockedFunction · 0.92

Tested by 1

NewProxiedDiskFunction · 0.56