db

package
v0.0.0-...-23cb4e4 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Database

type Database interface {
	Reader
	NewTransaction() Transaction
	Close() error
}

type Pebble

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

func NewPebble

func NewPebble(db *pebble.DB) *Pebble

func (*Pebble) Close

func (p *Pebble) Close() error

func (*Pebble) Get

func (p *Pebble) Get(key []byte) ([]byte, error)

func (*Pebble) GetLT

func (p *Pebble) GetLT(key []byte) ([]byte, []byte, error)

func (*Pebble) NewTransaction

func (p *Pebble) NewTransaction() Transaction

type Reader

type Reader interface {
	// Get retrieves the value for the given key. If the key does not
	// exist, returns the error ErrNotFound
	Get(key []byte) ([]byte, error)

	// GetLT retrieves the key/value less than the given key.
	GetLT(key []byte) ([]byte, []byte, error)
}

type Transaction

type Transaction interface {
	Reader
	Set(key []byte, value []byte) error
	Commit() error
	Discard()
	Apply(Transaction) error
}

Jump to

Keyboard shortcuts

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