Registry / messaging / nats-io-nats

nats-io-nats

JSON →
library1.52.0gogounverified

A Go client for the NATS messaging system.

go get github.com/nats-io/nats
INSTALL
IMPORT
SIG · NATS-IO-NATS
N
nats-io-nats
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

Connects to NATS, subscribes to a subject, and publishes a message.

package main import ( "fmt" "github.com/nats-io/nats" ) func main() { nc, _ := nats.Connect(nats.DefaultURL) defer nc.Close() nc.Subscribe("foo", func(m *nats.Msg) { fmt.Printf("Received: %s\n", string(m.Data)) }) nc.Publish("foo", []byte("Hello NATS!")) select {} }
Debug
Known issues
breakingBreaking changes between v1 and v2; v2 uses a different API.
fix
Use v2 (github.com/nats-io/nats/v2) for new projects.
affects: >=2.0.0
Upgrade
Version history
1.52.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

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