MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / keyPath

Method keyPath

internal/caches/storage_file.go:1007–1013  ·  view source on GitHub ↗

获取Key对应的文件路径

(key string)

Source from the content-addressed store, hash-verified

1005
1006// 获取Key对应的文件路径
1007func (this *FileStorage) keyPath(key string) (hash string, path string, diskIsFull bool) {
1008 hash = stringutil.Md5(key)
1009 var dir string
1010 dir, diskIsFull = this.subDir(hash)
1011 path = dir + "/" + hash + ".cache"
1012 return
1013}
1014
1015// 获取Hash对应的文件路径
1016func (this *FileStorage) hashPath(hash string) (path string, diskIsFull bool) {

Callers 7

openReaderMethod · 0.95
DeleteMethod · 0.95
PurgeMethod · 0.95
TestFileReaderFunction · 0.80
TestFileReader_RangeFunction · 0.80

Calls 1

subDirMethod · 0.95

Tested by 4

TestFileReaderFunction · 0.64
TestFileReader_RangeFunction · 0.64