blockdb

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 12, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package blockdb provides read/write access to an on-disk block database. blockdb uses Bolt as its underlying database, but this is subject to change.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownBlock = errors.New("unknown block")
)
View Source
var NilDB nildb

NilDB is a db whose methods are no-ops. Calls to Block will return the zero value of types.Block. Calls to Height will return 0.

Functions

This section is empty.

Types

type DB

type DB interface {
	Block(types.BlockHeight) (types.Block, error)
	AddBlock(types.Block) error
	RemoveBlock() error
	Height() (types.BlockHeight, error)
	Close() error
}

A DB is a block database. Right now it is equivalent to a []Block.

func Open

func Open(filename string) (DB, error)

Open returns a database ready for use. If the database file does not exist, it will be created. Only one view of a given database file should be open at any one time.

Jump to

Keyboard shortcuts

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