update natsapi
This commit is contained in:
parent
ac380c29c1
commit
535079ee87
4
main.go
4
main.go
|
@ -9,7 +9,7 @@ import (
|
||||||
"github.com/wh1te909/tacticalrmm/natsapi"
|
"github.com/wh1te909/tacticalrmm/natsapi"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "1.0.1"
|
var version = "1.0.2"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ver := flag.Bool("version", false, "Prints version")
|
ver := flag.Bool("version", false, "Prints version")
|
||||||
|
@ -23,5 +23,5 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
api.Listen(*apiHost, *natsHost, *debug)
|
api.Listen(*apiHost, *natsHost, version, *debug)
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,16 +40,15 @@ func getAPI(apihost, natshost string) (string, string, error) {
|
||||||
return "", "", errors.New("unable to parse api from nginx conf")
|
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)
|
api, natsurl, err := getAPI(apihost, natshost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if debug {
|
log.Printf("Tactical Nats API Version %s\n", version)
|
||||||
log.Println("Api base url: ", api)
|
log.Println("Api base url: ", api)
|
||||||
log.Println("Nats connection url: ", natsurl)
|
log.Println("Nats connection url: ", natsurl)
|
||||||
}
|
|
||||||
|
|
||||||
rClient.SetHostURL(api)
|
rClient.SetHostURL(api)
|
||||||
rClient.SetTimeout(30 * time.Second)
|
rClient.SetTimeout(30 * time.Second)
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue