MCPcopy Index your code
hub / github.com/upper/db / ReadRaw

Method ReadRaw

internal/cache/cache.go:90–100  ·  view source on GitHub ↗

ReadRaw attempts to retrieve a cached value as an interface{}, if the value does not exists returns nil and false.

(h Hashable)

Source from the content-addressed store, hash-verified

88// ReadRaw attempts to retrieve a cached value as an interface{}, if the value
89// does not exists returns nil and false.
90func (c *Cache) ReadRaw(h Hashable) (interface{}, bool) {
91 c.mu.RLock()
92 defer c.mu.RUnlock()
93
94 item, ok := c.items[h.Hash()]
95 if ok {
96 return item.Value.(*cacheItem).value, true
97 }
98
99 return nil, false
100}
101
102// Write stores a value in memory. If the value already exists its overwritten.
103func (c *Cache) Write(h Hashable, value interface{}) {

Callers 4

ReadMethod · 0.95
PrimaryKeysMethod · 0.80
CollectionMethod · 0.80
prepareStatementMethod · 0.80

Calls 1

HashMethod · 0.65

Tested by

no test coverage detected