iomesh-client-sdk-go

module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT

README

I/O Mesh Client SDK for Go

CI Go Reference

Official Go client SDK for the I/O Mesh broker and connector platform.

Capability Package
HTTP publish / pull subscribe / streams / KV / memory aionclient
Partner webhook HMAC + observation envelopes connectorsdk
Aion Kafka protocol (Produce subset) kafka · via aionclient.KafkaClient
Shared envelope + CUID helpers envelope · cuid

Module path: github.com/iome-sh/iomesh-client-sdk-go
Package name aionclient: stable API name for the mesh HTTP client (historical “Aion” core). Prefer this module over the deprecated monorepo path mesh-client-sdk-go.

Requirements

  • Go 1.22+ (module declares the toolchain used in CI)
  • Network access to an I/O Mesh broker (or local foundation)

Install

go get github.com/iome-sh/iomesh-client-sdk-go@v0.1.0

Quick start — connect and publish

package main

import (
	"context"
	"log"

	"github.com/iome-sh/iomesh-client-sdk-go/aionclient"
)

func main() {
	nc, err := aionclient.Connect(
		aionclient.Options{URL: "http://127.0.0.1:8422"},
		aionclient.WithTenant("dept.engineering"),
		aionclient.WithOrg("acme-org"),
	)
	if err != nil {
		log.Fatal(err)
	}

	ctx := context.Background()
	if err := nc.CreateStream(ctx, aionclient.StreamConfig{
		Name:     "EVENTS",
		Subjects: []string{"dept.engineering.events.>"},
	}); err != nil {
		log.Fatal(err)
	}

	ack, err := nc.Publish(ctx, "EVENTS", "dept.engineering.events.demo", []byte(`{"hello":"mesh"}`))
	if err != nil {
		log.Fatal(err)
	}
	log.Printf("published seq=%d subject=%s partition=%d", ack.Seq, ack.Subject, ack.Partition)
}

Connector SDK (HMAC + envelope)

import "github.com/iome-sh/iomesh-client-sdk-go/connectorsdk"

payload, err := connectorsdk.NormalizeEnvelope(
	"acme-crm", "engineering", "acme-crm", "evt-42", "contact.created",
	json.RawMessage(`{"email":"user@example.com"}`),
)

See examples/connector-sdk-template/ for a full webhook adapter.

Kafka Produce

kc := aionclient.NewKafkaClient("127.0.0.1:9423")
defer kc.Close()

offset, err := kc.Produce(ctx, "aion.finance.events", 0, []byte("key"), []byte(`{"event_id":"evt-1"}`))

Security

  • Report vulnerabilities privately: see SECURITY.md.
  • Do not commit API tokens, broker URLs with credentials, or customer payloads into issues/PRs.
  • Prefer short-lived bearer tokens (WithBearerToken) and tenant-scoped headers (WithTenant / WithOrg).
  • Connector HMAC secrets must stay server-side; never embed partner secrets in mobile or browser clients.

Versioning & support

  • Semantic versioning (vMAJOR.MINOR.PATCH).
  • Breaking changes only in major versions; see CHANGELOG.md and RELEASING.md.
  • Supported Go versions: last two stable releases (CI matrix).

Development

go test ./...
go test -race ./...
golangci-lint run ./...   # if installed

Integration tests that require a live broker or monorepo harness are tagged //go:build ignore and run from the I/O Mesh platform monorepo.

Repo Role
iome-sh/aion Platform / broker (private)
iome-sh/iomesh Marketing site
Upcoming iomesh-client-sdk-ts, iomesh-client-sdk-python, …

License

MIT © 2026 iome.sh

Directories

Path Synopsis
Package aionclient is the Go SDK for Aion, wrapping the HTTP /v1 API.
Package aionclient is the Go SDK for Aion, wrapping the HTTP /v1 API.
Package connectorsdk provides partner-facing helpers for third-party webhook adapters: HMAC verification (GitHub sha256= style), observation envelope normalization, and broker publish metadata.
Package connectorsdk provides partner-facing helpers for third-party webhook adapters: HMAC verification (GitHub sha256= style), observation envelope normalization, and broker publish metadata.
Package cuid wraps github.com/nrednav/cuid2 for consistent ID generation across Aion.
Package cuid wraps github.com/nrednav/cuid2 for consistent ID generation across Aion.
Package envelope defines the §11 agent message schema for the PoC simulation.
Package envelope defines the §11 agent message schema for the PoC simulation.
examples
connector-sdk-template command
Connector SDK template (v13 P5) — minimal third-party webhook adapter that verifies HMAC, normalizes an observation envelope, and POSTs to Aion broker connector ingress using connectorsdk.
Connector SDK template (v13 P5) — minimal third-party webhook adapter that verifies HMAC, normalizes an observation envelope, and POSTs to Aion broker connector ingress using connectorsdk.

Jump to

Keyboard shortcuts

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