gasterix

package module
v0.0.0-...-38c4600 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 1

README

ASTERIX for golang

Documentation

Overview

Package gasterix provides a unified API for encoding and decoding ASTERIX data. It coordinates the block-level parsing with category-specific decoders.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Encode

func Encode(blk *Block) ([]byte, error)

Encode encodes a Block into raw bytes.

Types

type Block

type Block struct {
	Category uint8
	Records  []any // Category-specific record types (e.g., *cat62.Track)
}

Block represents a decoded ASTERIX data block with typed records.

func Decode

func Decode(data []byte) (*Block, int, error)

Decode decodes a single ASTERIX block from raw bytes. Returns the decoded block and the number of bytes consumed.

func DecodeAll

func DecodeAll(data []byte) ([]*Block, error)

DecodeAll decodes all ASTERIX blocks from raw bytes.

func (*Block) Cat62Tracks

func (b *Block) Cat62Tracks() []*cat62.Track

Cat62Tracks is a helper to extract *cat62.Track records from a Block. Returns nil if the block is not category 62.

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder reads ASTERIX blocks from an input stream.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder returns a new decoder that reads from r.

func (*Decoder) Decode

func (d *Decoder) Decode() (*Block, error)

Decode reads and returns the next ASTERIX block from the stream. Returns io.EOF when there are no more blocks.

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

Encoder writes ASTERIX blocks to an output stream.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder returns a new encoder that writes to w.

func (*Encoder) Encode

func (e *Encoder) Encode(blk *Block) error

Encode writes an ASTERIX block to the stream.

Directories

Path Synopsis
Package block implements ASTERIX Data Block envelope encoding and decoding.
Package block implements ASTERIX Data Block envelope encoding and decoding.
Package cat62 implements ASTERIX Category 062 - SDPS Track Messages.
Package cat62 implements ASTERIX Category 062 - SDPS Track Messages.
cmd
extract-test-data command
extract-test-data extracts ASTERIX payloads from pcap for use as test vectors
extract-test-data extracts ASTERIX payloads from pcap for use as test vectors
genpcap command
genpcap generates a pcap file with various ASTERIX test data
genpcap generates a pcap file with various ASTERIX test data
pcapdump command
pcapdump reads a pcap file and decodes ASTERIX data blocks
pcapdump reads a pcap file and decodes ASTERIX data blocks

Jump to

Keyboard shortcuts

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