2021-01-12 06:32:00 +00:00
|
|
|
package main
|
|
|
|
|
2021-01-16 00:01:31 +00:00
|
|
|
// env CGO_ENABLED=0 go build -v -a -tags netgo -installsuffix netgo -ldflags "-s -w" -o nats-api
|
|
|
|
|
2021-01-12 06:32:00 +00:00
|
|
|
import (
|
2021-01-12 21:14:43 +00:00
|
|
|
"flag"
|
2021-01-15 18:21:25 +00:00
|
|
|
"fmt"
|
2021-01-12 21:14:43 +00:00
|
|
|
|
2021-01-12 06:32:00 +00:00
|
|
|
"github.com/wh1te909/tacticalrmm/natsapi"
|
|
|
|
)
|
|
|
|
|
2021-02-16 17:09:05 +00:00
|
|
|
var version = "1.0.7"
|
2021-01-15 18:21:25 +00:00
|
|
|
|
2021-01-12 06:32:00 +00:00
|
|
|
func main() {
|
2021-01-15 18:21:25 +00:00
|
|
|
ver := flag.Bool("version", false, "Prints version")
|
2021-01-16 00:01:31 +00:00
|
|
|
apiHost := flag.String("api-host", "", "django full base url")
|
|
|
|
natsHost := flag.String("nats-host", "", "nats full connection string")
|
2021-01-12 21:14:43 +00:00
|
|
|
debug := flag.Bool("debug", false, "Debug")
|
|
|
|
flag.Parse()
|
|
|
|
|
2021-01-15 18:21:25 +00:00
|
|
|
if *ver {
|
|
|
|
fmt.Println(version)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2021-01-26 20:54:30 +00:00
|
|
|
api.Listen(*apiHost, *natsHost, version, *debug)
|
2021-01-12 06:32:00 +00:00
|
|
|
}
|