syncx

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LockMap

type LockMap struct {
	// contains filtered or unexported fields
}

func (*LockMap) Len

func (lm *LockMap) Len() int

func (*LockMap) LoadOrCreate

func (lm *LockMap) LoadOrCreate(key any) *sync.Mutex

func (*LockMap) Lock

func (lm *LockMap) Lock(key any)

func (*LockMap) Unlock

func (lm *LockMap) Unlock(key any)

type Map

type Map[TK any, TV any] struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap[TK any, TV any]() *Map[TK, TV]

func (*Map[TK, TV]) Delete

func (m *Map[TK, TV]) Delete(key TK)

func (*Map[TK, TV]) Load

func (m *Map[TK, TV]) Load(key TK) (TV, bool)

func (*Map[TK, TV]) LoadOrCreate

func (m *Map[TK, TV]) LoadOrCreate(key TK, valueFactory func(TK) TV) (TV, bool)

func (*Map[TK, TV]) LoadOrStore

func (m *Map[TK, TV]) LoadOrStore(key TK, value TV) (TV, bool)

func (*Map[TK, TV]) Store

func (m *Map[TK, TV]) Store(key TK, value TV)

Jump to

Keyboard shortcuts

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