generic

package
v0.0.0-...-503c688 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 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 SyncMap

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

SyncMap is the generic version of the sync.Map.

func NewSyncMap

func NewSyncMap[K comparable, V any](capacity int) SyncMap[K, V]

NewSyncMap returns a new SyncMap.

func (*SyncMap[K, V]) Delete

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

Delete deletes a key value.

func (*SyncMap[K, V]) Keys

func (m *SyncMap[K, V]) Keys() []K

Keys returns all the keys in the map.

func (*SyncMap[K, V]) Load

func (m *SyncMap[K, V]) Load(key K) (V, bool)

Load loads a key value.

func (*SyncMap[K, V]) Store

func (m *SyncMap[K, V]) Store(key K, value V)

Store stores a value.

Jump to

Keyboard shortcuts

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