Build all package refs.

This commit is contained in:
Andrey Smirnov
2014-02-11 21:11:36 +04:00
parent bff299d268
commit c30862dff9
2 changed files with 14 additions and 0 deletions
+5
View File
@@ -345,3 +345,8 @@ func (collection *PackageCollection) ByKey(key []byte) (*Package, error) {
func (collection *PackageCollection) Update(p *Package) error {
return collection.db.Put(p.Key(), p.Encode())
}
// AllPackageRefs returns list of all packages as PackageRefList
func (collection *PackageCollection) AllPackageRefs() *PackageRefList {
return &PackageRefList{Refs: collection.db.KeysByPrefix([]byte("P"))}
}