decoder

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: 3 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNilLastHash indicates that there is no last hash entry
	ErrNilLastHash = errors.New("nil last hash")
)

Functions

This section is empty.

Types

type LimitBySequence

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

LimitBySequence implement Limiter interface which is limited by start and end sequence

func NewLimitBySequence

func NewLimitBySequence(startSeq, endSeq uint64) LimitBySequence

NewLimitBySequence creates new LimitBySequence object

func (LimitBySequence) EndAgg

EndAgg implements Limiter.EndAgg

func (LimitBySequence) EndBlock

func (lbt LimitBySequence) EndBlock(block schema.TlogBlock) bool

EndBlock implementes Limiter.EndBlock

func (LimitBySequence) FromEpoch

func (lbs LimitBySequence) FromEpoch() int64

func (LimitBySequence) StartAgg

func (lbt LimitBySequence) StartAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool

StartAgg implements Limiter.StartAgg

func (LimitBySequence) StartBlock

func (lbt LimitBySequence) StartBlock(block schema.TlogBlock) bool

StartBlock implements Limiter.StartBlock

func (LimitBySequence) ToEpoch

func (lbs LimitBySequence) ToEpoch() int64

type LimitByTimestamp

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

LimitByTimestamp implements limiter based on the timestamp

func NewLimitByTimestamp

func NewLimitByTimestamp(startTs, endTs int64) LimitByTimestamp

NewLimitByTimestamp creates new LimitByTimestamp limiter

func (LimitByTimestamp) EndAgg

EndAgg implements Limiter.EndAgg

func (LimitByTimestamp) EndBlock

func (lbt LimitByTimestamp) EndBlock(block schema.TlogBlock) bool

EndBlock implementes Limiter.EndBlock

func (LimitByTimestamp) FromEpoch

func (lbt LimitByTimestamp) FromEpoch() int64

func (LimitByTimestamp) StartAgg

func (lbt LimitByTimestamp) StartAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool

StartAgg implements Limiter.StartAgg

func (LimitByTimestamp) StartBlock

func (lbt LimitByTimestamp) StartBlock(block schema.TlogBlock) bool

StartBlock implements Limiter.StartBlock

func (LimitByTimestamp) ToEpoch

func (lbt LimitByTimestamp) ToEpoch() int64

type Limiter

type Limiter interface {

	// StartAgg returns true if it is the start of the
	// aggregation we want to decode
	StartAgg(*schema.TlogAggregation, schema.TlogBlock_List) bool

	// EndAgg returns true if it is the end  of the
	// aggregation we want to decode
	EndAgg(*schema.TlogAggregation, schema.TlogBlock_List) bool

	// StartBlock returns true if it is the start of block we want to decode
	StartBlock(schema.TlogBlock) bool

	// EndBlock returns true if it is the end of block we want to decode
	EndBlock(schema.TlogBlock) bool

	FromEpoch() int64

	ToEpoch() int64
}

Limiter is interface that needs to be implemented in order for the decoder to know which aggregations it needs to decode

Jump to

Keyboard shortcuts

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