gmap

package
v1.2024.116 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

并发安全的哈希MAP.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntBoolMap

type IntBoolMap struct {
	// contains filtered or unexported fields
}

func NewIntBoolMap

func NewIntBoolMap() *IntBoolMap

func (*IntBoolMap) BatchRemove

func (this *IntBoolMap) BatchRemove(keys []int)

批量删除键值对

func (*IntBoolMap) BatchSet

func (this *IntBoolMap) BatchSet(m map[int]bool)

批量设置键值对

func (*IntBoolMap) Clear

func (this *IntBoolMap) Clear()

清空哈希表

func (*IntBoolMap) Clone

func (this *IntBoolMap) Clone() *map[int]bool

哈希表克隆

func (*IntBoolMap) Contains

func (this *IntBoolMap) Contains(key int) bool

是否存在某个键

func (*IntBoolMap) Get

func (this *IntBoolMap) Get(key int) bool

获取键值

func (*IntBoolMap) GetAndRemove

func (this *IntBoolMap) GetAndRemove(key int) bool

返回对应的键值,并删除该键值

func (*IntBoolMap) IsEmpty

func (this *IntBoolMap) IsEmpty() bool

哈希表是否为空

func (*IntBoolMap) Iterator

func (this *IntBoolMap) Iterator(f func(k int, v bool))

给定回调函数对原始内容进行遍历

func (*IntBoolMap) Keys

func (this *IntBoolMap) Keys() []int

返回键列表

func (*IntBoolMap) Remove

func (this *IntBoolMap) Remove(key int)

删除键值对

func (*IntBoolMap) Set

func (this *IntBoolMap) Set(key int, val bool)

设置键值对

func (*IntBoolMap) Size

func (this *IntBoolMap) Size() int

哈希表大小

type IntIntMap

type IntIntMap struct {
	// contains filtered or unexported fields
}

func NewIntIntMap

func NewIntIntMap() *IntIntMap

func (*IntIntMap) BatchRemove

func (this *IntIntMap) BatchRemove(keys []int)

批量删除键值对

func (*IntIntMap) BatchSet

func (this *IntIntMap) BatchSet(m map[int]int)

批量设置键值对

func (*IntIntMap) Clear

func (this *IntIntMap) Clear()

清空哈希表

func (*IntIntMap) Clone

func (this *IntIntMap) Clone() *map[int]int

哈希表克隆

func (*IntIntMap) Contains

func (this *IntIntMap) Contains(key int) bool

是否存在某个键

func (*IntIntMap) Get

func (this *IntIntMap) Get(key int) int

获取键值

func (*IntIntMap) GetAndRemove

func (this *IntIntMap) GetAndRemove(key int) int

返回对应的键值,并删除该键值

func (*IntIntMap) IsEmpty

func (this *IntIntMap) IsEmpty() bool

哈希表是否为空

func (*IntIntMap) Iterator

func (this *IntIntMap) Iterator(f func(k int, v int))

给定回调函数对原始内容进行遍历

func (*IntIntMap) Keys

func (this *IntIntMap) Keys() []int

返回键列表

func (*IntIntMap) Remove

func (this *IntIntMap) Remove(key int)

删除键值对

func (*IntIntMap) Set

func (this *IntIntMap) Set(key int, val int)

设置键值对

func (*IntIntMap) Size

func (this *IntIntMap) Size() int

哈希表大小

func (*IntIntMap) Values

func (this *IntIntMap) Values() []int

返回值列表(注意是随机排序)

type IntInterfaceMap

type IntInterfaceMap struct {
	// contains filtered or unexported fields
}

func NewIntInterfaceMap

func NewIntInterfaceMap() *IntInterfaceMap

func (*IntInterfaceMap) BatchRemove

func (this *IntInterfaceMap) BatchRemove(keys []int)

批量删除键值对

func (*IntInterfaceMap) BatchSet

func (this *IntInterfaceMap) BatchSet(m map[int]interface{})

批量设置键值对

func (*IntInterfaceMap) Clear

func (this *IntInterfaceMap) Clear()

清空哈希表

func (*IntInterfaceMap) Clone

func (this *IntInterfaceMap) Clone() *map[int]interface{}

哈希表克隆

func (*IntInterfaceMap) Contains

func (this *IntInterfaceMap) Contains(key int) bool

