shardMap

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KT added in v0.3.0

type KT interface {
	comparable
}

type MapShards

type MapShards[K KT, V VT] []*ShardMap[K, V]

MapShards 基于分段锁的并发安全map map sharding分片 After init read only

func New

func New[K KT, V VT](c ...int) MapShards[K, V]

New c: the number of shard map you want to create in init;Default value 32 hash func : FNV64

func (MapShards[K, V]) Del

func (ms MapShards[K, V]) Del(k K)

func (MapShards[K, V]) Get

func (ms MapShards[K, V]) Get(k K) (V, bool)

func (MapShards[K, V]) Keys

func (ms MapShards[K, V]) Keys() []K

func (MapShards[K, V]) Len

func (ms MapShards[K, V]) Len() int

func (MapShards[K, V]) Set

func (ms MapShards[K, V]) Set(k K, v V)

type ShardMap

type ShardMap[K KT, V VT] struct {
	// contains filtered or unexported fields
}

ShardMap map key only not support to struct and object

type VT added in v0.3.0

type VT interface {
	any
}

Jump to

Keyboard shortcuts

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