kv

package
v0.0.0-...-6ee6613 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fast16WayHashMatch

func Fast16WayHashMatch(md *[16]int8, hash int8) uint16

Fast16WayHashMatch performs a 16-way linear probing of short hash (h2, metadata) list by SSE instructions short hash list must be an aligned pointer

Types

type Closable

type Closable interface {
	io.Closer
}

type Hasher

type Hasher[K comparable] struct {
	// contains filtered or unexported fields
}

func (Hasher[K]) Hash

func (h Hasher[K]) Hash(key K) uint64

type Map

type Map[K comparable, V any] interface {
	Put(key K, val V) error
	Get(key K) (item V, exists bool)
	Delete(key K) (V, error)
	Foreach(action func(i uint64, key K, val V) (_continue bool))
	MigrateFrom(m map[K]V) error
	Clear()
	Len() int64
}

func NewSwissMap

func NewSwissMap[K comparable, V any](capacity uint32) Map[K, V]

type SafeStoreKeyFilterFunc

type SafeStoreKeyFilterFunc[K comparable] func(key K) bool

type ThreadSafeMapOption

type ThreadSafeMapOption[K comparable, V any] func(*threadSafeMap[K, V]) error

func WithThreadSafeMapCloseableItemCheck

func WithThreadSafeMapCloseableItemCheck[K comparable, V any]() ThreadSafeMapOption[K, V]

func WithThreadSafeMapInitCap

func WithThreadSafeMapInitCap[K comparable, V any](capacity uint32) ThreadSafeMapOption[K, V]

type ThreadSafeStorer

type ThreadSafeStorer[K comparable, V any] interface {
	Purge() error
	AddOrUpdate(key K, obj V) error
	Get(key K) (item V, exists bool)
	Delete(key K) (V, error)
	Replace(items map[K]V) error
	ListKeys(filters ...SafeStoreKeyFilterFunc[K]) []K
	ListValues(keys ...K) (items []V)
}

func NewThreadSafeMap

func NewThreadSafeMap[K comparable, V any](opts ...ThreadSafeMapOption[K, V]) ThreadSafeStorer[K, V]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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