MCPcopy Create free account
hub / github.com/Azure/peerd / GetOrCreate

Method GetOrCreate

pkg/cache/interface.go:17–17  ·  view source on GitHub ↗

GetOrCreate gets the cached value if available, otherwise downloads the file.

(name string, offset int64, count int, fetch func() ([]byte, error))

Source from the content-addressed store, hash-verified

15
16 // GetOrCreate gets the cached value if available, otherwise downloads the file.
17 GetOrCreate(name string, offset int64, count int, fetch func() ([]byte, error)) ([]byte, error)
18}
19
20var (

Callers 5

TestExistsFunction · 0.95
TestGetOrCreateFunction · 0.95
ReadAtMethod · 0.65
prefetchMethod · 0.65

Implementers 1

fileCachepkg/cache/filecache.go

Calls

no outgoing calls

Tested by 3

TestExistsFunction · 0.76
TestGetOrCreateFunction · 0.76