Values returns a slice with all of the current store values.
()
| 124 | |
| 125 | // Values returns a slice with all of the current store values. |
| 126 | func (s *Store[K, T]) Values() []T { |
| 127 | s.mu.RLock() |
| 128 | defer s.mu.RUnlock() |
| 129 | |
| 130 | var values = make([]T, 0, len(s.data)) |
| 131 | |
| 132 | for _, v := range s.data { |
| 133 | values = append(values, v) |
| 134 | } |
| 135 | |
| 136 | return values |
| 137 | } |
| 138 | |
| 139 | // Set sets (or overwrite if already exists) a new value for key. |
| 140 | func (s *Store[K, T]) Set(key K, value T) { |
no outgoing calls