package tlv

import "github.com/influxdata/influxdb/cmd/influx_tools/internal/tlv"

Package tlv contains code to read and write type-length-value messages.

Index

Constants

const MaxMessageSize = 1024 * 1024 * 1024 // 1GB

MaxMessageSize defines how large a message can be before we reject it.

Functions

func ReadLV

func ReadLV(r io.Reader) ([]byte, error)

ReadLV reads the length-value from a TLV record.

func ReadTLV

func ReadTLV(r io.Reader) (byte, []byte, error)

ReadTLV reads a type-length-value record from r.

func ReadType

func ReadType(r io.Reader) (byte, error)

ReadType reads the type from a TLV record.

func WriteLV

func WriteLV(w io.Writer, buf []byte) error

WriteLV writes the length-value in a TLV record to w.

func WriteTLV

func WriteTLV(w io.Writer, typ byte, buf []byte) error

WriteTLV writes a type-length-value record to w.

func WriteType

func WriteType(w io.Writer, typ byte) error

WriteType writes the type in a TLV record to w.

Source Files

tlv.go

Version
v1.12.0 (latest)
Published
Apr 8, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
2 days ago

Tools for package owners.