part

package
v0.28.20240917115209 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTimeoutToLock  = errors.New("ErrTimeoutToLock")
	ErrTimeoutToULock = errors.New("ErrTimeoutToULock")
)

Functions

func Copy added in v0.24.3

func Copy[T comparable, S any](s map[T]S) map[T]S

Types

type LoadOrStoreFunc added in v0.28.20240708182044

type LoadOrStoreFunc[T any] struct {
	Init func() *T
	// contains filtered or unexported fields
}

func (*LoadOrStoreFunc[T]) LoadOrStore added in v0.28.20240708182044

func (l *LoadOrStoreFunc[T]) LoadOrStore(t interface {
	LoadOrStore(k, v any) (actual any, loaded bool)
}, k any) (actual T, loaded bool)

func (*LoadOrStoreFunc[T]) LoadOrStoreP added in v0.28.20240708182044

func (l *LoadOrStoreFunc[T]) LoadOrStoreP(t interface {
	LoadOrStore(k, v any) (actual any, loaded bool)
}, k any) (actual *T, loaded bool)

type Map

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

func (*Map) ClearAll added in v0.26.5

func (t *Map) ClearAll()

func (*Map) Copy added in v0.24.2

func (t *Map) Copy() (m Map)

func (*Map) CopyP added in v0.28.20240708182044

func (t *Map) CopyP() (m *Map)

func (*Map) Delete

func (t *Map) Delete(k any) (ok bool)

func (*Map) Len

func (t *Map) Len() int

func (*Map) Load

func (t *Map) Load(k any) (any, bool)

func (*Map) LoadOrStore added in v0.28.1

func (t *Map) LoadOrStore(k, v any) (actual any, loaded bool)

func (*Map) LoadV

func (t *Map) LoadV(k any) (v any)

func (*Map) Range

func (t *Map) Range(f func(key, value any) bool)

func (*Map) Store

func (t *Map) Store(k, v any)

type MapExceeded added in v0.27.13

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

func (*MapExceeded[K, V]) Copy added in v0.28.20240501064531

func (t *MapExceeded[K, V]) Copy() (m *MapExceeded[K, V])

func (*MapExceeded[K, V]) Delete added in v0.27.13

func (t *MapExceeded[K, V]) Delete(k K)

func (*MapExceeded[K, V]) GC added in v0.27.13

func (t *MapExceeded[K, V]) GC()

func (*MapExceeded[K, V]) Len added in v0.27.13

func (t *MapExceeded[K, V]) Len() int

func (*MapExceeded[K, V]) Load added in v0.27.13

func (t *MapExceeded[K, V]) Load(k K) (v V, ok bool)

func (*MapExceeded[K, V]) LoadOrStore added in v0.28.20240501061452

func (t *MapExceeded[K, V]) LoadOrStore(k K) (vr V, loaded bool, store func(v1 V, dur time.Duration))

func (*MapExceeded[K, V]) Range added in v0.27.13

func (t *MapExceeded[K, V]) Range(f func(key K, value *V) bool)

func (*MapExceeded[K, V]) Store added in v0.27.13

func (t *MapExceeded[K, V]) Store(k K, v V, dur time.Duration)

type RWMutex added in v0.26.3

type RWMutex struct {
	PanicFunc func(any)
	// contains filtered or unexported fields
}

func (*RWMutex) Lock added in v0.26.3

func (m *RWMutex) Lock(to ...time.Duration) (unlockf func(beforeUlock ...func()))

to[0]: wait lock timeout

to[1]: wait ulock timeout

func (*RWMutex) RLock added in v0.26.3

func (m *RWMutex) RLock(to ...time.Duration) (unlockf func(beforeUlock ...func()))

to[0]: wait lock timeout

to[1]: wait ulock timeout

不要在Rlock内设置变量,有DATA RACE风险

Jump to

Keyboard shortcuts

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