Skip to content

add Go aiscat binding - #561

Open
ngtrthanh wants to merge 2 commits into
jvde-github:mainfrom
ngtrthanh:codex/go-aiscat-binding
Open

add Go aiscat binding#561
ngtrthanh wants to merge 2 commits into
jvde-github:mainfrom
ngtrthanh:codex/go-aiscat-binding

Conversation

@ngtrthanh

Copy link
Copy Markdown
Contributor

Summary

Adds a Go module under go/aiscat that binds AIS-catcher's existing C++ NMEA-to-JSON decoder through cgo. The API mirrors the Python aiscat package with a streaming Decoder, one-shot decode helpers, reader/TCP/UDP stream helpers, and the same output formats: dictionary, annotated, json, json_nmea, nmea, nmea_tag, and binary.

The native bridge compiles the same focused AIS-catcher source subset used by the Python binding (Marine, JSON, Library, and Utilities) and keeps the host-language layer thin.

User Impact

Go users can consume AIS-catcher's decoder directly from Go services without shelling out to the CLI, while retaining output compatibility with AIS-catcher JSON and the Python binding behavior.

Notes

  • Requires cgo and a C++11 compiler.
  • Includes a no-cgo fallback with a clear runtime error.
  • README documents Windows verification with Zig.

Validation

Ran from go/aiscat:

go test ./...
$env:CGO_ENABLED='1'; $env:CC='zig cc'; $env:CXX='zig c++'; go test ./...
$env:CGO_ENABLED='1'; $env:CC='zig cc'; $env:CXX='zig c++'; go run .\examples\decode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant