Documentation
¶
Index ¶
- func PrettyBlockNum(b uint64) string
- func RangeBoundaryNames() []string
- func RoundToBundleEndBlock(block, fileBlockSize uint64) uint64
- func RoundToBundleStartBlock(block, fileBlockSize uint64) uint64
- type BlockNum
- type BlockRange
- func GetBlockRangeFromArg(in string) (out BlockRange, err error)
- func GetBlockRangeFromFlag(cmd *cobra.Command, flagName string) (out BlockRange, err error)
- func NewClosedRange(start int64, stop uint64) BlockRange
- func NewOpenRange(start int64) BlockRange
- func ParseBlockRange(input string, firstStreamableBlock uint64) (out BlockRange, err error)
- func (b BlockRange) BlockCount() int64
- func (b BlockRange) Contains(blockNum uint64, endBoundary RangeBoundary) bool
- func (b BlockRange) GetStartBlock() int64
- func (b BlockRange) GetStopBlockOr(defaultIfOpenRange uint64) uint64
- func (b BlockRange) IsClosed() bool
- func (b BlockRange) IsOpen() bool
- func (b BlockRange) IsResolved() bool
- func (b BlockRange) ReprocRange() string
- func (b BlockRange) Split(chunkSize uint64, endBoundary RangeBoundary) ([]BlockRange, error)
- func (b BlockRange) String() string
- func (b BlockRange) ToBstreamRange(endBoundary RangeBoundary) *bstream.Range
- type RangeBoundary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrettyBlockNum ¶
func RangeBoundaryNames ¶
func RangeBoundaryNames() []string
RangeBoundaryNames returns a list of possible string values of RangeBoundary.
func RoundToBundleEndBlock ¶
func RoundToBundleStartBlock ¶
Types ¶
type BlockRange ¶
BlockRange is actually an UnresolvedBlockRange so both the start and end could be negative values.
This is in opposition to `bstream.Range` which is a resolved range meaning that start/stop values will never be negative.
func GetBlockRangeFromArg ¶
func GetBlockRangeFromArg(in string) (out BlockRange, err error)
func GetBlockRangeFromFlag ¶
func GetBlockRangeFromFlag(cmd *cobra.Command, flagName string) (out BlockRange, err error)
func NewClosedRange ¶
func NewClosedRange(start int64, stop uint64) BlockRange
func NewOpenRange ¶
func NewOpenRange(start int64) BlockRange
func ParseBlockRange ¶
func ParseBlockRange(input string, firstStreamableBlock uint64) (out BlockRange, err error)
func (BlockRange) BlockCount ¶
func (b BlockRange) BlockCount() int64
func (BlockRange) Contains ¶
func (b BlockRange) Contains(blockNum uint64, endBoundary RangeBoundary) bool
func (BlockRange) GetStartBlock ¶
func (b BlockRange) GetStartBlock() int64
func (BlockRange) GetStopBlockOr ¶
func (b BlockRange) GetStopBlockOr(defaultIfOpenRange uint64) uint64
func (BlockRange) IsClosed ¶
func (b BlockRange) IsClosed() bool
func (BlockRange) IsOpen ¶
func (b BlockRange) IsOpen() bool
func (BlockRange) IsResolved ¶
func (b BlockRange) IsResolved() bool
IsResolved returns true if the range is both closed and fully resolved (e.g. both start and stop are positive values). Returns false otherwise.
func (BlockRange) ReprocRange ¶
func (b BlockRange) ReprocRange() string
func (BlockRange) Split ¶
func (b BlockRange) Split(chunkSize uint64, endBoundary RangeBoundary) ([]BlockRange, error)
func (BlockRange) String ¶
func (b BlockRange) String() string
func (BlockRange) ToBstreamRange ¶
func (b BlockRange) ToBstreamRange(endBoundary RangeBoundary) *bstream.Range
type RangeBoundary ¶
type RangeBoundary int
ENUM(
Inclusive Exclusive
)
const ( EndBoundaryInclusive RangeBoundary = RangeBoundaryInclusive EndBoundaryExclusive = RangeBoundaryExclusive )
const ( // RangeBoundaryInclusive is a RangeBoundary of type Inclusive. RangeBoundaryInclusive RangeBoundary = iota // RangeBoundaryExclusive is a RangeBoundary of type Exclusive. RangeBoundaryExclusive )
func ParseRangeBoundary ¶
func ParseRangeBoundary(name string) (RangeBoundary, error)
ParseRangeBoundary attempts to convert a string to a RangeBoundary
func (RangeBoundary) MarshalText ¶
func (x RangeBoundary) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method
func (RangeBoundary) String ¶
func (x RangeBoundary) String() string
String implements the Stringer interface.
func (*RangeBoundary) UnmarshalText ¶
func (x *RangeBoundary) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method