Go Nats API Example
This example show how to use Nats to create API.
Project use Go modules to download dependencies.
You can see dependencies in go.mod
Docker
How to install:
- Install Docker-CE (ubuntu)
- Install Docker compose
- In project root:
sudo docker-compose up
Settings file
API settings file use RFC7159
Example settings.json (all settings is required) :
{
"name": "api",
"version": "1.0.0",
"nats": {
"version" : "1.4.2",
"reconnectedWait" : 5,
"address" : [
{
"host" : "localhost",
"port" : "54222"
},
{
"host" : "localhost",
"port" : "54222"
}
]
}
}