merkle

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

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
	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 (*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) 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