Middleware sse provides Server-Sent Events to channels binding for Macaron.
go get github.com/go-macaron/sockets
Have a look into the example directory to get a feeling for how to use the sse package.
This package essentially provides a binding of Server-Sent Event to channels, which you can use as in the following, contrived example:
m.Get("/stat", sse.Handler(stat{}), func(msg chan<- *stat) {
for {
select {
case <-time.Tick(1 * time.Second):
msg <- getStat()
}
}
})