IterCb Callback based iterator, cheapest way to read all elements in a map.
(fn IterCb)
| 427 | // IterCb Callback based iterator, cheapest way to read |
| 428 | // all elements in a map. |
| 429 | func (slm ShardLockMaps) IterCb(fn IterCb) { |
| 430 | for idx := range slm.shards { |
| 431 | shard := (slm.shards)[idx] |
| 432 | shard.RLock() |
| 433 | for key, value := range shard.items { |
| 434 | fn(key, value) |
| 435 | } |
| 436 | shard.RUnlock() |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | // MarshalJSON Reviles ConcurrentMap "private" variables to json marshal. |
| 441 | func (slm ShardLockMaps) MarshalJSON() ([]byte, error) { |
no outgoing calls