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

Method Drop

deb/local.go:240–254  ·  view source on GitHub ↗

Drop removes remote repo from collection

(repo *LocalRepo)

Source from the content-addressed store, hash-verified

238
239// Drop removes remote repo from collection
240func (collection *LocalRepoCollection) Drop(repo *LocalRepo) error {
241 if _, err := collection.db.Get(repo.Key()); err != nil {
242 if err == database.ErrNotFound {
243 return errors.New("local repo not found")
244 }
245
246 return err
247 }
248 delete(collection.cache, repo.UUID)
249
250 batch := collection.db.CreateBatch()
251 _ = batch.Delete(repo.Key())
252 _ = batch.Delete(repo.RefKey())
253 return batch.Write()
254}

Callers

nothing calls this directly

Calls 6

GetMethod · 0.65
CreateBatchMethod · 0.65
DeleteMethod · 0.65
WriteMethod · 0.65
KeyMethod · 0.45
RefKeyMethod · 0.45

Tested by

no test coverage detected