Registry / messaging / nats-io-nats-go

nats-io-nats-go

JSON →
library1.52.0gogounverified

A Go client for the NATS messaging system, providing publish/subscribe and request/reply messaging patterns.

go get github.com/nats-io/nats.go
INSTALL
IMPORT
SIG · NATS-IO-NATS-GO
N
nats-io-nats-go
messaginggov1.52.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

nats
github.com/nats-io/nats.go

Connect to NATS, subscribe to a subject, and publish a message.

package main import ( "log" "github.com/nats-io/nats.go" ) func main() { nc, err := nats.Connect(nats.DefaultURL) if err != nil { log.Fatal(err) } defer nc.Close() nc.Subscribe("foo", func(m *nats.Msg) { log.Printf("Received: %s", string(m.Data)) }) nc.Publish("foo", []byte("Hello NATS!")) select {} }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.52.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
Amazon
1
OpenAI (training)
1
Resources
nats-io-nats-go — go get nats-io-nats-go · libregistry