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

Method ForEach

deb/remote.go:1008–1018  ·  view source on GitHub ↗

ForEach runs method for each repository

(handler func(*RemoteRepo) error)

Source from the content-addressed store, hash-verified

1006
1007// ForEach runs method for each repository
1008func (collection *RemoteRepoCollection) ForEach(handler func(*RemoteRepo) error) error {
1009 return collection.db.ProcessByPrefix([]byte("R"), func(_, blob []byte) error {
1010 r := &RemoteRepo{}
1011 if err := r.Decode(blob); err != nil {
1012 log.Printf("Error decoding mirror: %s\n", err)
1013 return nil
1014 }
1015
1016 return handler(r)
1017 })
1018}
1019
1020// Len returns number of remote repos
1021func (collection *RemoteRepoCollection) Len() int {

Callers 2

BuildDownloadQueueMethod · 0.45
FinalizeDownloadMethod · 0.45

Calls 3

DecodeMethod · 0.95
ProcessByPrefixMethod · 0.65
PrintfMethod · 0.65

Tested by

no test coverage detected