maps

package
v0.0.0-...-3b8fdc3 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MergeMap

func MergeMap(dest, src map[interface{}]interface{}) map[interface{}]interface{}

MergeMap desc: 合并源 map 到目标 map

Types

type ConcurrencyRwMap

type ConcurrencyRwMap struct {
	Map map[interface{}]interface{}
	sync.RWMutex
}

func NewConcurrencyRwMap

func NewConcurrencyRwMap(capacity int) *ConcurrencyRwMap

NewConcurrencyRwMap 加锁实现map并发安全,缺点锁的粒度大

func (*ConcurrencyRwMap) Delete

func (m *ConcurrencyRwMap) Delete(key interface{})

Delete 删

func (*ConcurrencyRwMap) Get

func (m *ConcurrencyRwMap) Get(key interface{}) interface{}

Get 读

func (*ConcurrencyRwMap) Set

func (m *ConcurrencyRwMap) Set(key interface{}, value interface{})

Set 写入 或者 更新

Jump to

Keyboard shortcuts

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