sync

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 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 Map

type Map[K comparable, V any] struct {
	// contains filtered or unexported fields
}

Map holds typed data with sync.RWMutex guard for concurrency

func NewMap

func NewMap[K comparable, V any]() *Map[K, V]

NewMap create a new thread-safe concurrent map

func (*Map[K, V]) Data

func (in *Map[K, V]) Data() map[K]V

Data return a full copy of underlying

func (*Map[K, V]) Del

func (in *Map[K, V]) Del(key K)

Del delete value for given key

func (*Map[K, V]) Get

func (in *Map[K, V]) Get(key K) (V, bool)

Get return value for given key and the existence flag

func (*Map[K, V]) Set

func (in *Map[K, V]) Set(key K, val V)

Set write value for given key

Jump to

Keyboard shortcuts

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