db

package
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 10 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) GetByPrefix

func (db *Database) GetByPrefix(ctx context.Context, prefix string) (map[string][]byte, error)

func (*Database) Set

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

func (*Database) SetBatch

func (db *Database) SetBatch(data map[string][]byte) 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) 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
}

Jump to

Keyboard shortcuts

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