sbe

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

package sbe implements simple binary encoding formats for serializing and deserializing data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendLP

func AppendLP(out []byte, x []byte) []byte

AppendLP appends a length-prefixed byte slice to out. the length is encoded as a varint

func AppendLP16

func AppendLP16(out []byte, x []byte) []byte

AppendLP16 appends a length-prefixed byte slice to out. the length is encoded as a 16-bit little-endian integer.

func AppendUVarint

func AppendUVarint(out []byte, x uint64) []byte

func AppendUint16

func AppendUint16(out []byte, x uint16) []byte

func AppendUint32

func AppendUint32(out []byte, x uint32) []byte

func AppendUint64

func AppendUint64(out []byte, x uint64) []byte

func ReadLP

func ReadLP(x []byte) (data []byte, rest []byte, _ error)

ReadLP reads a length-prefixed byte slice from data. ReadLP reads the format output by AppendLP.

func ReadLP16

func ReadLP16(x []byte) (ret []byte, rest []byte, _ error)

ReadLP16 reads a length-prefixed byte slice from data. ReadLP16 reads the format output by AppendLP16.

func ReadN

func ReadN(data []byte, n int) ([]byte, []byte, error)

ReadN reads n bytes from data.

func ReadUVarint

func ReadUVarint(data []byte) (uint64, []byte, error)

func ReadUint16

func ReadUint16(data []byte) (uint16, []byte, error)

func ReadUint64

func ReadUint64(data []byte) (uint64, []byte, error)

Types

type Marshaler

type Marshaler interface {
	Marshal(out []byte) []byte
}

Jump to

Keyboard shortcuts

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