player

package
v1.1.0-alpha-8 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OnReplayCb

type OnReplayCb func(seq uint64) error

OnReplayCb defines func signature which can be used as callback for the Replay* functions. This callback is going to be executed on each block replay.

type Player

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

Player defines a tlog replay player. It could be used to restore the data based on transactions sent to tlog server

func NewPlayer

func NewPlayer(ctx context.Context, source config.Source,
	vdiskID, privKey string, dataShards, parityShards int) (*Player, error)

NewPlayer creates new tlog player

func NewPlayerWithStorage

func NewPlayerWithStorage(ctx context.Context, source config.Source,
	connProvider ardb.ConnProvider, storage storage.BlockStorage,
	vdiskID, privKey string, dataShards, parityShards int) (*Player, error)

NewPlayerWithStorage create new tlog player with given BlockStorage

func (*Player) Close

func (p *Player) Close() error

Close releases all its resources

func (*Player) Replay

func (p *Player) Replay(lmt decoder.Limiter) (uint64, error)

Replay replays the tlog by decoding data from the tlog blockchains.

func (*Player) ReplayAggregation

func (p *Player) ReplayAggregation(agg *schema.TlogAggregation, lmt decoder.Limiter) (uint64, error)

ReplayAggregation replays an aggregation. It returns last sequence number it replayed.

func (*Player) ReplayAggregationWithCallback

func (p *Player) ReplayAggregationWithCallback(agg *schema.TlogAggregation, lmt decoder.Limiter,
	onReplayCb OnReplayCb) (uint64, error)

ReplayAggregationWithCallback replays an aggregation with a callback. The callback is executed after it replay a block. It returns last sequence number it replayed.

func (*Player) ReplayWithCallback

func (p *Player) ReplayWithCallback(lmt decoder.Limiter, onReplayCb OnReplayCb) (uint64, error)

ReplayWithCallback replays lmt implements the decoder.Limiter interface which specify start and end of the It returns last sequence number it replayed.

Jump to

Keyboard shortcuts

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