Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockingQueue ¶ added in v0.0.2
type BlockingQueue[T any] interface { Push(T) Pop() (item T, shutdown bool) Size() int Empty() bool Shutdown() ShutdownWithDrained() }
func NewBlockingQueue ¶ added in v0.0.2
func NewBlockingQueue[T any]() BlockingQueue[T]
func NewBlockingQueueWithConfig ¶ added in v0.0.2
func NewBlockingQueueWithConfig[T any](queue Queue[T]) BlockingQueue[T]
type ConcurrentMap ¶
type ConcurrentMap[K comparable, V any] interface { Set(key K, v V) Get(key K) (V, bool) GetBatch(keys []K) []V Delete(key K) Has(key K) bool Keys() []K KeysSet() Set[K] Values() []V Merge(ConcurrentMap[K, V]) Clone() ConcurrentMap[K, V] ToMap() map[K]V MergeMap(map[K]V) Len() int }
func NewConcurrentMap ¶
func NewConcurrentMap[K comparable, V any]() ConcurrentMap[K, V]
func NewConcurrentMapFromMap ¶
func NewConcurrentMapFromMap[K comparable, V any](m map[K]V) ConcurrentMap[K, V]
type DelayingQueue ¶ added in v0.0.2
type DelayingQueue[T any] interface { BlockingQueue[T] PushAfter(T, time.Duration) Shutdown() }
func NewDelayingQueue ¶ added in v0.0.2
func NewDelayingQueue[T any](blocking BlockingQueue[T], scheduler TimerScheduler) DelayingQueue[T]
type ExpirationMap ¶ added in v0.0.2
type ExpirationMap[K comparable, V any] interface { ConcurrentMap[K, V] SetExpired(key K, val V, duration time.Duration) Destroy() }
func NewExpirationMap ¶ added in v0.0.2
func NewExpirationMap[K comparable, V any](opts ...ExpirationMapOption[K, V]) ExpirationMap[K, V]
type ExpirationMapOption ¶ added in v0.0.2
type ExpirationMapOption[K comparable, V any] func(c *expirationMap[K, V])
func WithCleanDuration ¶ added in v0.0.2
func WithCleanDuration[K comparable, V any](duration time.Duration) ExpirationMapOption[K, V]
func WithConcurrentMap ¶ added in v0.0.2
func WithConcurrentMap[K comparable, V any](cm ConcurrentMap[K, V]) ExpirationMapOption[K, V]
type PLM ¶
type PLM[K comparable, V any] interface { // Pointer 获取地址 Pointer() uintptr // RWLock 获取内部的RWMutex RWLock() *sync.RWMutex // InnerMap 获取内部map InnerMap() map[K]V }
type Queue ¶ added in v0.0.2
func NewPriorityQueue ¶ added in v0.0.2
type Set ¶
type Set[V comparable] interface { Add(v V) Adds(v ...V) AddSet(s Set[V]) Has(v V) bool Delete(v V) Values() []V Any([]V) bool Every([]V) bool ForEach(func(v V)) ForEachP(func(v *V)) Len() int Iterator() iter.Seq[V] }
func NewSet ¶
func NewSet[V comparable]() Set[V]
func NewSetFromSlice ¶
func NewSetFromSlice[V comparable](s []V) Set[V]
Click to show internal directories.
Click to hide internal directories.