MESH ONLINECODENAME:
v0.34

Go SDK

The Go binding exposes the event bus, capability discovery, and nRPC through cgo. Bus consumption is cursor-based: call Poll rather than iterating an async stream. Every operation returns an error for the caller to handle.

shell
go get github.com/ai-2070/net/go

The package identifier is net, so calls read net.New(...) and net.NewMeshNode(...). The required native shared library must also be available to the compiler and at runtime; see the Go install guide.

Choose the entry point

  • net.New creates the event bus and exposes Ingest and Poll.
  • net.NewMeshNode creates the mesh node for capability announcements and discovery. net.NewMeshRpc supplies tools and RPC.

Follow the capability path

  1. Quickstart
  2. Announce
  3. Discover
  4. Invoke
  5. Watch
  6. Artifacts
  7. Errors

Protected services

Organization auth (concepts) is at parity: net.ServeOrg[Req, Resp] / net.OrgCall[Req, Resp] over libnet_org. The subnet authority plane (concepts) adds net.ServeSubnetExported[Req, Resp](node, service, exportName, handler) for a provider inside a protected subnet (exportName resolves against MeshConfig.SubnetExports), net.CallExported[Req, Resp](ctx, client, service, req) on the org client, and the runtime admin verbs (InstallSubnetGatewayCredentials, DeclareSubnetBoundaries, ApplySubnetControlFact). Classify subnet:<kind> failures with errors.Is(err, net.ErrSubnet) and net.ParseSubnetKind (reference).

Subnet trust anchors are construction-time state on MeshConfig: SubnetAuthorities, SubnetAttachment, SubnetControlChannel, and SubnetExports. Rust converts and validates them through the same frozen DTOs every other SDK uses, before the node exists, so a standalone Go program can stand up a subnet gateway on its own.

The Artifacts page records the current cross-peer transfer gap rather than substituting another language's API.