badger

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBadger

func NewBadger(name, location string) (storage.Interface, error)

NewBadger opens/creates a badger database.

Types

type Badger

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

Badger database made pluggable for portbase.

func (*Badger) Delete

func (b *Badger) Delete(key string) error

Delete deletes a record from the database.

func (*Badger) Get

func (b *Badger) Get(key string) (record.Record, error)

Get returns a database record.

func (*Badger) GetMeta added in v0.10.0

func (b *Badger) GetMeta(key string) (*record.Meta, error)

GetMeta returns the metadata of a database record.

func (*Badger) Injected

func (b *Badger) Injected() bool

Injected returns whether the database is injected.

func (*Badger) Maintain

func (b *Badger) Maintain(_ context.Context) error

Maintain runs a light maintenance operation on the database.

func (*Badger) MaintainRecordStates added in v0.5.2

func (b *Badger) MaintainRecordStates(ctx context.Context, purgeDeletedBefore time.Time, shadowDelete bool) error

MaintainRecordStates maintains records states in the database.

func (*Badger) MaintainThorough

func (b *Badger) MaintainThorough(_ context.Context) (err error)

MaintainThorough runs a thorough maintenance operation on the database.

func (*Badger) Put

func (b *Badger) Put(r record.Record) (record.Record, error)

Put stores a record in the database.

func (*Badger) Query

func (b *Badger) Query(q *query.Query, local, internal bool) (*iterator.Iterator, error)

Query returns a an iterator for the supplied query.

func (*Badger) ReadOnly

func (b *Badger) ReadOnly() bool

ReadOnly returns whether the database is read only.

func (*Badger) Shutdown

func (b *Badger) Shutdown() error

Shutdown shuts down the database.

Jump to

Keyboard shortcuts

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