safecontainer

package
v0.0.0-...-0012533 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SafeList

type SafeList struct {
	C chan bool
	// contains filtered or unexported fields
}

SafeList 安全链表

func NewSafeList

func NewSafeList() *SafeList

NewSafeList 新创建一个列表

func (*SafeList) IsEmpty

func (sl *SafeList) IsEmpty() bool

IsEmpty 是否为空

func (*SafeList) Pop

func (sl *SafeList) Pop() (interface{}, error)

Pop 拿出

func (*SafeList) Put

func (sl *SafeList) Put(data interface{})

Put 放入

type SafeListNode

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

SafeListNode 节点

type SafeMap

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

SafeMap 线程安全的map,使用读写锁保护,写时阻塞,读时共享

func NewSafeMap

func NewSafeMap() *SafeMap

NewSafeMap 新建一个安全map

func (*SafeMap) Get

func (sm *SafeMap) Get(key interface{}) interface{}

Get 获取

func (*SafeMap) IsExist

func (sm *SafeMap) IsExist(key interface{}) bool

IsExist 是否存在键值

func (*SafeMap) Remove

func (sm *SafeMap) Remove(key interface{})

Remove 删除

func (*SafeMap) Set

func (sm *SafeMap) Set(key interface{}, value interface{})

Set 设置

func (*SafeMap) Travsal

func (sm *SafeMap) Travsal(cb func(interface{}, interface{}))

Travsal 遍历

Jump to

Keyboard shortcuts

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