MCPcopy Index your code
hub / github.com/aptly-dev/aptly / ByUUID

Method ByUUID

deb/local.go:195–219  ·  view source on GitHub ↗

ByUUID looks up repository by uuid

(uuid string)

Source from the content-addressed store, hash-verified

193
194// ByUUID looks up repository by uuid
195func (collection *LocalRepoCollection) ByUUID(uuid string) (*LocalRepo, error) {
196 if r, ok := collection.cache[uuid]; ok {
197 return r, nil
198 }
199
200 key := (&LocalRepo{UUID: uuid}).Key()
201
202 value, err := collection.db.Get(key)
203 if err == database.ErrNotFound {
204 return nil, fmt.Errorf("local repo with uuid %s not found", uuid)
205 }
206
207 if err != nil {
208 return nil, err
209 }
210
211 r := &LocalRepo{}
212 err = r.Decode(value)
213
214 if err == nil {
215 collection.cache[r.UUID] = r
216 }
217
218 return r, err
219}
220
221// ForEach runs method for each repository
222func (collection *LocalRepoCollection) ForEach(handler func(*LocalRepo) error) error {

Callers 12

TestByUUIDMethod · 0.95
TestByUUIDMethod · 0.45
TestDropMethod · 0.45
TestByUUIDMethod · 0.45
TestDropMethod · 0.45
TestDropNonExistingMethod · 0.45
TestDropMethod · 0.45
aptlySnapshotShowTxtFunction · 0.45
aptlySnapshotShowJSONFunction · 0.45
aptlyPublishShowTxtFunction · 0.45
apiPublishUpdateSwitchFunction · 0.45
apiPublishUpdateFunction · 0.45

Calls 3

DecodeMethod · 0.95
GetMethod · 0.65
KeyMethod · 0.45

Tested by 7

TestByUUIDMethod · 0.76
TestByUUIDMethod · 0.36
TestDropMethod · 0.36
TestByUUIDMethod · 0.36
TestDropMethod · 0.36
TestDropNonExistingMethod · 0.36
TestDropMethod · 0.36