Documentation
¶
Index ¶
Constants ¶
View Source
const CLOSED_CH_BUFFER = 16
View Source
const CLOSE_EVENT_FLAG = 0x1
View Source
const EVENT_CH_BUFFER = 16
View Source
const HEARTBEAT_INTERVAL = time.Second * 15
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct {
// SSE fields
Comment string
Id string
Event string
Data string
// sender source to exclude from dissemination
Source string
// internal flags
Flag int
}
func NewCloseEvent ¶
func NewCloseEvent() *Event
type MultiAssoc ¶
type MultiAssoc struct {
// contains filtered or unexported fields
}
func NewMultiAssoc ¶
func NewMultiAssoc() *MultiAssoc
func (*MultiAssoc) Associate ¶
func (ma *MultiAssoc) Associate(key string, assocKey string, syncStream *SyncStream)
func (*MultiAssoc) Disassociate ¶
func (ma *MultiAssoc) Disassociate(key string, assocKey string)
func (*MultiAssoc) Event ¶
func (ma *MultiAssoc) Event(assocKey string, event *Event)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
type Stream ¶
type Stream struct {
EventCh chan *Event
ResetCh chan bool
// contains filtered or unexported fields
}
func (*Stream) Handle ¶
func (s *Stream) Handle(w http.ResponseWriter)
type SyncStream ¶
type SyncStream struct {
// contains filtered or unexported fields
}
func NewSyncStream ¶
func NewSyncStream(key string, stream *Stream) *SyncStream
func (*SyncStream) Associate ¶
func (ss *SyncStream) Associate(multiAssoc *MultiAssoc, assocKey string)
func (*SyncStream) Disassociate ¶
func (ss *SyncStream) Disassociate()
func (*SyncStream) Event ¶
func (ss *SyncStream) Event(event *Event)
func (*SyncStream) Reset ¶
func (ss *SyncStream) Reset(stream *Stream)
Click to show internal directories.
Click to hide internal directories.