是否存在某个键

func (*IntInterfaceMap) Get

func (this *IntInterfaceMap) Get(key int) interface{}

获取键值

func (*IntInterfaceMap) GetAndRemove

func (this *IntInterfaceMap) GetAndRemove(key int) interface{}

返回对应的键值,并删除该键值

func (*IntInterfaceMap) GetBool

func (this *IntInterfaceMap) GetBool(key int) bool

func (*IntInterfaceMap) GetFloat32

func (this *IntInterfaceMap) GetFloat32(key int) float32

func (*IntInterfaceMap) GetFloat64

func (this *IntInterfaceMap) GetFloat64(key int) float64

func (*IntInterfaceMap) GetInt

func (this *IntInterfaceMap) GetInt(key int) int

func (*IntInterfaceMap) GetString

func (this *IntInterfaceMap) GetString(key int) string

func (*IntInterfaceMap) GetUint

func (this *IntInterfaceMap) GetUint(key int) uint

func (*IntInterfaceMap) IsEmpty

func (this *IntInterfaceMap) IsEmpty() bool

哈希表是否为空

func (*IntInterfaceMap) Iterator

func (this *IntInterfaceMap) Iterator(f func(k int, v interface{}))

给定回调函数对原始内容进行遍历

func (*IntInterfaceMap) Keys

func (this *IntInterfaceMap) Keys() []int

返回键列表

func (*IntInterfaceMap) Remove

func (this *IntInterfaceMap) Remove(key int)

删除键值对

func (*IntInterfaceMap) Set

func (this *IntInterfaceMap) Set(key int, val interface{})

设置键值对

func (*IntInterfaceMap) Size

func (this *IntInterfaceMap) Size() int

哈希表大小

func (*IntInterfaceMap) Values

func (this *IntInterfaceMap) Values() []interface{}

返回值列表(注意是随机排序)

type IntStringMap

type IntStringMap struct {
	// contains filtered or unexported fields
}

func NewIntStringMap

func NewIntStringMap() *IntStringMap

func (*IntStringMap) BatchRemove

func (this *IntStringMap) BatchRemove(keys []int)

批量删除键值对

func (*IntStringMap) BatchSet

func (this *IntStringMap) BatchSet(m map[int]string)

批量设置键值对

func (*IntStringMap) Clear

func (this *IntStringMap) Clear()

清空哈希表

func (*IntStringMap) Clone

func (this *IntStringMap) Clone() *map[int]string

哈希表克隆

func (*IntStringMap) Contains

func (this *IntStringMap) Contains(key int) bool

是否存在某个键

func (*IntStringMap) Get

func (this *IntStringMap) Get(key int) string

获取键值

func (*IntStringMap) GetAndRemove

func (this *IntStringMap) GetAndRemove(key int) string

返回对应的键值,并删除该键值

func (*IntStringMap) IsEmpty

func (this *IntStringMap) IsEmpty() bool

哈希表是否为空

func (*IntStringMap) Iterator

func (this *IntStringMap) Iterator(f func(k int, v string))

给定回调函数对原始内容进行遍历

func (*IntStringMap) Keys

func (this *IntStringMap) Keys() []int

返回键列表

func (*IntStringMap) Remove

func (this *IntStringMap) Remove(key int)

删除键值对

func (*IntStringMap) Set

func (this *IntStringMap) Set(key int, val string)

设置键值对

func (*IntStringMap) Size

func (this *IntStringMap) Size() int

哈希表大小

func (*IntStringMap) Values

func (this *IntStringMap) Values() []string

返回值列表(注意是随机排序)

type InterfaceInterfaceMap

type InterfaceInterfaceMap struct {
	// contains filtered or unexported fields
}

func NewInterfaceInterfaceMap

func NewInterfaceInterfaceMap() *InterfaceInterfaceMap

func (*InterfaceInterfaceMap) BatchRemove

func (this *InterfaceInterfaceMap) BatchRemove(keys []interface{})

批量删除键值对

func (*InterfaceInterfaceMap) BatchSet

func (this *InterfaceInterfaceMap) BatchSet(m map[interface{}]interface{})

批量设置键值对

func (*InterfaceInterfaceMap) Clear

func (this *InterfaceInterfaceMap) Clear()

清空哈希表

func (*InterfaceInterfaceMap) Clone

