MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / get

Method get

pkg/errors/cache.go:51–61  ·  view source on GitHub ↗

get retrieves a cached suggestion if available

(input string)

Source from the content-addressed store, hash-verified

49
50// get retrieves a cached suggestion if available
51func (c *keywordSuggestionCache) get(input string) (string, bool) {
52 c.mu.RLock()
53 defer c.mu.RUnlock()
54 result, ok := c.cache[input]
55 if ok {
56 atomic.AddUint64(&c.hits, 1)
57 } else {
58 atomic.AddUint64(&c.misses, 1)
59 }
60 return result, ok
61}
62
63// set stores a suggestion in the cache
64func (c *keywordSuggestionCache) set(input, suggestion string) {

Callers 1

SuggestKeywordFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected