encoding

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package encoding provides tag value encoding functionality with optimal compression for different data types including int64, float64, and other types using dictionary encoding with fallback to plain encoding with zstd compression.

Index

Constants

View Source
const (
	// EntityDelimiter is the delimiter for entities in a variable-length array.
	EntityDelimiter = '|'
	// Escape is the escape character for entities in a variable-length array.
	Escape = '\\'
)

Variables

This section is empty.

Functions

func DecodeTagValues

func DecodeTagValues(dst [][]byte, decoder *encoding.BytesBlockDecoder, bb *bytes.Buffer, valueType pbv1.ValueType, count int) ([][]byte, error)

DecodeTagValues decodes tag values based on the value type.

func EncodeTagValues

func EncodeTagValues(bb *bytes.Buffer, values [][]byte, valueType pbv1.ValueType) error

EncodeTagValues encodes tag values based on the value type with optimal compression. For int64: uses delta encoding with first value storage. For float64: converts to decimal integers with exponent, then delta encoding. For other types: uses dictionary encoding, falls back to plain with zstd compression.

func MarshalVarArray

func MarshalVarArray(dest, src []byte) []byte

MarshalVarArray marshals a byte slice into a variable-length array format. It escapes delimiter and escape characters within the source slice.

func UnmarshalVarArray

func UnmarshalVarArray(dest, src []byte) ([]byte, []byte, error)

UnmarshalVarArray unmarshals a variable-length array into a byte slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

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