indexed

package
v0.15.17 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write[T any](
	writer BufferedEncoder,
	items iter.Seq2[T, error],
) ([]int, error)

Types

type BufferedEncoder

type BufferedEncoder struct {
	*bytes.Buffer
	encoder.Encoder
}

func NewBufferedEncoder

func NewBufferedEncoder() BufferedEncoder

type LazySlice

type LazySlice[T any] struct {
	// contains filtered or unexported fields
}

Items are stored contiguously in a data slice, with an indexes slice marking each item’s start offset. The data is encoded using CBOR and deserialized into type T on demand. Example:

data: [00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19] - ----- -------- -------------- - ↑ ↑ ↑ ↑ indexes: [10 12 15] 20 (len(data))

func NewLazySlice

func NewLazySlice[T any](indexes []int, data []byte) LazySlice[T]

func (LazySlice[T]) All

func (l LazySlice[T]) All() ([]T, error)

func (LazySlice[T]) Get

func (l LazySlice[T]) Get(index int) (T, error)

Jump to

Keyboard shortcuts

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