Versions in this module Expand all Collapse all v0 v0.0.1 Jun 22, 2020 Changes in this version + const StepHandoff + const StepIrreversible + const StepNew + const StepRedo + const StepStalled + const StepUndo + const StepsAll + func NewWithLIB(libID bstream.BlockRef, h bstream.Handler) + type Block struct + BlockID string + BlockNum uint64 + Object interface{} + PreviousBlockID string + type ForkDB struct + func NewForkDB() *ForkDB + func (f *ForkDB) AddLink(blockRef, previousRef bstream.BlockRef, obj interface{}) (exists bool) + func (f *ForkDB) BlockForID(blockID string) *Block + func (f *ForkDB) BlockInCurrentChain(startAtBlock bstream.BlockRef, blockNum uint64) bstream.BlockRef + func (f *ForkDB) ChainSwitchSegments(oldHeadBlockID, newHeadsPreviousID string) (undo []string, redo []string) + func (f *ForkDB) ClonedLinks() (out map[string]string, nums map[string]uint64) + func (f *ForkDB) Exists(blockID string) bool + func (f *ForkDB) HasLIB() bool + func (f *ForkDB) HasNewIrreversibleSegment(newLIB bstream.BlockRef) (hasNew bool, irreversibleSegment, staleBlocks []*Block) + func (f *ForkDB) InitLIB(ref bstream.BlockRef) + func (f *ForkDB) IsBehindLIB(blockNum uint64) bool + func (f *ForkDB) LIBID() string + func (f *ForkDB) LIBNum() uint64 + func (f *ForkDB) MoveLIB(blockRef bstream.BlockRef) (purgedBlocks []*Block) + func (f *ForkDB) ReversibleSegment(upToBlock bstream.BlockRef) (blocks []*Block) + func (f *ForkDB) SetName(name string) + func (f *ForkDB) TrySetLIB(headRef, previousRef bstream.BlockRef, libNum uint64) + type Forkable struct + func New(h bstream.Handler, opts ...Option) *Forkable + func (p *Forkable) ProcessBlock(blk *bstream.Block, obj interface{}) error + type ForkableBlock struct + Block *bstream.Block + Obj interface{} + SentAsNew bool + type ForkableObject struct + ForkDB *ForkDB + HandoffCount int + Obj interface{} + Step StepType + StepBlocks []*bstream.PreprocessedBlock + StepCount int + StepIndex int + type IrreversibleBlockIDGate struct + MaxHoldOff int + Name string + func NewIrreversibleBlockIDGate(blockID string, gateType bstream.GateType, h bstream.Handler) *IrreversibleBlockIDGate + func (g *IrreversibleBlockIDGate) ProcessBlock(blk *bstream.Block, obj interface{}) error + type IrreversibleBlockNumGate struct + MaxHoldOff int + Name string + func NewIrreversibleBlockNumGate(blockNum uint64, gateType bstream.GateType, h bstream.Handler) *IrreversibleBlockNumGate + func (g *IrreversibleBlockNumGate) ProcessBlock(blk *bstream.Block, obj interface{}) error + type Option func(f *Forkable) + func EnsureAllBlocksTriggerLongestChain() Option + func EnsureBlockFlows(blockRef bstream.BlockRef) Option + func WithExclusiveLIB(irreversibleBlock bstream.BlockRef) Option + func WithFilters(steps StepType) Option + func WithInclusiveLIB(irreversibleBlock bstream.BlockRef) Option + func WithName(name string) Option + type StepType int + func (t StepType) String() string