kvdb

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package kvdb is kvdb module

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batcher

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

func NewKvDBBatcher

func NewKvDBBatcher() *Batcher

func (*Batcher) Add

func (b *Batcher) Add(key string, value []byte)

func (*Batcher) GetKvs

func (b *Batcher) GetKvs() []*Kv

func (*Batcher) Len

func (b *Batcher) Len() int

type Kv

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

func NewKv

func NewKv(key string, value []byte) *Kv

func (*Kv) GetKey

func (kv *Kv) GetKey() string

func (*Kv) GetValue

func (kv *Kv) GetValue() []byte

type Provider

type Provider interface {
	// Get returns value by key
	Get(key string) ([]byte, bool)

	// Put saves the key-values
	Put(key string, value []byte) error

	// Has return true if the given key exist, or return false if none exists
	Has(key string) (bool, error)

	// Delete deletes the given key
	Delete(key string) error

	// WriteBatch writes a batch in an atomic operation
	WriteBatch(batch *Batcher) error

	Close()
}

Provider defines kv db provider interface

Directories

Path Synopsis
Package leveldb is leveldb module
Package leveldb is leveldb module

Jump to

Keyboard shortcuts

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