kvstore

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDataBuf

func GetDataBuf(size int) []byte

func RecycleDataBuf

func RecycleDataBuf(b []byte)

Types

type KV

type KV struct {
	// contains filtered or unexported fields
}

func NewPrimary

func NewPrimary(dir string) *KV

func NewSecondary

func NewSecondary(
	dir string,
	onStore func(collection string, id uint64, data []byte),
	onDelete func(collection string, id uint64),
) *KV

func (*KV) CleanBefore

func (kv *KV) CleanBefore(seconds int64)

func (*KV) Close

func (kv *KV) Close()

func (*KV) Delete

func (kv *KV) Delete(collection string, id uint64)

func (*KV) Iterate

func (kv *KV) Iterate(collection string, each func(id uint64, data []byte))

func (*KV) LogInfo added in v1.2.4

func (kv *KV) LogInfo() (info LogInfo)

func (*KV) MaxSeqNum

func (kv *KV) MaxSeqNum() (seqNum uint64)

func (*KV) Primary

func (kv *KV) Primary() bool

func (*KV) Store

func (kv *KV) Store(collection string, id uint64, data []byte)

func (*KV) SyncRecv

func (kv *KV) SyncRecv(conn net.Conn)

func (*KV) SyncSend

func (kv *KV) SyncSend(conn net.Conn)

type LogInfo added in v1.2.4

type LogInfo struct {
	MaxSeqNum    uint64
	MaxCreatedAt uint64
}

Jump to

Keyboard shortcuts

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