db

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	Reader
	Writer
	io.Closer
}

func NewCache

func NewCache(fpath string, memory int, handles int, namespace string) (Cacher, error)

type LevelDB

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

func (*LevelDB) Close

func (db *LevelDB) Close() error

func (*LevelDB) Compact

func (db *LevelDB) Compact(start []byte, limit []byte) error

func (*LevelDB) Delete

func (db *LevelDB) Delete(key []byte) error

func (*LevelDB) Get

func (db *LevelDB) Get(key []byte) ([]byte, error)

func (*LevelDB) Has

func (db *LevelDB) Has(key []byte) (bool, error)

func (*LevelDB) Put

func (db *LevelDB) Put(key []byte, value []byte) error

type Reader

type Reader interface {
	// Has returns true if the given key exists in the key-value data store.
	Has(key []byte) (bool, error)

	// Get fetch the given key if it's present in the key-value data store.
	Get(key []byte) ([]byte, error)
}

type Writer

type Writer interface {
	// Put store the given key-value in the key-value data store
	Put(key []byte, value []byte) error

	// Delete removes the key from the key-value data store.
	Delete(key []byte) error
}

Jump to

Keyboard shortcuts

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