indexed

package
v0.16.6 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferedEncoder

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

func NewBufferedEncoder

func NewBufferedEncoder() BufferedEncoder

func (BufferedEncoder) WriteSeq added in v0.16.6

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

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]) AllMapped added in v0.16.6

func (l LazySlice[T]) AllMapped[R any](
	extract func(index int, value T) (R, error),
) ([]R, error)

func (LazySlice[T]) Get

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

func (LazySlice[T]) Iter added in v0.15.18

func (l LazySlice[T]) Iter() iter.Seq2[T, error]

Jump to

Keyboard shortcuts

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