concurrentmap

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 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 ConcurrentMap

type ConcurrentMap interface {
	// Store sets the value for a key.
	Store(key, value interface{})

	// Load returns the value stored in the map for a key, or nil if no
	Load(key interface{}) (value interface{}, ok bool)

	// LoadOrStore returns the existing value for the key if present.
	LoadOrStore(key, value interface{}) (actual interface{}, loaded bool)

	// LoadAndDelete deletes the value for a key, returning the previous value if any.
	LoadAndDelete(key interface{}) (value interface{}, loaded bool)

	// Delete deletes the value for a key.
	Delete(key interface{})

	// Range calls f sequentially for each key and value present in the map.
	Range(f func(key, value interface{}) bool)

	// Clear deletes all elements from the map.
	Clear()

	// Len returns the number of elements within the map.
	Len() int

	// Keys returns all keys in the map.
	Keys() []interface{}
}

func NewConcurrentMap

func NewConcurrentMap() ConcurrentMap

Jump to

Keyboard shortcuts

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