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"
|
||||
)
|
||||
|
||||
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)
|
||||
}
|
||||
|
|
|
@ -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.
Loading…
Reference in New Issue