utils

package
v2.2.6 Latest Latest
Warning

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

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

Documentation

Overview

Package utils provides decoding helpers shared across flow decoders.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryDecoder

func BinaryDecoder(payload *bytes.Buffer, dests ...interface{}) error

BinaryDecoder decodes multiple values from the buffer using big-endian encoding.

func BinaryRead added in v2.1.0

func BinaryRead(payload BytesBuffer, order binary.ByteOrder, data any) error

BinaryRead decodes a single value from the buffer using the supplied byte order.

Types

type BytesBuffer added in v2.1.0

type BytesBuffer interface {
	io.Reader
	Next(int) []byte
}

BytesBuffer is a minimal buffer interface for decoding helpers.

type IPAddress added in v2.1.1

type IPAddress []byte

IPAddress is a byte slice rendered as an IP address in JSON.

func (IPAddress) MarshalJSON added in v2.1.1

func (s IPAddress) MarshalJSON() ([]byte, error)

MarshalJSON formats the IP address as a JSON string.

type MacAddress added in v2.1.1

type MacAddress []byte

MacAddress is a byte slice rendered as a MAC address in JSON.

func (*MacAddress) MarshalJSON added in v2.1.1

func (s *MacAddress) MarshalJSON() ([]byte, error)

MarshalJSON formats the MAC address as a JSON string.

Jump to

Keyboard shortcuts

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