db

package
Version: v0.0.0-...-f5f0bdb Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultPath = "~/.golkadot"

DefaultPath ...

View Source
var DefaultType = "disk"

DefaultType ...

Functions

This section is empty.

Types

type BaseDB

type BaseDB interface {
	Close()
	Open()
	Drop()
	Empty()
	Maintain(fn *ProgressCB) error
	Rename(base, file string)
	Size() int

	Del(key []uint8)
	Get(key []uint8) []uint8
	Put(key, value []uint8)
}

BaseDB ...

type BaseDBOptions

type BaseDBOptions struct {
	IsCompressed bool
}

BaseDBOptions ....

type BaseOptions

type BaseOptions struct {
}

BaseOptions ...

type CachedValue

type CachedValue struct {
	Value []uint8
}

CachedValue ...

type FilePath

type FilePath struct {
	Directory string
	File      string
}

FilePath ...

type FileTreeDB

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

FileTreeDB ...

func NewFileTreeDBDB

func NewFileTreeDBDB(location string) *FileTreeDB

NewFileTreeDBDB ...

func (*FileTreeDB) Close

func (f *FileTreeDB) Close()

Close ...

func (*FileTreeDB) Del

func (f *FileTreeDB) Del(key []uint8)

Del ...

func (*FileTreeDB) Drop

func (f *FileTreeDB) Drop()

Drop ...

func (*FileTreeDB) Empty

func (f *FileTreeDB) Empty()

Empty ...

func (*FileTreeDB) Get

func (f *FileTreeDB) Get(key []uint8) []uint8

Get ...

func (*FileTreeDB) Maintain

func (f *FileTreeDB) Maintain(fn *ProgressCB) error

Maintain ...

func (*FileTreeDB) Open

func (f *FileTreeDB) Open()

Open ...

func (*FileTreeDB) Put

func (f *FileTreeDB) Put(key, value []uint8)

Put ...

func (*FileTreeDB) Rename

func (f *FileTreeDB) Rename(base, file string)

Rename ...

func (*FileTreeDB) Size

func (f *FileTreeDB) Size() int

Size ...

type KV

type KV struct {
	Key   []uint8
	Value []uint8
}

KV ...

type LruDB

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

LruDB ...

func NewLruDB

func NewLruDB(backing BaseDB, itemCount int) *LruDB

NewLruDB ... TODO: itemCount not used?

func (*LruDB) Close

func (l *LruDB) Close()

Close ...

func (*LruDB) Del

func (l *LruDB) Del(key []uint8)

Del ...

func (*LruDB) Drop

func (l *LruDB) Drop()

Drop ...

func (*LruDB) Empty

func (l *LruDB) Empty()

Empty ...

func (*LruDB) Get

func (l *LruDB) Get(key []uint8) []uint8

Get ...

func (*LruDB) Maintain

func (l *LruDB) Maintain(fn *ProgressCB) error

Maintain ...

func (*LruDB) Open

func (l *LruDB) Open()

Open ...

func (*LruDB) Put

func (l *LruDB) Put(key, value []uint8)

Put ...

func (*LruDB) Rename

func (l *LruDB) Rename(base, file string)

Rename ...

func (*LruDB) Size

func (l *LruDB) Size() int

Size ...

type LruMap

type LruMap map[string]*CachedValue

LruMap ...

type MemoryDB

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

MemoryDB ...

func NewMemoryDB

func NewMemoryDB(options *BaseOptions) *MemoryDB

NewMemoryDB creates a MemoryDB database extending TransactionDB options argument (optional) used to specifies whether to use compression. - Enable compression when storing "blocks" since they compress well. - Disable compression when storing "state" Transactions Trie data structure serialised with Recursive Length Prefix (RLP) encoding

func (*MemoryDB) Close

func (m *MemoryDB) Close()

Close ...

func (*MemoryDB) Del

func (m *MemoryDB) Del(key []uint8)

Del ...

func (*MemoryDB) Drop

func (m *MemoryDB) Drop()

Drop ...

func (*MemoryDB) Empty

func (m *MemoryDB) Empty()

Empty ...

func (*MemoryDB) Get

func (m *MemoryDB) Get(key []uint8) []uint8

Get ...

func (*MemoryDB) Maintain

func (m *MemoryDB) Maintain(fn *ProgressCB) error

Maintain ...

func (*MemoryDB) Open

func (m *MemoryDB) Open()

Open ...

func (*MemoryDB) Put

func (m *MemoryDB) Put(key []uint8, value []uint8)

Put ...

func (*MemoryDB) Rename

func (m *MemoryDB) Rename(base, file string)

Rename ...

func (*MemoryDB) Size

func (m *MemoryDB) Size() int

Size ...

type Overlay

type Overlay map[string]*KV

Overlay ...

type ProgressCB

type ProgressCB func(*ProgressValue)

ProgressCB ...

type ProgressValue

type ProgressValue struct {
	IsCompleted bool
	Keys        int
	Percent     int
}

ProgressValue ...

type Storage

type Storage map[string][]uint8

Storage ...

type TXDB

type TXDB interface {
	BaseDB
	Transaction(fn func() bool) (bool, error)
	GetRoot() []byte // triedb
}

TXDB ...

type TransactionDB

type TransactionDB struct {
	TXDB
	Backing BaseDB
	// contains filtered or unexported fields
}

TransactionDB ...

func NewTransactionDB

func NewTransactionDB(backing *BaseDB) *TransactionDB

NewTransactionDB ...

func (*TransactionDB) Close

func (t *TransactionDB) Close()

Close ...

func (*TransactionDB) CommitTx

func (t *TransactionDB) CommitTx() error

CommitTx ...

func (*TransactionDB) CreateTx

func (t *TransactionDB) CreateTx() error

CreateTx ...

func (*TransactionDB) Del

func (t *TransactionDB) Del(key []uint8)

Del ...

func (*TransactionDB) Drop

func (t *TransactionDB) Drop()

Drop ...

func (*TransactionDB) Empty

func (t *TransactionDB) Empty()

Empty ...

func (*TransactionDB) Get

func (t *TransactionDB) Get(key []uint8) []uint8

Get ...

func (*TransactionDB) Maintain

func (t *TransactionDB) Maintain(fn *ProgressCB) error

Maintain ...

func (*TransactionDB) Open

func (t *TransactionDB) Open()

Open ...

func (*TransactionDB) Put

func (t *TransactionDB) Put(key, value []uint8)

Put ...

func (*TransactionDB) Rename

func (t *TransactionDB) Rename(base, file string)

Rename ...

func (*TransactionDB) RevertTx

func (t *TransactionDB) RevertTx() error

RevertTx ...

func (*TransactionDB) Size

func (t *TransactionDB) Size() int

Size ...

func (*TransactionDB) Transaction

func (t *TransactionDB) Transaction(fn func() bool) (bool, error)

Transaction ...

Jump to

Keyboard shortcuts

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