pack

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBuf = &Error{Err: "buffer size too small"} // ErrBuf indicates that the buffer used is too small for the message.

Functions

func A added in v0.1.4

func A(a netip.Addr, msg []byte, off int) (int, error)

func AAAA added in v0.1.4

func AAAA(aaaa netip.Addr, msg []byte, off int) (int, error)

func Base32 added in v0.1.9

func Base32(s []byte) (buf []byte, err error)

func Base64 added in v0.1.9

func Base64(s []byte) (buf []byte, err error)

func Name added in v0.1.8

func Name(s string, msg []byte, off int, compression map[string]uint16, compress bool) (off1 int, err error)

func Names added in v0.1.9

func Names(names []string, msg []byte, off int, compress map[string]uint16) (int, error)

func String added in v0.1.5

func String(s string, msg []byte, off int) (int, error)

func StringAny

func StringAny(s string, msg []byte, off int) (int, error)

StringAny packs a string as-is, no decoding or length bytes are written.

func StringBase32 added in v0.1.9

func StringBase32(s string, msg []byte, off int) (int, error)

func StringBase64 added in v0.1.9

func StringBase64(s string, msg []byte, off int) (int, error)

func StringHex added in v0.1.9

func StringHex(s string, msg []byte, off int) (int, error)

func StringTxt added in v0.1.9

func StringTxt(s []string, msg []byte, off int) (int, error)

func Txt added in v0.1.9

func Txt(txt []string, msg []byte, off int) (int, error)

func TxtString added in v0.1.5

func TxtString(s string, msg []byte, off int) (int, error)

func Uint16

func Uint16(i uint16, msg []byte, off int) (off1 int, err error)

func Uint32

func Uint32(i uint32, msg []byte, off int) (off1 int, err error)

func Uint48 added in v0.1.4

func Uint48(i uint64, msg []byte, off int) (off1 int, err error)

func Uint64

func Uint64(i uint64, msg []byte, off int) (off1 int, err error)

func Uint8

func Uint8(i uint8, msg []byte, off int) (off1 int, err error)

Types

type Error added in v0.1.8

type Error struct{ Err string }

Error represents a packing error.

func Errorf added in v0.1.8

func Errorf(format string, a ...any) *Error

func (*Error) Error added in v0.1.8

func (e *Error) Error() string

Jump to

Keyboard shortcuts

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