database

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package database provides KV database for meta-information

Index

Constants

This section is empty.

Variables

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

Errors for Storage

Functions

func RecoverDB added in v0.5.1

func RecoverDB(path string) error

RecoverDB recovers LevelDB database from corruption

Types

type Storage

type Storage interface {
	Get(key []byte) ([]byte, error)
	Put(key []byte, value []byte) error
	Delete(key []byte) error
	KeysByPrefix(prefix []byte) [][]byte
	FetchByPrefix(prefix []byte) [][]byte
	Close() error
	ReOpen() error
	StartBatch()
	FinishBatch() error
	CompactDB() error
}

Storage is an interface to KV storage

func OpenDB

func OpenDB(path string) (Storage, error)

OpenDB opens (creates) LevelDB database

Jump to

Keyboard shortcuts

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