MCPcopy
hub / github.com/perkeep/perkeep / StaticSetMembers

Method StaticSetMembers

pkg/schema/blob.go:157–169  ·  view source on GitHub ↗

StaticSetMembers returns the refs in the "members" field if b is a valid "static-set" schema. Note that if it is a large static-set, the members are actually spread as subsets in "mergeSets". See StaticSetMergeSets.

()

Source from the content-addressed store, hash-verified

155// "static-set" schema. Note that if it is a large static-set, the members are
156// actually spread as subsets in "mergeSets". See StaticSetMergeSets.
157func (b *Blob) StaticSetMembers() []blob.Ref {
158 if b.Type() != TypeStaticSet {
159 return nil
160 }
161
162 s := make([]blob.Ref, 0, len(b.ss.Members))
163 for _, ref := range b.ss.Members {
164 if ref.Valid() {
165 s = append(s, ref)
166 }
167 }
168 return s
169}
170
171// StaticSetMergeSets returns the refs of the static-sets in "mergeSets". These
172// are the subsets of all the static-set members in the case of a large directory.

Callers 4

bytesHaveSchemaLinkFunction · 0.80
imprtMethod · 0.80
testLargeDirFunction · 0.80
smartFetchFunction · 0.80

Calls 2

TypeMethod · 0.95
ValidMethod · 0.45

Tested by 1

testLargeDirFunction · 0.64