segment

package
v0.0.0-...-9e5a506 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

func New

func New() *Module

func (*Module) XSegmentedIndex

func (m *Module) XSegmentedIndex(ctx context.Context) *SegmentedIndex

func (*Module) XSharedSegmentedIndex

func (m *Module) XSharedSegmentedIndex(ctx context.Context, name string) *SegmentedIndex

type SegmentedIndex

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

SegmentedIndex ...

func NewSegmentedIndex

func NewSegmentedIndex(start, lcd int64, offsets []int64) *SegmentedIndex

NewSegmentedIndex returns a pointer to a new SegmentedIndex instance, given a starting index, LCD and offsets as returned by GetStripedOffsets().

func (*SegmentedIndex) GoTo

func (s *SegmentedIndex) GoTo(value int64) SegmentedIndexResult

GoTo sets the scaled index to its biggest value for which the corresponding unscaled index is is smaller or equal to value.

func (*SegmentedIndex) Next

Next goes to the next scaled index and moves the unscaled one accordingly.

func (*SegmentedIndex) Prev

Prev goes to the previous scaled value and sets the unscaled one accordingly. Calling Prev when s.scaled == 0 is undefined.

type SegmentedIndexResult

type SegmentedIndexResult struct {
	Scaled, Unscaled int64
}

Jump to

Keyboard shortcuts

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