MCPcopy
hub / github.com/perkeep/perkeep / Storage

Struct Storage

pkg/blobserver/memory/mem.go:44–57  ·  view source on GitHub ↗

Storage is an in-memory implementation of the blobserver Storage interface. It also includes other convenience methods used by tests. Its zero value is usable.

Source from the content-addressed store, hash-verified

42//
43// Its zero value is usable.
44type Storage struct {
45 maxSize int64 // or zero if no limit
46
47 mu sync.RWMutex // guards following 2 fields.
48 m map[blob.Ref][]byte // maps blob ref to its contents
49 size int64 // sum of len(values(m))
50
51 // lru is non-nil if we're in cache mode.
52 // Else it maps blobref.String() to a nil value.
53 lru *lru.Cache
54
55 blobsFetched int64 // atomic
56 bytesFetched int64 // atomic
57}
58
59var _ blobserver.BlobStreamer = (*Storage)(nil)
60

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected