syncmap

package module
v0.0.0-...-49b3bd4 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SyncMap

type SyncMap[K goutil.Hashable, V any] struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap[K goutil.Hashable, V any]() *SyncMap[K, V]

func (*SyncMap[K, V]) Del

func (syncmap *SyncMap[K, V]) Del(key K)

Del removes an item by key

func (*SyncMap[K, V]) ForEach

func (syncmap *SyncMap[K, V]) ForEach(cb func(key K, value V) bool)

ForEach runs a callback function for each key value pair

in the callback, return true to continue, and false to break the loop

func (*SyncMap[K, V]) Get

func (syncmap *SyncMap[K, V]) Get(key K) (V, bool)

Get returns a value or an error if it exists

func (*SyncMap[K, V]) Has

func (syncmap *SyncMap[K, V]) Has(key K) bool

Has returns true if a key value exists in the list

func (*SyncMap[K, V]) Set

func (syncmap *SyncMap[K, V]) Set(key K, value V)

Set sets or adds a new key with a value

Jump to

Keyboard shortcuts

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