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

Method ForEach

deb/local.go:222–232  ·  view source on GitHub ↗

ForEach runs method for each repository

(handler func(*LocalRepo) error)

Source from the content-addressed store, hash-verified

220
221// ForEach runs method for each repository
222func (collection *LocalRepoCollection) ForEach(handler func(*LocalRepo) error) error {
223 return collection.db.ProcessByPrefix([]byte("L"), func(_, blob []byte) error {
224 r := &LocalRepo{}
225 if err := r.Decode(blob); err != nil {
226 log.Printf("Error decoding repo: %s\n", err)
227 return nil
228 }
229
230 return handler(r)
231 })
232}
233
234// Len returns number of remote repos
235func (collection *LocalRepoCollection) Len() int {

Callers

nothing calls this directly

Calls 3

DecodeMethod · 0.95
ProcessByPrefixMethod · 0.65
PrintfMethod · 0.65

Tested by

no test coverage detected