Back to Netdata

Shared CGO Packages

src/go/plugin/ibm.d/pkg/README.md

2.10.3843 B
Original Source

Shared CGO Packages

The pkg/ directory houses low-level building blocks that require CGO and are shared by multiple protocols/modules.

Current packages:

PackageDescription
dbdriver/Thin wrappers around IBM’s DB2 CLI driver (dynamic loading, environment setup).
odbcbridge/Lightweight bridge that exposes ODBC handles to Go code with safe conversions.
odbcwrapper/Higher-level helpers for executing queries and scanning results through the bridge.

These packages are intentionally small and focus on ABI boundaries. Business logic belongs in protocols/ and modules/.

When touching CGO code remember to:

  • Keep build tags accurate (//go:build cgo).
  • Free allocated C resources even on error paths.
  • Document any required compile-time flags or environment variables.