Copy returns a copy of the cache contents to the caller. It is safe for concurrent use.
()
| 33 | // |
| 34 | // It is safe for concurrent use. |
| 35 | func (c *uoCache) Copy() map[string][]driver.UpdateOperation { |
| 36 | m := map[string][]driver.UpdateOperation{} |
| 37 | c.RLock() |
| 38 | defer c.RUnlock() |
| 39 | for u, ops := range c.uo { |
| 40 | o := make([]driver.UpdateOperation, len(ops)) |
| 41 | copy(o, ops) |
| 42 | m[u] = o |
| 43 | } |
| 44 | return m |
| 45 | } |
| 46 | |
| 47 | func newOUCache() *uoCache { |
| 48 | return &uoCache{ |
no outgoing calls