syncmap

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 1 Imported by: 1

Documentation

Overview

Package syncmap implements a generic thread safe map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RWMap

type RWMap[K comparable, V any] struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

RWMap a thread safe map protected by RWLock.

func NewRWMap

func NewRWMap[K comparable, V any](n int) *RWMap[K, V]

func (*RWMap[K, V]) Delete

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

func (*RWMap[K, V]) Each

func (m *RWMap[K, V]) Each(f func(key K, value V) bool)

func (*RWMap[K, V]) Get

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

func (*RWMap[K, V]) Len

func (m *RWMap[K, V]) Len() int

func (*RWMap[K, V]) Set

func (m *RWMap[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