varenc

package
v1.29.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SimpleEncoder

type SimpleEncoder[T UintTypes] struct {
	// contains filtered or unexported fields
}

func (*SimpleEncoder[T]) Decode

func (e *SimpleEncoder[T]) Decode(data []byte) []T

func (SimpleEncoder[T]) DecodeReusable

func (e SimpleEncoder[T]) DecodeReusable(data []byte, values []T)

func (*SimpleEncoder[T]) Encode

func (e *SimpleEncoder[T]) Encode(values []T) []byte

func (SimpleEncoder[T]) EncodeReusable

func (e SimpleEncoder[T]) EncodeReusable(values []T, buf []byte)

func (*SimpleEncoder[T]) Init

func (e *SimpleEncoder[T]) Init(expectedCount int)

type UintTypes

type UintTypes interface {
	uint64 | uint32 | uint16 | uint8
}

type VarEncDataType

type VarEncDataType uint8
const (
	SimpleUint64 VarEncDataType = iota
	SimpleUint32
	SimpleUint16
	SimpleUint8
	SimpleFloat64
	SimpleFloat32
	VarIntUint64 // Variable length encoding for uint64

	// Add new data types here
	DeltaVarIntUint64 = VarIntUint64 + 64
)

type VarEncEncoder

type VarEncEncoder[T any] interface {
	Init(expectedCount int)
	Encode(values []T) []byte
	Decode(data []byte) []T
	EncodeReusable(values []T, buf []byte)
	DecodeReusable(data []byte, values []T)
}

func GetVarEncEncoder64

func GetVarEncEncoder64(t VarEncDataType) VarEncEncoder[uint64]

type VarIntDeltaEncoder

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

func (*VarIntDeltaEncoder) Decode

func (e *VarIntDeltaEncoder) Decode(data []byte) []uint64

func (VarIntDeltaEncoder) DecodeReusable

func (e VarIntDeltaEncoder) DecodeReusable(data []byte, values []uint64)

func (*VarIntDeltaEncoder) Encode

func (e *VarIntDeltaEncoder) Encode(values []uint64) []byte

func (VarIntDeltaEncoder) EncodeReusable

func (e VarIntDeltaEncoder) EncodeReusable(values []uint64, buf []byte)

func (*VarIntDeltaEncoder) Init

func (e *VarIntDeltaEncoder) Init(expectedCount int)

type VarIntEncoder

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

func (*VarIntEncoder) Decode

func (e *VarIntEncoder) Decode(data []byte) []uint64

func (VarIntEncoder) DecodeReusable

func (e VarIntEncoder) DecodeReusable(data []byte, values []uint64)

func (*VarIntEncoder) Encode

func (e *VarIntEncoder) Encode(values []uint64) []byte

func (VarIntEncoder) EncodeReusable

func (e VarIntEncoder) EncodeReusable(values []uint64, buf []byte)

func (*VarIntEncoder) Init

func (e *VarIntEncoder) Init(expectedCount int)

Jump to

Keyboard shortcuts

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