func (this *InterfaceInterfaceMap) Clone() *map[interface{}]interface{}

哈希表克隆

func (*InterfaceInterfaceMap) Contains

func (this *InterfaceInterfaceMap) Contains(key interface{}) bool

是否存在某个键

func (*InterfaceInterfaceMap) Get

func (this *InterfaceInterfaceMap) Get(key interface{}) interface{}

获取键值

func (*InterfaceInterfaceMap) GetAndRemove

func (this *InterfaceInterfaceMap) GetAndRemove(key interface{}) interface{}

返回对应的键值,并删除该键值

func (*InterfaceInterfaceMap) GetBool

func (this *InterfaceInterfaceMap) GetBool(key interface{}) bool

func (*InterfaceInterfaceMap) GetFloat32

func (this *InterfaceInterfaceMap) GetFloat32(key interface{}) float32

func (*InterfaceInterfaceMap) GetFloat64

func (this *InterfaceInterfaceMap) GetFloat64(key interface{}) float64

func (*InterfaceInterfaceMap) GetInt

func (this *InterfaceInterfaceMap) GetInt(key interface{}) int

func (*InterfaceInterfaceMap) GetString

func (this *InterfaceInterfaceMap) GetString(key interface{}) string

func (*InterfaceInterfaceMap) GetUint

func (this *InterfaceInterfaceMap) GetUint(key interface{}) uint

func (*InterfaceInterfaceMap) IsEmpty

func (this *InterfaceInterfaceMap) IsEmpty() bool

哈希表是否为空

func (*InterfaceInterfaceMap) Iterator

func (this *InterfaceInterfaceMap) Iterator(f func(k interface{}, v interface{}))

给定回调函数对原始内容进行遍历

func (*InterfaceInterfaceMap) Keys

func (this *InterfaceInterfaceMap) Keys() []interface{}

返回键列表

func (*InterfaceInterfaceMap) Remove

func (this *InterfaceInterfaceMap) Remove(key interface{})

删除键值对

func (*InterfaceInterfaceMap) Set

func (this *InterfaceInterfaceMap) Set(key interface{}, val interface{})

设置键值对

func (*InterfaceInterfaceMap) Size

func (this *InterfaceInterfaceMap) Size() int

哈希表大小

func (*InterfaceInterfaceMap) Values

func (this *InterfaceInterfaceMap) Values() []interface{}

返回值列表(注意是随机排序)

type StringBoolMap

type StringBoolMap struct {
	// contains filtered or unexported fields
}

func NewStringBoolMap

func NewStringBoolMap() *StringBoolMap

func (*StringBoolMap) BatchRemove

func (this *StringBoolMap) BatchRemove(keys []string)

批量删除键值对

func (*StringBoolMap) BatchSet

func (this *StringBoolMap) BatchSet(m map[string]bool)

批量设置键值对

func (*StringBoolMap) Clear

func (this *StringBoolMap) Clear()

清空哈希表

func (*StringBoolMap) Clone

func (this *StringBoolMap) Clone() *map[string]bool

哈希表克隆

func (*StringBoolMap) Contains

func (this *StringBoolMap) Contains(key string) bool

是否存在某个键

func (*StringBoolMap) Get

func (this *StringBoolMap) Get(key string) bool

获取键值

func (*StringBoolMap) GetAndRemove

func (this *StringBoolMap) GetAndRemove(key string) bool

返回对应的键值,并删除该键值

func (*StringBoolMap) IsEmpty

func (this *StringBoolMap) IsEmpty() bool

哈希表是否为空

func (*StringBoolMap) Iterator

func (this *StringBoolMap) Iterator(f func(k string, v bool))

给定回调函数对原始内容进行遍历

func (*StringBoolMap) Keys

func (this *StringBoolMap) Keys() []string

返回键列表

func (*StringBoolMap) Remove

func (this *StringBoolMap) Remove(key string)

删除键值对

func (*StringBoolMap) Set

func (this *StringBoolMap) Set(key string, val bool)

设置键值对

func (*StringBoolMap) Size

func (this *StringBoolMap) Size() int

哈希表大小

type StringIntMap

type StringIntMap struct {
	// contains filtered or unexported fields
}

func NewStringIntMap

func NewStringIntMap() *StringIntMap

func (*StringIntMap) BatchRemove

