update natsapi

This commit is contained in:
wh1te909 2021-01-26 20:54:30 +00:00
parent ac380c29c1
commit 535079ee87
3 changed files with 6 additions and 7 deletions

View File

@ -9,7 +9,7 @@ import (
"github.com/wh1te909/tacticalrmm/natsapi"
)
var version = "1.0.1"
var version = "1.0.2"
func main() {
ver := flag.Bool("version", false, "Prints version")
@ -23,5 +23,5 @@ func main() {
return
}
api.Listen(*apiHost, *natsHost, *debug)
api.Listen(*apiHost, *natsHost, version, *debug)
}

View File

@ -40,16 +40,15 @@ func getAPI(apihost, natshost string) (string, string, error) {
return "", "", errors.New("unable to parse api from nginx conf")
}
func Listen(apihost, natshost string, debug bool) {
func Listen(apihost, natshost, version string, debug bool) {
api, natsurl, err := getAPI(apihost, natshost)
if err != nil {
log.Fatalln(err)
}
if debug {
log.Println("Api base url: ", api)
log.Println("Nats connection url: ", natsurl)
}
log.Printf("Tactical Nats API Version %s\n", version)
log.Println("Api base url: ", api)
log.Println("Nats connection url: ", natsurl)
rClient.SetHostURL(api)
rClient.SetTimeout(30 * time.Second)

Binary file not shown.