syncx

package
v0.93.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package syncx provides synchronized concurrent-safe data structures.

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
}

func (*Map[K, V]) Delete

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

func (*Map[K, V]) Get

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

func (*Map[K, V]) Iterate

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

func (*Map[K, V]) LoadAndDelete added in v0.92.0

func (m *Map[K, V]) LoadAndDelete(key K) (value V, loaded bool)

LoadAndDelete atomically retrieves and removes the value for the given key. It returns the value (if loaded) and whether it was loaded.

func (*Map[K, V]) LoadOrStore added in v0.93.0

func (m *Map[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)

LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.

func (*Map[K, V]) Set

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

Jump to

Keyboard shortcuts

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