tree

package
v1.1.0-beta4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImmutableTree

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

func NewImmutableTree

func NewImmutableTree(db dbm.DB) *ImmutableTree

func (*ImmutableTree) DeleteVersion

func (t *ImmutableTree) DeleteVersion(version int64) error

func (*ImmutableTree) Get

func (t *ImmutableTree) Get(key []byte) (index int64, value []byte)

func (*ImmutableTree) GetImmutable

func (t *ImmutableTree) GetImmutable() *ImmutableTree

func (*ImmutableTree) GetImmutableAtHeight

func (t *ImmutableTree) GetImmutableAtHeight(version int64) (*ImmutableTree, error)

func (*ImmutableTree) Hash

func (t *ImmutableTree) Hash() []byte

func (*ImmutableTree) Iterate

func (t *ImmutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool)

func (*ImmutableTree) LazyLoadVersion

func (t *ImmutableTree) LazyLoadVersion(targetVersion int64) (int64, error)

func (*ImmutableTree) LoadVersion

func (t *ImmutableTree) LoadVersion(targetVersion int64) (int64, error)

func (*ImmutableTree) Remove

func (t *ImmutableTree) Remove(key []byte) ([]byte, bool)

func (*ImmutableTree) SaveVersion

func (t *ImmutableTree) SaveVersion() ([]byte, int64, error)

func (*ImmutableTree) Set

func (t *ImmutableTree) Set(key, value []byte) bool

func (*ImmutableTree) Version

func (t *ImmutableTree) Version() int64

type MutableTree

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

func NewMutableTree

func NewMutableTree(db dbm.DB, cacheSize int) *MutableTree

func (*MutableTree) DeleteVersion

func (t *MutableTree) DeleteVersion(version int64) error

func (*MutableTree) Get

func (t *MutableTree) Get(key []byte) (index int64, value []byte)

func (*MutableTree) GetImmutable

func (t *MutableTree) GetImmutable() *ImmutableTree

func (*MutableTree) GetImmutableAtHeight

func (t *MutableTree) GetImmutableAtHeight(version int64) (*ImmutableTree, error)

func (*MutableTree) Hash

func (t *MutableTree) Hash() []byte

func (*MutableTree) Iterate

func (t *MutableTree) Iterate(fn func(key []byte, value []byte) bool) (stopped bool)

func (*MutableTree) LazyLoadVersion

func (t *MutableTree) LazyLoadVersion(targetVersion int64) (int64, error)

func (*MutableTree) LoadVersion

func (t *MutableTree) LoadVersion(targetVersion int64) (int64, error)

func (*MutableTree) Remove

func (t *MutableTree) Remove(key []byte) ([]byte, bool)

func (*MutableTree) SaveVersion

func (t *MutableTree) SaveVersion() ([]byte, int64, error)

func (*MutableTree) Set

func (t *MutableTree) Set(key, value []byte) bool

func (*MutableTree) Version

func (t *MutableTree) Version() int64

type Tree

type Tree interface {
	Get(key []byte) (index int64, value []byte)
	Set(key, value []byte) bool
	Remove(key []byte) ([]byte, bool)
	LoadVersion(targetVersion int64) (int64, error)
	LazyLoadVersion(targetVersion int64) (int64, error)
	SaveVersion() ([]byte, int64, error)
	DeleteVersion(version int64) error
	GetImmutable() *ImmutableTree
	GetImmutableAtHeight(version int64) (*ImmutableTree, error)
	Version() int64
	Hash() []byte
	Iterate(fn func(key []byte, value []byte) bool) (stopped bool)
}

Jump to

Keyboard shortcuts

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