xzmapshared

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shared

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

Map 分片

func New

func New[K comparable, T any]() *Shared[K, T]

func (*Shared[K, T]) CountItems

func (shared *Shared[K, T]) CountItems() int

分片数据量

func (*Shared[K, T]) GetItem

func (shared *Shared[K, T]) GetItem(key K) (mapitem.Item[T], bool)

分片获取值

func (*Shared[K, T]) GetItems

func (shared *Shared[K, T]) GetItems() map[K]mapitem.Item[T]

获取分片值

func (*Shared[K, T]) HasItem

func (shared *Shared[K, T]) HasItem(key K) bool

分片是否存在

func (*Shared[K, T]) RemoveItem

func (shared *Shared[K, T]) RemoveItem(key K) (K, mapitem.Item[T])

分片移除值

func (*Shared[K, T]) SetItem

func (shared *Shared[K, T]) SetItem(key K, value mapitem.Item[T])

分片设置值

Jump to

Keyboard shortcuts

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