kv

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BinKey

type BinKey interface {
	// include only KVS compatable types, to fall in main constatrains. Comparable can be extended with go update to include array types declareted in next line
	comparable

	~string | ~bool | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~[]bool | ~[]uint8 | ~[]int8 | ~[]int16 | ~[]uint16 | ~[]int32 | ~[]uint32 | ~[]int64 | ~[]uint64 | ~float32 | ~float64 | ~[]float32 | ~[]float64
}

type Byter

type Byter interface {
	ToBytes() []byte
}

type DeByter

type DeByter[V any] interface {
	FromBytes([]byte) V
}

type HaxMap added in v1.1.0

type HaxMap[K constraints.Integer | constraints.Float | constraints.Complex | ~string | uintptr, V any] struct {
	*haxmap.Map[K, V]
}

func NewHaxMap added in v1.1.0

func NewHaxMap[K constraints.Ordered, V any]() *HaxMap[K, V]

func (*HaxMap[K, V]) Close added in v1.1.0

func (m *HaxMap[K, V]) Close()

func (*HaxMap[K, V]) Range added in v1.1.0

func (m *HaxMap[K, V]) Range(f func(key K, value V) bool)

type KVS

type KVS[K comparable, V any] interface {
	Get(key K) (V, bool)
	Set(key K, value V)
	Range(func(key K, value V) bool)

	Close()
}

type LevelDbKVS

type LevelDbKVS[K ~int64, V ValueBytes[V]] struct {
	// contains filtered or unexported fields
}

func NewLevelDbKV

func NewLevelDbKV[K ~int64, V ValueBytes[V]](db *leveldb.DB) *LevelDbKVS[K, V]

func (*LevelDbKVS[K, V]) Close

func (kvs *LevelDbKVS[K, V]) Close()

func (*LevelDbKVS[K, V]) Get

func (kvs *LevelDbKVS[K, V]) Get(key K) (V, bool)

Get implements KVS

func (*LevelDbKVS[K, V]) Range

func (kvs *LevelDbKVS[K, V]) Range(iterCall func(key K, value V) bool)

func (*LevelDbKVS[K, V]) Set

func (kvs *LevelDbKVS[K, V]) Set(key K, value V)

Set implements KVS

type MutexMap

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

func NewMutexMap

func NewMutexMap[K comparable, V any]() *MutexMap[K, V]

func (*MutexMap[K, V]) Close

func (m *MutexMap[K, V]) Close()

func (*MutexMap[K, V]) Get

func (m *MutexMap[K, V]) Get(key K) (V, bool)

Get implements KVS

func (*MutexMap[K, V]) Range

func (m *MutexMap[K, V]) Range(f func(key K, value V) bool)

func (*MutexMap[K, V]) Set

func (m *MutexMap[K, V]) Set(key K, value V)

Set implements KVS

type ValueBytes

type ValueBytes[V any] interface {
	Byter
	DeByter[V]
}

type XMap

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

func NewIntXMap added in v1.1.0

func NewIntXMap[K xsync.IntegerConstraint, V any]() *XMap[K, V]

func NewStringXMap added in v1.1.0

func NewStringXMap[V any]() *XMap[string, V]

func (*XMap[K, V]) Close

func (m *XMap[K, V]) Close()

func (*XMap[K, V]) Get

func (m *XMap[K, V]) Get(key K) (V, bool)

Get implements KVS

func (*XMap[K, V]) Range

func (m *XMap[K, V]) Range(f func(key K, value V) bool)

func (*XMap[K, V]) Set

func (m *XMap[K, V]) Set(key K, value V)

Set implements KVS

Jump to

Keyboard shortcuts

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