ledger

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

账本约束数据结构定义

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockHandle

type BlockHandle interface {
	GetProposer() []byte
	GetHeight() int64
	GetBlockid() []byte
	GetConsensusStorage() ([]byte, error)
	GetTimestamp() int64
	SetItem(item string, value interface{}) error
	MakeBlockId() ([]byte, error)
	GetPreHash() []byte
	GetNextHash() []byte
	GetPublicKey() string
	GetSign() []byte
	GetTxIDs() []string
	GetInTrunk() bool
}

区块基础操作

type PureData

type PureData struct {
	Bucket string
	Key    []byte
	Value  []byte
}

func (*PureData) GetBucket

func (t *PureData) GetBucket() string

func (*PureData) GetKey

func (t *PureData) GetKey() []byte

func (*PureData) GetValue

func (t *PureData) GetValue() []byte

type VersionedData

type VersionedData struct {
	PureData  *PureData
	RefTxid   []byte
	RefOffset int32
}

func (*VersionedData) GetPureData

func (t *VersionedData) GetPureData() *PureData

func (*VersionedData) GetRefOffset

func (t *VersionedData) GetRefOffset() int32

func (*VersionedData) GetRefTxid

func (t *VersionedData) GetRefTxid() []byte

type XMIterator

type XMIterator interface {
	Key() []byte
	Value() *VersionedData
	Next() bool
	Error() error
	// Iterator 必须在使用完毕后关闭
	Close()
}

XMIterator iterates over key/value pairs in key order

type XMReader

type XMReader interface {
	//读取一个key的值,返回的value就是有版本的data
	Get(bucket string, key []byte) (*VersionedData, error)
	//扫描一个bucket中所有的kv, 调用者可以设置key区间[startKey, endKey)
	Select(bucket string, startKey []byte, endKey []byte) (XMIterator, error)
}

type XMSnapshotReader

type XMSnapshotReader interface {
	Get(bucket string, key []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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