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

Method ForEach

deb/publish.go:1522–1532  ·  view source on GitHub ↗

ForEach runs method for each repository

(handler func(*PublishedRepo) error)

Source from the content-addressed store, hash-verified

1520
1521// ForEach runs method for each repository
1522func (collection *PublishedRepoCollection) ForEach(handler func(*PublishedRepo) error) error {
1523 return collection.db.ProcessByPrefix([]byte("U"), func(_, blob []byte) error {
1524 r := &PublishedRepo{}
1525 if err := r.Decode(blob); err != nil {
1526 log.Printf("Error decoding published repo: %s\n", err)
1527 return nil
1528 }
1529
1530 return handler(r)
1531 })
1532}
1533
1534// Len returns number of remote repos
1535func (collection *PublishedRepoCollection) Len() int {

Calls 3

DecodeMethod · 0.95
ProcessByPrefixMethod · 0.65
PrintfMethod · 0.65

Tested by

no test coverage detected