MCPcopy Index your code
hub / github.com/go-task/task / CacheKey

Method CacheKey

taskfile/node_http.go:170–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

168}
169
170func (node *HTTPNode) CacheKey() string {
171 checksum := strings.TrimRight(checksum([]byte(node.Location())), "=")
172 dir, filename := filepath.Split(node.url.Path)
173 lastDir := filepath.Base(dir)
174 prefix := filename
175 // Means it's not "", nor "." nor "/", so it's a valid directory
176 if len(lastDir) > 1 {
177 prefix = fmt.Sprintf("%s.%s", lastDir, filename)
178 }
179 return fmt.Sprintf("http.%s.%s.%s", node.url.Host, prefix, checksum)
180}

Callers 1

TestHTTPNode_CacheKeyFunction · 0.95

Calls 2

LocationMethod · 0.95
checksumFunction · 0.85

Tested by 1

TestHTTPNode_CacheKeyFunction · 0.76