storage

package
v0.0.0-...-e920dd0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyToStr

func KeyToStr(key states.IStateKeyInterface) string

Types

type CloneCache

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

func NewCloneDBCache

func NewCloneDBCache(innerCache DBCache, dbCache DBCache) *CloneCache

func (*CloneCache) Commit

func (cloneCache *CloneCache) Commit()

func (*CloneCache) Find

func (cloneCache *CloneCache) Find(prefix blockchain.EntryPrefix, keyPreFix string) database.Iterator

func (*CloneCache) GetInnerCache

func (cloneCache *CloneCache) GetInnerCache() DBCache

func (*CloneCache) TryDelete

func (cloneCache *CloneCache) TryDelete(prefix blockchain.EntryPrefix, hash common.Uint168) bool

func (*CloneCache) TryGet

func (cloneCache *CloneCache) TryGet(prefix blockchain.EntryPrefix, key string) (states.IStateValueInterface, error)

type DBCache

type DBCache interface {
	GetOrAdd(prefix blockchain.EntryPrefix, key string, value states.IStateValueInterface) (states.IStateValueInterface, error)
	TryGet(prefix blockchain.EntryPrefix, key string) (states.IStateValueInterface, error)
	TryDelete(prefix blockchain.EntryPrefix, key string) bool
	GetWriteSet() *RWSet
	FindInternal(prefix blockchain.EntryPrefix, keyPrefix string) database.Iterator
}

type RWSet

type RWSet struct {
	ReadSet  map[string]*Read
	WriteSet map[string]*Write
}

func NewRWSet

func NewRWSet() *RWSet

func (*RWSet) Add

func (rw *RWSet) Add(prefix blockchain.EntryPrefix, key string, value states.IStateValueInterface) error

func (*RWSet) Delete

func (rw *RWSet) Delete(prefix blockchain.EntryPrefix, key string)

type Read

type Read struct {
	Key     states.IStateKeyInterface
	Version string
}

type Write

type Write struct {
	Prefix    blockchain.EntryPrefix
	Key       string
	Item      states.IStateValueInterface
	IsDeleted bool
}

Jump to

Keyboard shortcuts

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