batch

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: GPL-3.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MAX_ERROR   = errors.New("arrived to max")
	REFER_ERROR = errors.New("refer not exist")
)

Functions

This section is empty.

Types

type AccountExistsFunc

type AccountExistsFunc func(hash types.Hash) error

type Batch

type Batch interface {
	AddAItem(item Item, sHash *types.Hash) error
	AddSItem(item Item) error
	Levels() []Level
	Size() int
	Info() string
	Version() uint64
	Exists(hash types.Hash) bool
	Batch(snapshotFn BucketExecutorFn, accountFn BucketExecutorFn) error
	Id() uint64
}

func NewBatch

func NewBatch(snapshotF SnapshotExistsFunc, accountF AccountExistsFunc, version uint64, max int) Batch

type Bucket

type Bucket interface {
	Items() []Item
	Owner() *types.Address
}

type BucketExecutorFn

type BucketExecutorFn func(p Batch, l Level, bucket Bucket, version uint64) error

type Item

type Item interface {
	// keys, accounts, snapshot
	ReferHashes() ([]types.Hash, []types.Hash, *types.Hash)
	Owner() *types.Address
	Hash() types.Hash
	Height() uint64
	PrevHash() types.Hash
}

type Level

type Level interface {
	Buckets() []Bucket
	Add(item Item) error
	SHash() *types.Hash
	Snapshot() bool
	Index() int
	Close()
	Closed() bool
	Done()
	HasDone() bool
}

type SnapshotExistsFunc

type SnapshotExistsFunc func(hash types.Hash) error

Jump to

Keyboard shortcuts

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