merkle

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DBFlagCopyContext = "copyContext"
)
View Source
const (
	MaxNumberOfItemsToCopyInRow = 50
)

Variables

View Source
var (
	// ErrNoHasher will be returned if supplied BucketID doesn't have valid
	// hash function for verifying the received data.
	ErrNoHasher = errors.New("NoHasher")
	// ErrNoRequester will be returned if there is nobody who want the data.
	ErrNoRequester = errors.New("NoRequester")
)

Functions

This section is empty.

Types

type Builder

type Builder interface {
	OnData(bid db.BucketID, value []byte) error
	UnresolvedCount() int
	ResolvedCount() int
	Requests() RequestIterator
	RequestData(id db.BucketID, key []byte, requester DataRequester)
	Database() db.Database
	Flush(write bool) error
}

func NewBuilder

func NewBuilder(dbase db.Database) Builder

func NewBuilderWithRawDatabase

func NewBuilderWithRawDatabase(dbase db.Database) Builder

type CopyContext

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

func NewCopyContext

func NewCopyContext(src db.Database, dst db.Database) *CopyContext

func PrepareCopyContext added in v1.3.2

func PrepareCopyContext(src db.Database, dst db.Database) *CopyContext

PrepareCopyContext prepares CopyContext for copying src to dst. If dst comes from another CopyContext, then it returns the original one for tracking progress properly.

func (*CopyContext) Builder

func (e *CopyContext) Builder() Builder

func (*CopyContext) Copy

func (e *CopyContext) Copy(id db.BucketID, key []byte) error

func (*CopyContext) Run

func (e *CopyContext) Run() error

func (*CopyContext) Set

func (e *CopyContext) Set(id db.BucketID, key, value []byte) error

func (*CopyContext) SetHeight added in v1.3.2

func (e *CopyContext) SetHeight(height int64)

func (*CopyContext) SetProgressCallback added in v1.3.2

func (e *CopyContext) SetProgressCallback(cb module.ProgressCallback)

func (*CopyContext) SourceDB

func (e *CopyContext) SourceDB() db.Database

func (*CopyContext) TargetDB

func (e *CopyContext) TargetDB() db.Database

type DataRequester

type DataRequester interface {
	OnData(value []byte, builder Builder) error
}

type RequestIterator

type RequestIterator interface {
	Next() bool
	Key() []byte
	BucketIDs() []db.BucketID
}

Jump to

Keyboard shortcuts

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