state

package
v0.0.0-...-3442dc8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Flag_Unknown   Flag = 0x00
	Flag_ReadOnly       = 0x01
	Flag_WriteOnly      = 0x10
)
View Source
const (
	MOD_NAME = "StateStore"
)

Variables

This section is empty.

Functions

func VerifyProof

func VerifyProof(proofData []byte, root []byte, key []byte, value []byte) bool

Types

type Flag

type Flag int

type IterStateCBFunc

type IterStateCBFunc func(key []byte, val []byte, proof []byte)

type IterStateDataCBFunc

type IterStateDataCBFunc func(key []byte, val []byte)

type StateStore

type StateStore interface {
	tplgstore.Store

	GetStateData(name string, key []byte) ([]byte, error)

	GetState(name string, key []byte) ([]byte, []byte, error)

	GetAllStateData(name string) ([][]byte, [][]byte, error)

	IterateAllStateDataCB(name string, iterCBFunc IterStateDataCBFunc) error

	GetAllState(name string) ([][]byte, [][]byte, [][]byte, error)

	IterateAllStateCB(name string, iterCBFunc IterStateCBFunc) error

	StateLatestVersion() (uint64, error)

	StateVersions() ([]uint64, error)
}

func NewStateStore

func NewStateStore(log tplog.Logger, backendDB backend.Backend, flag Flag) StateStore

func NewStateStoreAt

func NewStateStoreAt(log tplog.Logger, backendDB backend.Backend, flag Flag, version uint64) StateStore

type StateStoreComposition

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

func (*StateStoreComposition) Commit

func (store *StateStoreComposition) Commit() error

func (*StateStoreComposition) Delete

func (store *StateStoreComposition) Delete(key []byte) error

func (*StateStoreComposition) Exists

func (store *StateStoreComposition) Exists(key []byte) (bool, error)

func (*StateStoreComposition) GetAllState

func (store *StateStoreComposition) GetAllState() ([][]byte, [][]byte, [][]byte, error)

func (*StateStoreComposition) GetAllStateData

func (store *StateStoreComposition) GetAllStateData() ([][]byte, [][]byte, error)

func (*StateStoreComposition) GetState

func (store *StateStoreComposition) GetState(key []byte) ([]byte, []byte, error)

func (*StateStoreComposition) GetStateData

func (store *StateStoreComposition) GetStateData(key []byte) ([]byte, error)

func (*StateStoreComposition) IterateAllStateCB

func (store *StateStoreComposition) IterateAllStateCB(iterCBFunc IterStateCBFunc) error

func (*StateStoreComposition) IterateAllStateDataCB

func (store *StateStoreComposition) IterateAllStateDataCB(iterCBFunc IterStateDataCBFunc) error

func (*StateStoreComposition) Put

func (store *StateStoreComposition) Put(key []byte, value []byte) error

func (*StateStoreComposition) Root

func (store *StateStoreComposition) Root() []byte

func (*StateStoreComposition) Update

func (store *StateStoreComposition) Update(key []byte, value []byte) error

Jump to

Keyboard shortcuts

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