Documentation ¶
Index ¶
- Variables
- type LimitBySequence
- func (lbt LimitBySequence) EndAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
- func (lbt LimitBySequence) EndBlock(block schema.TlogBlock) bool
- func (lbs LimitBySequence) FromEpoch() int64
- func (lbt LimitBySequence) StartAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
- func (lbt LimitBySequence) StartBlock(block schema.TlogBlock) bool
- func (lbs LimitBySequence) ToEpoch() int64
- type LimitByTimestamp
- func (lbt LimitByTimestamp) EndAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
- func (lbt LimitByTimestamp) EndBlock(block schema.TlogBlock) bool
- func (lbt LimitByTimestamp) FromEpoch() int64
- func (lbt LimitByTimestamp) StartAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
- func (lbt LimitByTimestamp) StartBlock(block schema.TlogBlock) bool
- func (lbt LimitByTimestamp) ToEpoch() int64
- type Limiter
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (lbt LimitBySequence) EndAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
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 ¶
func (lbt LimitByTimestamp) EndAgg(agg *schema.TlogAggregation, blocks schema.TlogBlock_List) bool
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