Method
AcquireReference
(ctx context.Context, id idpool.ID, key AllocatorKey, lock kvstore.KVLocker)
Source from the content-addressed store, hash-verified
| 82 | } |
| 83 | |
| 84 | func (d *dummyBackend) AcquireReference(ctx context.Context, id idpool.ID, key AllocatorKey, lock kvstore.KVLocker) error { |
| 85 | d.mutex.Lock() |
| 86 | defer d.mutex.Unlock() |
| 87 | |
| 88 | if _, ok := d.masterKeys[id]; !ok { |
| 89 | return fmt.Errorf("identity does not exist") |
| 90 | } |
| 91 | |
| 92 | d.slaveKeys[id] = key |
| 93 | |
| 94 | if d.handler != nil { |
| 95 | d.handler.OnUpsert(id, key) |
| 96 | } |
| 97 | |
| 98 | return nil |
| 99 | } |
| 100 | |
| 101 | type dummyLock struct{} |
| 102 | |
Callers
nothing calls this directly
Tested by
no test coverage detected