A simple web server that serves up GPSD SKY and TPV data via SSE (ServerSideEvents).
GPSD_SERVER
- The IP and port of the gpsd process. (default:localhost:2947
)
The simple compile and run in one:
$ go run yogogps.go
Or compile and then run the binary:
$ go build yogogps.go
$ ./yogogps.go
Note: go install
won't work unless you then run it from the current project directory due to the required template and static files.
Once running, navigate the running host's URL on port 8555 (e.g. http://localhost:8555) to view the gps information.
The /metrics
endpoint provide some basic prometheus style metrics:
yogogps_gps_satellites_count
- number of satellites currently receivedyogogps_gps_lat
- currently computed latitudeyogogps_gps_lon
- currently computer longitudeyogogps_num_clients
- number of actively attached (SSE) clients viewing/using the server
To run the tests:
$ go test
SSE Go example - https://gist.github.com/rikonor/e53a33c27ed64861c91a095a59f0aa44 GPSD Client for go - https://github.com/stratoberry/go-gpsd