Listening to events; custom events

I’m experimenting with writing my own task driver plugin, something I want to use programatically from an application.
I have a couple of questions about events.
It’s like to listen to events in my application, so that I can update application status when the task is running etc. Although the HTTP API seems to have an endpoint for this, I can’t see anything obvious in the Go API. Is this something that is supported?
Also I would like to send some custom events through to the application. The declaration of an event doesn’t seem to preclude this, but I wondered whether nomad would like me sending arbitrary events?

In the absence of this, I can just use an out of band mechanism like NATS, but if I could subscribe to nomad task events in my application, and if I could send through custom events, it would seem to make things simpler.


Ah. I see that in the code there is in fact a method on the Client, EventStream that gives you access to the /v1/event/stream endpoint. This isn’t in the documentation I’ve been looking at, which I see is 0.8.7 I think. I can’t actually find the godoc for the nomad v1 API at the moment.