Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnableToHijackRequest is returned by AddReceiver if the type // conversion to http.Hijacker is unsuccessful ErrUnableToHijackRequest = errors.New("Unable to hijack request") )
Functions ¶
This section is empty.
Types ¶
type EventReceiver ¶
type EventReceiver struct {
// contains filtered or unexported fields
}
EventReceiver represents a hijacked HTTP connection
type EventStream ¶
type EventStream struct {
// contains filtered or unexported fields
}
EventStream represents a collection of receivers
func (*EventStream) AddReceiver ¶
func (es *EventStream) AddReceiver(w http.ResponseWriter) (*EventReceiver, error)
AddReceiver hijacks a http.ResponseWriter and attaches it to the event stream
func (*EventStream) Notify ¶
func (es *EventStream) Notify(event string, bytes []byte)
Notify sends the event to all event stream receivers
Click to show internal directories.
Click to hide internal directories.