block

package
v1.1.13 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Range

type Range struct {
	StartBlock        uint64 `json:"start_block"`
	ExclusiveEndBlock uint64 `json:"exclusive_end_block"`
}

func NewRange added in v0.0.13

func NewRange(startBlock, exclusiveEndBlock uint64) *Range

func ParseRange added in v0.0.14

func ParseRange(in string) *Range

func (*Range) Contains

func (r *Range) Contains(blockNum uint64) bool

func (*Range) Equals

func (r *Range) Equals(other *Range) bool

func (*Range) IsAbove added in v0.1.0

func (r *Range) IsAbove(blockNum uint64) bool

func (*Range) IsBelow added in v0.1.0

func (r *Range) IsBelow(blockNum uint64) bool

func (*Range) IsEmpty added in v0.1.0

func (r *Range) IsEmpty() bool

func (*Range) IsOutOfBounds added in v0.1.0

func (r *Range) IsOutOfBounds(blockNum uint64) bool

func (*Range) Len added in v0.0.21

func (r *Range) Len() uint64

func (*Range) MarshalLogObject

func (r *Range) MarshalLogObject(enc zapcore.ObjectEncoder) error

func (*Range) Size

func (r *Range) Size() uint64

func (*Range) Split

func (r *Range) Split(chunkSize uint64) []*Range

func (*Range) String

func (r *Range) String() string

type Ranges

type Ranges []*Range

func ParseRanges added in v0.0.14

func ParseRanges(in string) (out Ranges)

func (Ranges) Contains added in v0.1.0

func (r Ranges) Contains(input *Range) bool

func (Ranges) Len

func (r Ranges) Len() int

func (Ranges) Less

func (r Ranges) Less(i, j int) bool

func (Ranges) Merged added in v0.0.14

func (r Ranges) Merged() (out Ranges)

func (Ranges) MergedBuckets added in v0.0.14

func (r Ranges) MergedBuckets(maxBucketSize uint64) (out Ranges)

func (Ranges) SortAndDedupe added in v1.1.12

func (r Ranges) SortAndDedupe() (out Ranges)

func (Ranges) String

func (r Ranges) String() string

func (Ranges) Swap

func (r Ranges) Swap(i, j int)

type Segmenter added in v1.1.9

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

func NewSegmenter added in v1.1.9

func NewSegmenter(interval uint64, initialBlock uint64, exclusiveEndBlock uint64) *Segmenter

func (*Segmenter) Count added in v1.1.9

func (s *Segmenter) Count() int

Count returns the number of valid segments for the internal range. Use LastIndex to know about the highest index.

func (*Segmenter) EndsOnInterval added in v1.1.9

func (s *Segmenter) EndsOnInterval(segmentIndex int) bool

func (*Segmenter) ExclusiveEndBlock added in v1.1.9

func (s *Segmenter) ExclusiveEndBlock() uint64

func (*Segmenter) FirstIndex added in v1.1.9

func (s *Segmenter) FirstIndex() int

func (*Segmenter) IndexForEndBlock added in v1.1.9

func (s *Segmenter) IndexForEndBlock(blockNum uint64) int

func (*Segmenter) IndexForStartBlock added in v1.1.9

func (s *Segmenter) IndexForStartBlock(blockNum uint64) int

func (*Segmenter) InitialBlock added in v1.1.9

func (s *Segmenter) InitialBlock() uint64

func (*Segmenter) LastIndex added in v1.1.9

func (s *Segmenter) LastIndex() int

func (*Segmenter) Range added in v1.1.9

func (s *Segmenter) Range(idx int) *Range

func (*Segmenter) WithExclusiveEndBlock added in v1.1.9

func (s *Segmenter) WithExclusiveEndBlock(newExclusiveEndBlock uint64) *Segmenter

func (*Segmenter) WithInitialBlock added in v1.1.9

func (s *Segmenter) WithInitialBlock(newInitialBlock uint64) *Segmenter

Jump to

Keyboard shortcuts

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