rangelist

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

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

Builder is used to create key range list.

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates a key range list builder.

func (*Builder) AddItem

func (b *Builder) AddItem(start, end []byte, data interface{})

AddItem pushes an item to key range list.

func (*Builder) Build

func (b *Builder) Build() List

Build creates the key range list.

func (*Builder) SetCompareFunc

func (b *Builder) SetCompareFunc(f func(a, b interface{}) int)

SetCompareFunc sets up the comparer to determine item order (ascending) for a key range.

type List

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

List manages a list of key ranges.

func (List) Get

func (l List) Get(i int) ([]byte, []interface{})

Get returns key and items at the position.

func (List) GetData

func (l List) GetData(start, end []byte) (index int, data []interface{})

GetData returns position and items by key range.

func (List) GetDataByKey

func (l List) GetDataByKey(key []byte) (index int, data []interface{})

GetDataByKey returns position and items by key.

func (List) GetSplitKeys

func (l List) GetSplitKeys(start, end []byte) [][]byte

GetSplitKeys returns all split points in a range.

func (List) Len

func (l List) Len() int

Len returns count of all segments.

Jump to

Keyboard shortcuts

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