interfaces

package
v2.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: GPL-3.0 Imports: 5 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch interface {
	Put(key, value []byte)
	Delete(key []byte)
}

type ChunkReader

type ChunkReader interface {
	// Read a block, return io.EOF if reach end, the block maybe a accountBlock or a snapshotBlock
	Read() (accountBlock *ledger.AccountBlock, snapshotBlock *ledger.SnapshotBlock, err error)
	// Close the stream
	Close() error
	Size() int64
	Verified() bool
	Verify()
}

type DBStatus

type DBStatus struct {
	Name   string
	Count  uint64
	Size   uint64
	Status string
}

type LedgerReader

type LedgerReader interface {
	Seg() Segment
	Size() int
	io.ReadCloser
}

type Segment

type Segment struct {
	From, To uint64
	Hash     types.Hash
	PrevHash types.Hash
	Points   []*ledger.HashHeight
}

func (Segment) Equal

func (seg Segment) Equal(seg2 Segment) bool

func (Segment) String

func (seg Segment) String() string

type SegmentList

type SegmentList []Segment

func (SegmentList) Len

func (list SegmentList) Len() int

func (SegmentList) Less

func (list SegmentList) Less(i, j int) bool

func (SegmentList) Swap

func (list SegmentList) Swap(i, j int)

type StateSnapshot

type StateSnapshot interface {
	// ====== balance ======
	GetBalance(tokenId *types.TokenTypeId) (*big.Int, error)

	// ====== Storage ======
	GetValue([]byte) ([]byte, error)

	NewStorageIterator(prefix []byte) StorageIterator

	Release()
}

type StorageIterator

type StorageIterator interface {
	Last() bool
	Prev() bool
	Seek(key []byte) bool

	Next() bool

	Key() []byte
	Value() []byte
	Error() error
	Release()
}

type Store

type Store interface {
	Get([]byte) ([]byte, error)
	Has([]byte) (bool, error)
}

type SyncCache

type SyncCache interface {
	NewWriter(segment Segment, size int64) (io.WriteCloser, error)
	Chunks() SegmentList
	NewReader(segment Segment) (ChunkReader, error)
	Delete(seg Segment) error
}

Jump to

Keyboard shortcuts

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