MCPcopy Create free account
hub / github.com/evilsocket/sum / pathForID

Method pathForID

storage/index.go:41–43  ·  view source on GitHub ↗

NOTE: pathSep is added if needed when the index object is created, this spares us a third string concatenation or worse a Sprintf call.

(id uint64)

Source from the content-addressed store, hash-verified

39// NOTE: pathSep is added if needed when the index object is created,
40// this spares us a third string concatenation or worse a Sprintf call.
41func (i *Index) pathForID(id uint64) string {
42 return i.dataPath + strconv.FormatUint(id, 10) + DatFileExt
43}
44
45func (i *Index) pathFor(record proto.Message) string {
46 return i.pathForID(i.driver.GetID(record))

Callers 6

pathForMethod · 0.95
CreateMethod · 0.95
UpdateMethod · 0.95
DeleteMethod · 0.95
TestIndexPathForIdFunction · 0.80
BenchmarkIndexPathForIdFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestIndexPathForIdFunction · 0.64
BenchmarkIndexPathForIdFunction · 0.64