func (this *StringIntMap) BatchRemove(keys []string)

批量删除键值对

func (*StringIntMap) BatchSet

func (this *StringIntMap) BatchSet(m map[string]int)

批量设置键值对

func (*StringIntMap) Clear

func (this *StringIntMap) Clear()

清空哈希表

func (*StringIntMap) Clone

func (this *StringIntMap) Clone() *map[string]int

哈希表克隆

func (*StringIntMap) Contains

func (this *StringIntMap) Contains(key string) bool

是否存在某个键

func (*StringIntMap) Get

func (this *StringIntMap) Get(key string) int

获取键值

func (*StringIntMap) GetAndRemove

func (this *StringIntMap) GetAndRemove(key string) int

返回对应的键值,并删除该键值

func (*StringIntMap) IsEmpty

func (this *StringIntMap) IsEmpty() bool

哈希表是否为空

func (*StringIntMap) Iterator

func (this *StringIntMap) Iterator(f func(k string, v int))

给定回调函数对原始内容进行遍历

func (*StringIntMap) Keys

func (this *StringIntMap) Keys() []string

返回键列表

func (*StringIntMap) Remove

func (this *StringIntMap) Remove(key string)

删除键值对

func (*StringIntMap) Set

func (this *StringIntMap) Set(key string, val int)

设置键值对

func (*StringIntMap) Size

func (this *StringIntMap) Size() int

哈希表大小

func (*StringIntMap) Values

func (this *StringIntMap) Values() []int

返回值列表(注意是随机排序)

type StringInterfaceMap

type StringInterfaceMap struct {
	// contains filtered or unexported fields
}

func NewStringInterfaceMap

func NewStringInterfaceMap() *StringInterfaceMap

func (*StringInterfaceMap) BatchRemove

func (this *StringInterfaceMap) BatchRemove(keys []string)

批量删除键值对

func (*StringInterfaceMap) BatchSet

func (this *StringInterfaceMap) BatchSet(m map[string]interface{})

批量设置键值对

func (*StringInterfaceMap) Clear

func (this *StringInterfaceMap) Clear()

清空哈希表

func (*StringInterfaceMap) Clone

func (this *StringInterfaceMap) Clone() *map[string]interface{}

哈希表克隆

func (*StringInterfaceMap) Contains

func (this *StringInterfaceMap) Contains(key string) bool

是否存在某个键

func (*StringInterfaceMap) Get

func (this *StringInterfaceMap) Get(key string) interface{}

获取键值

func (*StringInterfaceMap) GetAndRemove

func (this *StringInterfaceMap) GetAndRemove(key string) interface{}

返回对应的键值,并删除该键值

func (*StringInterfaceMap) GetBool

func (this *StringInterfaceMap) GetBool(key string) bool

func (*StringInterfaceMap) GetFloat32

func (this *StringInterfaceMap) GetFloat32(key string) float32

func (*StringInterfaceMap) GetFloat64

func (this *StringInterfaceMap) GetFloat64(key string) float64

func (*StringInterfaceMap) GetInt

func (this *StringInterfaceMap) GetInt(key string) int

func (*StringInterfaceMap) GetString

func (this *StringInterfaceMap) GetString(key string) string

func (*StringInterfaceMap) GetUint

func (this *StringInterfaceMap) GetUint(key string) uint

func (*StringInterfaceMap) IsEmpty

func (this *StringInterfaceMap) IsEmpty() bool

哈希表是否为空

func (*StringInterfaceMap) Iterator

func (this *StringInterfaceMap) Iterator(f func(k string, v interface{}))

给定回调函数对原始内容进行遍历

func (*StringInterfaceMap) Keys

func (this *StringInterfaceMap) Keys() []string

返回键列表

func (*StringInterfaceMap) Remove

func (this *StringInterfaceMap) Remove(key string)

删除键值对

func (*StringInterfaceMap) Set

func (this *StringInterfaceMap) Set(key string, val interface{})

设置键值对

func (*StringInterfaceMap) Size

func (this *StringInterfaceMap) Size() int

哈希表大小

func (*StringInterfaceMap) Values

func (this *StringInterfaceMap) Values() []interface{}

返回值列表(注意是随机排序)

type StringStringMap

type StringStringMap struct {
	// contains filtered or unexported fields
}

