db

package
v0.3.0-alpha1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

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

func (*Database) DeleteByKey

func (db *Database) DeleteByKey(key string) error

func (*Database) DeleteByPrefix

func (db *Database) DeleteByPrefix(prefix string) error

func (*Database) Get

func (db *Database) Get(key string) ([]byte, bool, error)

func (*Database) NewWriter

func (db *Database) NewWriter() *Writer

func (*Database) ReadDataByPrefix

func (db *Database) ReadDataByPrefix(ctx context.Context, prefix string, callback ReadDataClbk) error

func (*Database) Set

func (db *Database) Set(key string, data []byte, ttl uint) error

func (*Database) Stats

func (db *Database) Stats() DbStats

func (*Database) Sync

func (db *Database) Sync() error

type DbContext

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

func CreateCtx

func CreateCtx(c config.BadgerConfig) *DbContext

func (*DbContext) Close

func (ctx *DbContext) Close()

func (*DbContext) CreateDb

func (ctx *DbContext) CreateDb(name string, inMemory bool) (*Database, error)

func (*DbContext) DropDb

func (ctx *DbContext) DropDb(name string) error

func (*DbContext) Exists

func (ctx *DbContext) Exists(name string) bool

func (*DbContext) GetDb

func (ctx *DbContext) GetDb(name string) (*Database, error)

func (*DbContext) LoadDbs

func (ctx *DbContext) LoadDbs() error

type DbMetrics

type DbMetrics struct {
	KeysAdded uint64
}

type DbStats

type DbStats struct {
	Lsm           int64
	Vlog          int64
	InMemory      bool
	KeyCount      uint32
	Size          int64
	OnDiskSize    uint32
	StaleDataSize uint32
	Metrics       string
}

type ReadDataClbk

type ReadDataClbk func(*hpb.DataItem) error

type Writer

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

func (*Writer) Close

func (w *Writer) Close()

func (*Writer) Commit

func (w *Writer) Commit() error

func (*Writer) Write

func (w *Writer) Write(item *pb.DataItem) error

Jump to

Keyboard shortcuts

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