ranges

package
v6.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotARange = FileRange{First: base.NOPOSN, Last: base.NOPOSN}

Functions

This section is empty.

Types

type BlockRange

type BlockRange FileRange // sugar

type FileRange

type FileRange struct {
	First base.Blknum
	Last  base.Blknum
}

func RangeFromFilename

func RangeFromFilename(path string) (blkRange FileRange)

RangeFromFilename returns a FileRange and ignore any errors

func RangeFromFilenameE

func RangeFromFilenameE(path string) (blkRange FileRange, err error)

RangeFromFilenameE returns a block range given a chunk filename. The format of filenames may be start-end.bin (start and end are nine digit and zero-padded to the left) or start.txt

func RangeFromRangeString

func RangeFromRangeString(rngStr string) FileRange

RangeFromRangeString returns a file range from a string

func (*FileRange) EarlierThan

func (r *FileRange) EarlierThan(needle FileRange) bool

EarlierThan returns true if range is strictly before the given needle range

func (*FileRange) EarlierThanB

func (r *FileRange) EarlierThanB(bn base.Blknum) bool

EarlierThanB returns true if the range is strictly before the given block

func (*FileRange) Equals

func (r *FileRange) Equals(needle FileRange) bool

Equals returns true if the two ranges are equal

func (*FileRange) Follows

func (r *FileRange) Follows(needle FileRange, sequential bool) bool

Follows returns true if the range is strictly after the needle range. (If 'sequential' is true, then the first block in the range must be one more than the last block in the needle range.)

func (*FileRange) Intersects

func (r *FileRange) Intersects(needle FileRange) bool

Intersects returns true if the two ranges intersect

func (*FileRange) IntersectsB

func (r *FileRange) IntersectsB(bn base.Blknum) bool

IntersectsB returns true if the block is inside the range (inclusive on both ends)

func (*FileRange) LaterThan

func (r *FileRange) LaterThan(needle FileRange) bool

LaterThan returns true if range is strictly after the given needle range

func (*FileRange) LaterThanB

func (r *FileRange) LaterThanB(bn base.Blknum) bool

LaterThanB returns true if the range is strictly after the given block

func (*FileRange) Overlaps

func (r *FileRange) Overlaps(test FileRange) (rd RangeDiff)

func (*FileRange) Precedes

func (r *FileRange) Precedes(needle FileRange, sequential bool) bool

Precedes returns true if the range is strictly before the needle range. (If 'sequential' is true, then the last block in the range must be one less than the first block in the needle range.) If the needle range starts at zero, returns false (nothing is before the first range)

func (*FileRange) RangeToFilename

func (r *FileRange) RangeToFilename(chain string) string

RangeToFilename returns a fileName and existence bool given a file range and a type

func (*FileRange) Span

func (r *FileRange) Span() base.Blknum

func (FileRange) String

func (r FileRange) String() string

type RangeDiff

type RangeDiff struct {
	Min base.Blknum
	In  base.Blknum
	Mid base.Blknum
	Out base.Blknum
	Max base.Blknum
}

type RecordRange

type RecordRange struct {
	First uint64
	Last  uint64
}

type TimestampRange

type TimestampRange struct {
	First base.Timestamp
	Last  base.Timestamp
}

Jump to

Keyboard shortcuts

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