Skip to content

EggMD/sse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sse

Middleware sse provides Server-Sent Events to channels binding for Macaron.

Installation

go get github.com/go-macaron/sockets

Usage

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()
        }
    }
})

About

SSE Middleware for Macaron.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages