mutexmap

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWMap

type RWMap[K comparable, V any] struct {
	sync.RWMutex // 读写锁保护下面的map字段
	// contains filtered or unexported fields
}

func NewRWMap

func NewRWMap[K comparable, V any](n int) *RWMap[K, V]

新建一个RWMap

func (*RWMap[K, V]) Delete

func (m *RWMap[K, V]) Delete(k K)

func (*RWMap[K, V]) Each

func (m *RWMap[K, V]) Each(f func(k K, v V) bool)

func (*RWMap[K, V]) Get

func (m *RWMap[K, V]) Get(k K) (V, bool)

func (*RWMap[K, V]) Len

func (m *RWMap[K, V]) Len() int

func (*RWMap[K, V]) Set

func (m *RWMap[K, V]) Set(k K, v V)

Jump to

Keyboard shortcuts

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