ragdoll

package
v0.0.0-...-1337258 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config *viper.Viper) (iface.ICore, error)

func NewBatch

func NewBatch() any

Types

type Batch

type Batch struct {
	Ops []*Op
}

func (*Batch) AppendOps

func (b *Batch) AppendOps(ops ...*Op)

func (*Batch) Reset

func (b *Batch) Reset()

type Channel

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

func NewChannel

func NewChannel() *Channel

func (*Channel) Consume

func (c *Channel) Consume() *Task

func (*Channel) Produce

func (c *Channel) Produce(batch *Batch) chan *Result

type Data

type Data struct {
	Fd  *os.File
	Mem map[string]*Record
}

Data 磁盘中的数据文件

func NewData

func NewData(path string) (*Data, error)

type KV

type KV struct {
	Config    *viper.Viper
	Data      *Data
	Wal       *wal.Log
	BatchPool sync.Pool
	Chan      *Channel
}

func (*KV) Get

func (kv *KV) Get(key string) ([]byte, error)

func (*KV) Set

func (kv *KV) Set(key string, value []byte) error

type Op

type Op struct {
	Type  consts.OperatorType
	Key   string
	Value []byte
}

func NewOp

func NewOp(t consts.OperatorType, key string, value []byte) *Op

type Record

type Record struct {
	CheckSum [16]byte
	Size     uint64
	Key      string
	Value    []byte
}

func NewRecord

func NewRecord(key string, value []byte) *Record

type Result

type Result struct {
	Error *errs.KvErr
	Value []byte
}

type Task

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

Directories

Path Synopsis
Package wal 实现预写日志(Write-Ahead-Log)
Package wal 实现预写日志(Write-Ahead-Log)

Jump to

Keyboard shortcuts

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