Documentation ¶
Index ¶
- type Index
- func (idx *Index) Bump(before *Index) (*Index, error)
- func (idx *Index) Increment(segment int) (*Index, error)
- func (idx *Index) Length() int
- func (idx *Index) Less(other *Index) bool
- func (idx *Index) MustBump(previous *Index) *Index
- func (idx *Index) MustIncrement(segment int) *Index
- func (idx *Index) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index represents a sortable dataset index, e.g. 1 < 1_1 < 1_1_1 < 1_2 < 2
func (*Index) Bump ¶
Bump returns the next index that is greater than the current one, but still less than the index provided in the parameter.
Bump doesn't increment the first, major segment of the index, it starts from the second segment instead.
func (*Index) Increment ¶
Increment returns a new dataset index that is incremented by one in the specified segment
func (*Index) MustBump ¶
MustBump returns the next index that is greater than the current one, but still less than the index provided in the parameter. Panics on error
func (*Index) MustIncrement ¶
MustIncrement returns a new dataset index that is incremented by one in the specified segment, panics on error