mirror of
https://github.com/taigrr/nats.docs
synced 2025-01-18 04:03:23 -08:00
Replace go-nats with nats.go in examples
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
This commit is contained in:
@@ -29,13 +29,13 @@ The NATS benchmark can be installed and run via Go. Ensure your golang environm
|
||||
There are two approaches; you can either install the `nats-bench` utility in the directory specified in your `GOBIN` environment variable:
|
||||
|
||||
```sh
|
||||
% go install $GOPATH/src/github.com/nats-io/go-nats/examples/nats-bench.go
|
||||
% go install $GOPATH/src/github.com/nats-io/nats.go/examples/nats-bench.go
|
||||
```
|
||||
|
||||
... or you can simply run it via `go run`:
|
||||
|
||||
```sh
|
||||
% go run $GOPATH/src/github.com/nats-io/go-nats/examples/nats-bench.go
|
||||
% go run $GOPATH/src/github.com/nats-io/nats.go/examples/nats-bench.go
|
||||
```
|
||||
|
||||
*On windows use the % environment variable syntax, replacing `$GOPATH` with `%GOPATH%`.*
|
||||
|
||||
@@ -216,9 +216,9 @@ At minimum the server requires the `operator` JWT, which we have pointed at dire
|
||||
Let’s install some tooling:
|
||||
|
||||
```text
|
||||
> go get github.com/nats-io/go-nats/examples/nats-pub
|
||||
> go get github.com/nats-io/nats.go/examples/nats-pub
|
||||
|
||||
> go get github.com/nats-io/go-nats/examples/nats-sub
|
||||
> go get github.com/nats-io/nats.go/examples/nats-sub
|
||||
```
|
||||
|
||||
Create a subscriber:
|
||||
|
||||
@@ -100,7 +100,7 @@ To test the service, we can install the `nats-req` and `nats-rply` tools:
|
||||
|
||||
Set up a process to handle the request:
|
||||
```text
|
||||
> go get github.com/nats-io/go-nats/examples/nats-rply
|
||||
> go get github.com/nats-io/nats.go/examples/nats-rply
|
||||
|
||||
> nats-rply -creds ~/.nkeys/Test/accounts/AccountB/users/userb.creds "help" "I will help"
|
||||
Listening on [help]
|
||||
@@ -108,7 +108,7 @@ Listening on [help]
|
||||
|
||||
Send the request:
|
||||
```text
|
||||
> go get github.com/nats-io/go-nats/examples/nats-req
|
||||
> go get github.com/nats-io/nats.go/examples/nats-req
|
||||
> nats-req -creds ~/.nkeys/Test/accounts/AccountB/users/userb.creds help me
|
||||
Published [help] : 'me'
|
||||
```
|
||||
@@ -290,4 +290,4 @@ The service receives the message:
|
||||
The requester receives its response:
|
||||
```text
|
||||
Received [_INBOX.N3IiqWbiAQfPoINCBpBrUM.ZjBNtkB3] : 'I will help'
|
||||
```
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user