Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DemoHanderFunc ¶ added in v0.5.7
func DemoHanderFunc(w http.ResponseWriter, r *http.Request)
DemoHanderFunc time tick SSE
func NewHandler ¶
func NewHandler(h Streamer) http.HandlerFunc
NewHandler returns a HandlerFunc that writes/loop the event to the ResponseWriter.
Types ¶
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event a single event in SSE stream using json marshal encoding
func NewMessage ¶
NewMessage is a special Event using a single/default message in an SSE stream.
func (Event) RawBytes ¶ added in v0.5.7
RawBytes set marshal the event as a byte slice. Escape '\n' to '\r\n'
Click to show internal directories.
Click to hide internal directories.