syncedmap

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncedMap

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

SyncedMap represents a generic hashmap that is safe to use concurrently.

func New

func New[K comparable, V any]() *SyncedMap[K, V]

New returns a new Map.

func (*SyncedMap[K, V]) Load

func (sm *SyncedMap[K, V]) Load(key K) (V, bool)

Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.

func (*SyncedMap[K, V]) Store

func (sm *SyncedMap[K, V]) Store(key K, value V)

Store sets the value for a key.

Jump to

Keyboard shortcuts

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