func NewStringStringMap

func NewStringStringMap() *StringStringMap

func (*StringStringMap) BatchRemove

func (this *StringStringMap) BatchRemove(keys []string)

批量删除键值对

func (*StringStringMap) BatchSet

func (this *StringStringMap) BatchSet(m map[string]string)

批量设置键值对

func (*StringStringMap) Clear

func (this *StringStringMap) Clear()

清空哈希表

func (*StringStringMap) Clone

func (this *StringStringMap) Clone() *map[string]string

哈希表克隆

func (*StringStringMap) Contains

func (this *StringStringMap) Contains(key string) bool

是否存在某个键

func (*StringStringMap) Get

func (this *StringStringMap) Get(key string) string

获取键值

func (*StringStringMap) GetAndRemove

func (this *StringStringMap) GetAndRemove(key string) string

返回对应的键值,并删除该键值

func (*StringStringMap) IsEmpty

func (this *StringStringMap) IsEmpty() bool

哈希表是否为空

func (*StringStringMap) Iterator

func (this *StringStringMap) Iterator(f func(k string, v string))

给定回调函数对原始内容进行遍历

func (*StringStringMap) Keys

func (this *StringStringMap) Keys() []string

返回键列表

func (*StringStringMap) Remove

func (this *StringStringMap) Remove(key string)

删除键值对

func (*StringStringMap) Set

func (this *StringStringMap) Set(key string, val string)

设置键值对

func (*StringStringMap) Size

func (this *StringStringMap) Size() int

哈希表大小

func (*StringStringMap) Values

func (this *StringStringMap) Values() []string

返回值列表(注意是随机排序)

type UintInterfaceMap

type UintInterfaceMap struct {
	// contains filtered or unexported fields
}

func NewUintInterfaceMap

func NewUintInterfaceMap() *UintInterfaceMap

func (*UintInterfaceMap) BatchRemove

func (this *UintInterfaceMap) BatchRemove(keys []uint)

批量删除键值对

func (*UintInterfaceMap) BatchSet

func (this *UintInterfaceMap) BatchSet(m map[uint]interface{})

批量设置键值对

func (*UintInterfaceMap) Clear

func (this *UintInterfaceMap) Clear()

清空哈希表

func (*UintInterfaceMap) Clone

func (this *UintInterfaceMap) Clone() *map[uint]interface{}

哈希表克隆

func (*UintInterfaceMap) Contains

func (this *UintInterfaceMap) Contains(key uint) bool

是否存在某个键

func (*UintInterfaceMap) Get

func (this *UintInterfaceMap) Get(key uint) interface{}

获取键值

func (*UintInterfaceMap) GetAndRemove

func (this *UintInterfaceMap) GetAndRemove(key uint) interface{}

返回对应的键值,并删除该键值

func (*UintInterfaceMap) GetBool

func (this *UintInterfaceMap) GetBool(key uint) bool

func (*UintInterfaceMap) GetFloat32

func (this *UintInterfaceMap) GetFloat32(key uint) float32

func (*UintInterfaceMap) GetFloat64

func (this *UintInterfaceMap) GetFloat64(key uint) float64

func (*UintInterfaceMap) GetInt

func (this *UintInterfaceMap) GetInt(key uint) int

func (*UintInterfaceMap) GetString

func (this *UintInterfaceMap) GetString(key uint) string

func (*UintInterfaceMap) GetUint

func (this *UintInterfaceMap) GetUint(key uint) uint

func (*UintInterfaceMap) IsEmpty

func (this *UintInterfaceMap) IsEmpty() bool

哈希表是否为空

func (*UintInterfaceMap) Iterator

func (this *UintInterfaceMap) Iterator(f func(k uint, v interface{}))

func (*UintInterfaceMap) Keys

func (this *UintInterfaceMap) Keys() []uint

返回键列表

func (*UintInterfaceMap) Remove

func (this *UintInterfaceMap) Remove(key uint)

删除键值对

func (*UintInterfaceMap) Set

func (this *UintInterfaceMap) Set(key uint, val interface{})

设置键值对

func (*UintInterfaceMap) Size

func (this *UintInterfaceMap) Size() int

哈希表大小

func (*UintInterfaceMap) Values

func (this *UintInterfaceMap) Values() []interface{}

返回值列表(注意是随机排序)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL