MCPcopy
hub / github.com/perkeep/perkeep / StaticSet

Method StaticSet

pkg/schema/dirreader.go:87–101  ·  view source on GitHub ↗

StaticSet returns the whole of the static set members of that directory

(ctx context.Context)

Source from the content-addressed store, hash-verified

85
86// StaticSet returns the whole of the static set members of that directory
87func (dr *DirReader) StaticSet(ctx context.Context) ([]blob.Ref, error) {
88 if dr.staticSet != nil {
89 return dr.staticSet, nil
90 }
91 staticSetBlobref := dr.ss.Entries
92 if !staticSetBlobref.Valid() {
93 return nil, errors.New("schema/dirreader: Invalid blobref")
94 }
95 members, err := staticSet(ctx, staticSetBlobref, dr.fetcher)
96 if err != nil {
97 return nil, err
98 }
99 dr.staticSet = members
100 return dr.staticSet, nil
101}
102
103func staticSet(ctx context.Context, staticSetBlobref blob.Ref, fetcher blob.Fetcher) ([]blob.Ref, error) {
104 rsc, _, err := fetcher.Fetch(ctx, staticSetBlobref)

Callers 5

populateDirMethod · 0.95
dirInfoMethod · 0.95
checkFilesMethod · 0.95
ReaddirMethod · 0.95
testReadDirFunction · 0.95

Calls 2

staticSetFunction · 0.85
ValidMethod · 0.45

Tested by 1

testReadDirFunction · 0.76