MCPcopy
hub / github.com/perkeep/perkeep / load

Method load

cmd/pk-get/graph.go:75–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73}
74
75func (n *node) load() {
76 defer n.g.wg.Done()
77 rc, err := fetch(context.Background(), n.g.src, n.br)
78 check(err)
79 defer rc.Close()
80 sniff := index.NewBlobSniffer(n.br)
81 n.size, err = io.Copy(sniff, rc)
82 check(err)
83 sniff.Parse()
84 blob, ok := sniff.SchemaBlob()
85 if !ok {
86 return
87 }
88 n.blob = blob
89 for _, part := range blob.ByteParts() {
90 n.addEdge(part.BlobRef)
91 n.addEdge(part.BytesRef)
92 }
93}
94
95func (n *node) addEdge(dst blob.Ref) {
96 if !dst.Valid() {

Callers 2

startLoadNodeMethod · 0.95

Calls 8

ParseMethod · 0.95
SchemaBlobMethod · 0.95
addEdgeMethod · 0.95
NewBlobSnifferFunction · 0.92
fetchFunction · 0.85
BytePartsMethod · 0.80
checkFunction · 0.70
CloseMethod · 0.65

Tested by

no test coverage detected