本文整理匯總了Golang中camlistore/org/pkg/schema.Blob.DirectoryEntries方法的典型用法代碼示例。如果您正苦於以下問題:Golang Blob.DirectoryEntries方法的具體用法?Golang Blob.DirectoryEntries怎麽用?Golang Blob.DirectoryEntries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類camlistore/org/pkg/schema.Blob
的用法示例。
在下文中一共展示了Blob.DirectoryEntries方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: indexSchemaBlob
func indexSchemaBlob(fsck *db.DB, s *schema.Blob) (needs []string) {
camliType := s.Type()
switch camliType {
case "static-set":
for _, r := range s.StaticSetMembers() {
needs = append(needs, r.String())
}
case "bytes":
fallthrough
case "file":
for i, bp := range s.ByteParts() {
ok := false
if r := bp.BlobRef; r.Valid() {
needs = append(needs, r.String())
ok = true
}
if r := bp.BytesRef; r.Valid() {
needs = append(needs, r.String())
ok = true
}
if !ok {
log.Printf("%s (%s): no valid ref in part %d", s.BlobRef(), camliType, i)
}
}
case "directory":
switch r, ok := s.DirectoryEntries(); {
case !ok:
log.Printf("%s (%s): bad entries", s.BlobRef(), camliType)
case !r.Valid():
log.Printf("%s (%s): invalid entries", s.BlobRef(), camliType)
default:
needs = append(needs, r.String())
}
}
return
}