Documentation
¶
Index ¶
- type Map
- func (m *Map[K, V]) AddJson(jsonString string) error
- func (m *Map[K, V]) Cap() int32
- func (m *Map[K, V]) Copy() map[K]V
- func (m *Map[K, V]) Delete(keys ...K)
- func (m *Map[K, V]) Exist(key K) bool
- func (m *Map[K, V]) ExistPut(key K, f func(val *V)) bool
- func (m *Map[K, V]) FilterEmpty()
- func (m *Map[K, V]) FilterNil()
- func (m *Map[K, V]) FilterUniqueValue()
- func (m *Map[K, V]) Flush()
- func (m *Map[K, V]) Get(key K) (V, bool)
- func (m *Map[K, V]) GetKeys() []K
- func (m *Map[K, V]) GetOrDefault(key K, def V) (V, bool)
- func (m *Map[K, V]) GetOrPut(key K, val V) (V, bool)
- func (m *Map[K, V]) GetRand(count int) map[K]V
- func (m *Map[K, V]) GetValues() []V
- func (m *Map[K, V]) IsEmpty() bool
- func (m *Map[K, V]) IsEqual(newM *Map[K, V]) bool
- func (m *Map[K, V]) Json() (string, error)
- func (m *Map[K, V]) Len() int32
- func (m *Map[K, V]) Merge(newM *Map[K, V]) bool
- func (m *Map[K, V]) Pop(count int) map[K]V
- func (m *Map[K, V]) Put(key K, val V) bool
- func (m *Map[K, V]) PutMany(ms map[K]V) bool
- func (m *Map[K, V]) Range(fn func(K, V) bool)
- func (m *Map[K, V]) Result() map[K]V
- func (m *Map[K, V]) Search(fn func(key K, value V) bool) map[K]V
- func (m *Map[K, V]) Turn() map[V]K
- func (m *Map[K, V]) ValueCount(value V) int32
- type MapOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Map ¶
type Map[K comparable, V comparable] struct { // contains filtered or unexported fields }
func New ¶
func New[K comparable, V comparable](opts ...MapOption[K, V]) *Map[K, V]
func (*Map[K, V]) FilterUniqueValue ¶
func (m *Map[K, V]) FilterUniqueValue()
FilterUniqueValue 重复值过滤
func (*Map[K, V]) GetOrDefault ¶
GetOrDefault 获取或得到默认值 @param key K 键 @return val V 值 @return exist bool 是否存在
type MapOption ¶
type MapOption[K comparable, V comparable] func(m *Map[K, V])
func InitCap ¶
func InitCap[K comparable, V comparable](cap int) MapOption[K, V]
func IsUnique ¶
func IsUnique[K comparable, V comparable](isUnique bool) MapOption[K, V]
func LazyShrink ¶
func LazyShrink[K comparable, V comparable](b bool) MapOption[K, V]
Click to show internal directories.
Click to hide internal directories.