MCPcopy Create free account
hub / github.com/aptly-dev/aptly / LoadShallow

Method LoadShallow

deb/publish.go:1374–1405  ·  view source on GitHub ↗

LoadShallow loads basic information on the repo's sources This does not *fully* load in the sources themselves and their packages. It's useful if you just want to use JSON serialization without loading in unnecessary things.

(repo *PublishedRepo, collectionFactory *CollectionFactory)

Source from the content-addressed store, hash-verified

1372// This does not *fully* load in the sources themselves and their packages.
1373// It's useful if you just want to use JSON serialization without loading in unnecessary things.
1374func (collection *PublishedRepoCollection) LoadShallow(repo *PublishedRepo, collectionFactory *CollectionFactory) (err error) {
1375 repo.sourceItems = make(map[string]repoSourceItem)
1376
1377 if repo.SourceKind == SourceSnapshot {
1378 for component, sourceUUID := range repo.Sources {
1379 item := repoSourceItem{}
1380
1381 item.snapshot, err = collectionFactory.SnapshotCollection().ByUUID(sourceUUID)
1382 if err != nil {
1383 return
1384 }
1385
1386 repo.sourceItems[component] = item
1387 }
1388 } else if repo.SourceKind == SourceLocalRepo {
1389 for component, sourceUUID := range repo.Sources {
1390 item := repoSourceItem{}
1391
1392 item.localRepo, err = collectionFactory.LocalRepoCollection().ByUUID(sourceUUID)
1393 if err != nil {
1394 return
1395 }
1396
1397 item.packageRefs = &PackageRefList{}
1398 repo.sourceItems[component] = item
1399 }
1400 } else {
1401 panic("unknown SourceKind")
1402 }
1403
1404 return
1405}
1406
1407// LoadComplete loads complete information on the sources of the repo *and* their packages
1408func (collection *PublishedRepoCollection) LoadComplete(repo *PublishedRepo, collectionFactory *CollectionFactory) (err error) {

Callers 3

LoadCompleteMethod · 0.95
aptlyPublishListTxtFunction · 0.80
apiPublishListFunction · 0.80

Calls 3

SnapshotCollectionMethod · 0.80
LocalRepoCollectionMethod · 0.80
ByUUIDMethod · 0.45

Tested by

no test coverage detected