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

Method Read

internal/cache/cache.go:79–86  ·  view source on GitHub ↗

Read attempts to retrieve a cached value as a string, if the value does not exists returns an empty string and false.

(h Hashable)

Source from the content-addressed store, hash-verified

77// Read attempts to retrieve a cached value as a string, if the value does not
78// exists returns an empty string and false.
79func (c *Cache) Read(h Hashable) (string, bool) {
80 if v, ok := c.ReadRaw(h); ok {
81 if s, ok := v.(string); ok {
82 return s, true
83 }
84 }
85 return "", false
86}
87
88// ReadRaw attempts to retrieve a cached value as an interface{}, if the value
89// does not exists returns nil and false.

Callers 15

TestCacheFunction · 0.95
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80

Calls 1

ReadRawMethod · 0.95

Tested by 3

TestCacheFunction · 0.76