bbolt

package
v0.0.0-...-088ea19 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBBolt

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

NewBBolt opens/creates a bbolt database.

Types

type BBolt

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

BBolt database made pluggable for gobaseline.

func (*BBolt) Delete

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

Delete deletes a record from the database.

func (*BBolt) Get

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

Get returns a database record.

func (*BBolt) GetMeta

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

GetMeta returns the metadata of a database record.

func (*BBolt) Injected

func (b *BBolt) Injected() bool

Injected returns whether the database is injected.

func (*BBolt) MaintainRecordStates

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

MaintainRecordStates maintains records states in the database.

func (*BBolt) Purge

func (b *BBolt) Purge(ctx context.Context, q *query.Query, local, internal, shadowDelete bool) (int, error)

Purge deletes all records that match the given query. It returns the number of successful deletes and an error.

func (*BBolt) Put

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

Put stores a record in the database.

func (*BBolt) PutMany

func (b *BBolt) PutMany(shadowDelete bool) (chan<- record.Record, <-chan error)

PutMany stores many records in the database.

func (*BBolt) Query

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

Query returns a an iterator for the supplied query.

func (*BBolt) ReadOnly

func (b *BBolt) ReadOnly() bool

ReadOnly returns whether the database is read only.

func (*BBolt) Shutdown

func (b *BBolt) 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