Arc for Go
Arc for Go is the Go port of Cratis Arc’s HTTP CQRS framework. Without these foundation packages, each application must recreate Arc’s routes, scalar codecs and result envelopes; with them, you share those contracts explicitly.
Start with your first running application.
Go 1.26 or later is required. The Go port supports backend pipelines,
snapshot and observable HTTP hosting, identity, and protected discovery. Typed Go
adapters and bounded TypeScript model/command/snapshot/observable-query proxies are
available, alongside optional Chronicle integration and MongoDB snapshots and
source-only watches. Generated observable clients use WebSocket hub/Delta
transport. React hooks support reconstructing query results, reusing cached
queries and cleaning up subscriptions with explicit WebSocket/Delta providers.
The mounted React lane does not use the full Arc wrapper. A separate
headless-Chromium lane (browser.yml) covers the exported <Arc> wrapper,
StrictMode, cookie ownership and reconnect after a server close; other
browsers, suspense, paging hooks, setter correctness and 30-second cache
expiry remain unverified. MongoDB watches require explicit close/join/reopen after terminal
loss; see the Partial provider
profiles and limits. Opaque provider-source generation, Chronicle
watches, and OpenAPI remain unsupported.
Constructing metadata or a result alone does not execute business code; the
application builder compiles the HTTP endpoints.
For feature coverage and differences from Arc on .NET, consult the
parity map. Contributor verification details are in the repository’s
CONTRIBUTING.md.
Inspect a command route and result
Section titled “Inspect a command route and result”This is the body of the compiled Example. It uses packages
metadata, concepts and commands under github.com/cratis/arc.go, plus fmt.
command := metadata.Command{Type: metadata.TypeName{ Namespace: "Tasks.Registration", Name: "RegisterTask",}}catalog := metadata.Catalog{ Version: metadata.Version, Commands: []metadata.Command{command},}routes, err := metadata.Resolve(catalog, metadata.DefaultOptions())if err != nil { fmt.Println(err) return}id, err := concepts.ParseUUID("00112233-4455-4677-8899-aabbccddeeff")if err != nil { fmt.Println(err) return}result := commands.WithResponse(id, struct { ID string `json:"id"`}{ID: "a1"})response, present := result.Response()fmt.Println(routes[0].Method, routes[0].Path)fmt.Println(result.StatusCode(), response.ID, present)Output:
POST /api/tasks/registration/register-task200 a1 trueChoose a contract
Section titled “Choose a contract”- Concepts and JSON values: UUIDs, dates, ticks and missing/null input.
- Command results: success, rejection and response presence.
- Query results: readiness, paging and change-set values.
- Validation findings: severities and machine-readable reasons.
- Routes and stable identities: explicit metadata and collision diagnostics.
- Generate adapters and proxies: typed Go wiring and bounded TypeScript publication.
- Parity ledger: pinned sources, executable evidence and deliberate differences.
Publication
Section titled “Publication”The root module has tags v0.1.0 through v0.1.3; install it with
go get github.com/cratis/arc.go@latest. Arc.Go is experimental v0 software;
APIs may change between minor releases. See the contribution guide and
release policy. Foundation fixtures and Go-owned hosting tests do not certify full-product,
paired .NET or browser parity. Central documentation-site integration remains separate.