MCPcopy Create free account
hub / github.com/MertJSX/folderhost / Get

Method Get

utils/cache/get.go:3–12  ·  view source on GitHub ↗
(key KeyType)

Source from the content-addressed store, hash-verified

1package cache
2
3func (c *Cache[KeyType, DataType]) Get(key KeyType) (DataType, bool) {
4 c.Mutex.RLock()
5 defer c.Mutex.RUnlock()
6 item, ok := c.Items[key]
7 if !ok {
8 var zero DataType
9 return zero, false
10 }
11 return item.Data, ok
12}

Callers 15

mainFunction · 0.80
checkForUpdatesFunction · 0.80
CheckAuthFunction · 0.80
HandleWebsocketFunction · 0.80
WsConnectFunction · 0.80
SetupWatcherFunction · 0.80
writeFileFunction · 0.80
VerifyPasswordFunction · 0.80
EditUserFunction · 0.80
ChangeUserPasswordFunction · 0.80
GetUserFunction · 0.80
DownloadFunction · 0.80

Calls

no outgoing calls

Tested by 5

TestCache_SetAndGetFunction · 0.64
TestCache_DeleteFunction · 0.64
TestCache_ClearFunction · 0.64
TestCache_ExpirationFunction · 0.64