datastore

package
v0.0.0-...-19c2005 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("closed")
View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type Options

type Options struct {
	// Please refer to the Badger docs to see what this is for
	GcDiscardRatio float64

	// Interval between GC cycles
	//
	// If zero, the datastore will perform no automatic garbage collection.
	GcInterval time.Duration

	// Sleep time between rounds of a single GC cycle.
	//
	// If zero, the datastore will only perform one round of GC per
	// GcInterval.
	GcSleep time.Duration

	badger.Options
}

Options are the badger datastore options, reexported here for convenience.

var DefaultOptions Options

DefaultOptions are the default options for the badger datastore.

type Repo

type Repo struct {
	Logger *zap.Logger
	// contains filtered or unexported fields
}

func NewDatastore

func NewDatastore() *Repo

func (*Repo) Create

func (r *Repo) Create() (err error)

func (*Repo) NewImplicitTransaction

func (r *Repo) NewImplicitTransaction(readOnly bool) *txn

func (*Repo) NewTransaction

func (r *Repo) NewTransaction(ctx context.Context, readOnly bool) (*txn, error)

func (*Repo) Put

func (r *Repo) Put(ctx context.Context, key RepoKey, value []byte) error

type RepoKey

type RepoKey []byte

Jump to

Keyboard shortcuts

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