| 29 | ) |
| 30 | |
| 31 | type SyncStructure[K comparable, V any] interface { |
| 32 | Lock() |
| 33 | RLock() |
| 34 | Unlock() |
| 35 | RUnlock() |
| 36 | |
| 37 | GetMap() map[K]V |
| 38 | |
| 39 | GetKeys() []K // Not thread safe |
| 40 | GetValues() []V // Not thread safe |
| 41 | Set(key K, value V) // Not thread safe |
| 42 | Get(key K) (V, bool) // Not thread safe |
| 43 | GetNoCheck(key K) V // Not thread safe |
| 44 | Remove(key K) // Not thread safe |
| 45 | Present(key K) bool // Not thread safe |
| 46 | |
| 47 | AtomicSet(key K, value V) |
| 48 | AtomicGet(key K) (V, bool) |
| 49 | AtomicGetNoCheck(key K) V |
| 50 | AtomicRemove(key K) |
| 51 | |
| 52 | Len() int // Atomic operation |
| 53 | AtomicLen() int // Atomic operation |
| 54 | } |
| 55 | |
| 56 | type Structure[K comparable, V any] struct { |
| 57 | InternalMap map[K]V |
no outgoing calls
no test coverage detected