NATS – Go Client install

1. 環境
CentOS Stream 9

2. Installation
2.1 Go client

# go install github.com/nats-io/nats.go@latest
go: downloading github.com/nats-io/nats.go v1.16.0
go: downloading github.com/nats-io/nkeys v0.3.0
go: downloading github.com/nats-io/nuid v1.0.1
go: downloading golang.org/x/crypto v0.0.0-20210314154223-e6e6c4f2bb5b
package github.com/nats-io/nats.go is not a main package
#

2.2 Server

# go install github.com/nats-io/nats-server/v2@latest
go: downloading github.com/nats-io/nats-server v1.4.1
go: downloading github.com/nats-io/nats-server/v2 v2.8.4
go: downloading github.com/klauspost/compress v1.14.4
go: downloading github.com/minio/highwayhash v1.0.2
go: downloading github.com/nats-io/jwt/v2 v2.2.1-0.20220330180145-442af02fd36a
go: downloading golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
go: downloading golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11
go: downloading golang.org/x/sys v0.0.0-20220111092808-5a964db01320
#

3. PKGの確認

# cd /root/go/pkg/mod/github.com/nats-io
# pwd
/root/go/pkg/mod/github.com/nats-io
# ls
jwt              nats-server         nkeys@v0.3.0
nats.go@v1.16.0  nats-server@v1.4.1  nuid@v1.0.1