threadsafe

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 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 Map

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

Map is a thread-safe map implementation.

func NewMap

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

NewMap creates a new thread-safe map.

func (*Map[K, V]) Get

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

Get retrieves a value by key from the map.

func (*Map[K, V]) Range

func (m *Map[K, V]) Range(fn func(K, V) bool)

Range iterates over all key-value pairs in the map. The iteration stops if the provided function returns false.

func (*Map[K, V]) Set

func (m *Map[K, V]) Set(key K, value V)

Set adds or updates a key-value pair in the map.

Jump to

Keyboard shortcuts

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