Documentation
¶
Index ¶
- Variables
- func CheckMergedBlocks(ctx context.Context, logger *zap.Logger, storeURL string, fileBlockSize uint64, ...) error
- func CheckMergedBlocksBatch(ctx context.Context, sourceStoreURL string, destStoreURL string, ...) error
- func PrettyBlockNum(b uint64) string
- func RangeBoundaryNames() []string
- func RoundToBundleEndBlock(block, fileBlockSize uint64) uint64
- func RoundToBundleStartBlock(block, fileBlockSize uint64) uint64
- func WalkBlockPrefix(blockRange BlockRange, fileBlockSize uint64) string
- type BlockNum
- type BlockRange
- 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 PrintDetails
- type RangeBoundary
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidRangeBoundary = fmt.Errorf("not a valid RangeBoundary, try [%s]", strings.Join(_RangeBoundaryNames, ", "))
Functions ¶
func CheckMergedBlocks ¶
func CheckMergedBlocksBatch ¶ added in v0.1.12
func CheckMergedBlocksBatch( ctx context.Context, sourceStoreURL string, destStoreURL string, fileBlockSize uint64, blockRange BlockRange, ) error
CheckMergedBlocksBatch will write a list of base-block-numbers to a store, for merged-blocks-files that are broken or missing broken merged-blocks-files are the ones that contain "empty" blocks (no ID) or unlinkable blocks there could be false positives on unlinkable blocks, though output files are like this: 0000123100.broken 0000123500.missing
func PrettyBlockNum ¶
func RangeBoundaryNames ¶ added in v0.1.9
func RangeBoundaryNames() []string
RangeBoundaryNames returns a list of possible string values of RangeBoundary.
func RoundToBundleEndBlock ¶
func RoundToBundleStartBlock ¶
func WalkBlockPrefix ¶
func WalkBlockPrefix(blockRange BlockRange, fileBlockSize uint64) string
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 ¶ added in v0.1.0
func GetBlockRangeFromArg(in string) (out BlockRange, err error)
func GetBlockRangeFromFlag ¶ added in v0.1.0
func GetBlockRangeFromFlag(cmd *cobra.Command, flagName string) (out BlockRange, err error)
func NewClosedRange ¶ added in v0.1.0
func NewClosedRange(start int64, stop uint64) BlockRange
func NewOpenRange ¶ added in v0.1.0
func NewOpenRange(start int64) BlockRange
func (BlockRange) BlockCount ¶ added in v0.1.9
func (b BlockRange) BlockCount() int64
func (BlockRange) Contains ¶ added in v0.1.9
func (b BlockRange) Contains(blockNum uint64, endBoundary RangeBoundary) bool
func (BlockRange) GetStartBlock ¶ added in v0.2.1
func (b BlockRange) GetStartBlock() int64
func (BlockRange) GetStopBlockOr ¶ added in v0.1.0
func (b BlockRange) GetStopBlockOr(defaultIfOpenRange uint64) uint64
func (BlockRange) IsClosed ¶ added in v0.1.0
func (b BlockRange) IsClosed() bool
func (BlockRange) IsOpen ¶ added in v0.1.0
func (b BlockRange) IsOpen() bool
func (BlockRange) IsResolved ¶ added in v0.1.0
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 ¶ added in v0.1.9
func (b BlockRange) Split(chunkSize uint64, endBoundary RangeBoundary) ([]BlockRange, error)
func (BlockRange) String ¶
func (b BlockRange) String() string
func (BlockRange) ToBstreamRange ¶ added in v0.1.9
func (b BlockRange) ToBstreamRange(endBoundary RangeBoundary) *bstream.Range
type PrintDetails ¶
type PrintDetails uint8
const ( PrintNoDetails PrintDetails = iota PrintStats PrintFull MaxUint64 = ^uint64(0) )
type RangeBoundary ¶ added in v0.1.9
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 ¶ added in v0.1.9
func ParseRangeBoundary(name string) (RangeBoundary, error)
ParseRangeBoundary attempts to convert a string to a RangeBoundary.
func (RangeBoundary) IsValid ¶ added in v0.1.9
func (x RangeBoundary) IsValid() bool
IsValid provides a quick way to determine if the typed value is part of the allowed enumerated values
func (RangeBoundary) MarshalText ¶ added in v0.1.9
func (x RangeBoundary) MarshalText() ([]byte, error)
MarshalText implements the text marshaller method.
func (RangeBoundary) String ¶ added in v0.1.9
func (x RangeBoundary) String() string
String implements the Stringer interface.
func (*RangeBoundary) UnmarshalText ¶ added in v0.1.9
func (x *RangeBoundary) UnmarshalText(text []byte) error
UnmarshalText implements the text unmarshaller method.