Versions in this module Expand all Collapse all v0 v0.0.47 Oct 31, 2023 v0.0.46 Oct 1, 2023 Changes in this version + var ErrReadOnly = errorutil.New("map is currently in read-only mode").WithTag("syncLockMap") + func Clear(mm ...map[K]V) + func DNSToMap(msg *dns.Msg, format string) (m map[string]interface{}) + func Difference(m map[K]V, keys ...K) map[K]V + func Flatten(m map[string]any, separator string) map[string]any + func GetKeys(maps ...map[K]V) []K + func GetSortedKeys(maps ...map[K]V) []K + func GetValues(maps ...map[K]V) []V + func HTTPRequestToMap(req *http.Request) (map[string]interface{}, error) + func HTTPResponseToMap(resp *http.Response) (map[string]interface{}, error) + func HTTPToMap(resp *http.Response, body, headers string, duration time.Duration, ...) (m map[string]interface{}) + func IsEmpty(m map[K]V) bool + func Merge(maps ...map[K]V) (result map[K]V) + func SliceToMap(s []T, dflt T) map[T]T + func Walk(m map[string]any, callback func(k string, v any)) + type Map map[K]V + func (m Map[K, V]) Clear() bool + func (m Map[K, V]) Clone() Map[K, V] + func (m Map[K, V]) Get(key K) (V, bool) + func (m Map[K, V]) GetKeyWithValue(value V) (K, bool) + func (m Map[K, V]) GetKeys(keys ...K) []V + func (m Map[K, V]) GetOrDefault(key K, defaultValue V) V + func (m Map[K, V]) Has(key K) bool + func (m Map[K, V]) IsEmpty() bool + func (m Map[K, V]) Merge(n map[K]V) + func (m Map[K, V]) Set(key K, value V) + type OrderedMap struct + func NewOrderedMap() OrderedMap[k, v] + func (o *OrderedMap[k, v]) Clone() OrderedMap[k, v] + func (o *OrderedMap[k, v]) Delete(key k) + func (o *OrderedMap[k, v]) Get(key k) (v, bool) + func (o *OrderedMap[k, v]) GetByIndex(index int) (v, bool) + func (o *OrderedMap[k, v]) GetKeys() []k + func (o *OrderedMap[k, v]) Has(key k) bool + func (o *OrderedMap[k, v]) IsEmpty() bool + func (o *OrderedMap[k, v]) Iterate(f func(key k, value v) bool) + func (o *OrderedMap[k, v]) Len() int + func (o *OrderedMap[k, v]) Set(key k, value v) + type SyncLockMap struct + Map Map[K, V] + ReadOnly atomic.Bool + func NewSyncLockMap(options ...SyncLockMapOption[K, V]) *SyncLockMap[K, V] + func (s *SyncLockMap[K, V]) Clear() bool + func (s *SyncLockMap[K, V]) Clone() *SyncLockMap[K, V] + func (s *SyncLockMap[K, V]) Delete(k K) + func (s *SyncLockMap[K, V]) Get(k K) (V, bool) + func (s *SyncLockMap[K, V]) GetAll() Map[K, V] + func (s *SyncLockMap[K, V]) GetKeyWithValue(value V) (K, bool) + func (s *SyncLockMap[K, V]) Has(key K) bool + func (s *SyncLockMap[K, V]) IsEmpty() bool + func (s *SyncLockMap[K, V]) Iterate(f func(k K, v V) error) error + func (s *SyncLockMap[K, V]) Lock() + func (s *SyncLockMap[K, V]) Merge(n map[K]V) error + func (s *SyncLockMap[K, V]) Set(k K, v V) error + func (s *SyncLockMap[K, V]) Unlock() + type SyncLockMapOption func(slm *SyncLockMap[K, V]) + func WithMap(m Map[K, V]) SyncLockMapOption[K, V]